Subject: Re: [PATCH v4 02/16] IB/pvrdma: Add user-level shared functions

From: Jason Gunthorpe <[email-masked]>
Date: Mon, 12 Sep 2016 11:49:34 -0600

On Sun, Sep 11, 2016 at 09:49:12PM -0700, Adit Ranadive wrote:
> We share some common structures with the user-level driver. This patch
> adds those structures and shared functions to traverse the QP/CQ rings.

>  create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_uapi.h
>  create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_user.h

The files that are intended to be shared with userspace must be under
include/uapi/, please coordinate with Leon on the path.

Same for all the new drivers.

> +static inline __s32 pvrdma_idx(atomic_t *var, __u32 max_elems)
> +{
> +	const unsigned int idx = atomic_read(var);

Eh? Does this even compile in userspace?

If this is not a userspace header then why does it use __u32 and
related ??

> +#define PVRDMA_UVERBS_ABI_VERSION	3
> +#define PVRDMA_BOARD_ID			1
> +#define PVRDMA_REV_ID			1
> +
> +struct pvrdma_alloc_ucontext_resp {
> +	u32 qp_tab_size;
> +	u32 reserved;
> +};

This certainly looks like a userspace header, shouldn't it use __u32?

NAK

Jason