Re: [PATCH 5/5] misc: mlx5ctl: Add umem reg/unreg ioctl

From: Greg Kroah-Hartman
Date: Wed Oct 18 2023 - 04:33:08 EST


On Wed, Oct 18, 2023 at 01:19:41AM -0700, Saeed Mahameed wrote:
> +#define umem_dbg(__mdev, fmt, ...) \
> + dev_dbg((__mdev)->device, "mlx5ctl_umem: " fmt, ##__VA_ARGS__)

That's really really odd, and should not be needed for dev_dbg() because
you already have the driver name and file name and line information in
that message. Why add yet-another-prefix? Please just use normal
dev_dbg() lines.

> +#define MLX5CTL_UMEM_MAX_MB 64
> +
> +static size_t umem_num_pages(u64 addr, size_t len)
> +{
> + return (size_t)((ALIGN(addr + len, PAGE_SIZE) -
> + ALIGN_DOWN(addr, PAGE_SIZE))) /
> + PAGE_SIZE;
> +}

We don't have a function or macro for this already?

thanks,

greg k-h