public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Cc: leon@kernel.org, linux-rdma@vger.kernel.org,
	andrew.gospodarek@broadcom.com, selvin.xavier@broadcom.com,
	kalesh-anakkur.purayil@broadcom.com
Subject: Re: [PATCH rdma-next v9 5/5] RDMA/bnxt_re: Direct Verbs: Support CQ and QP verbs
Date: Wed, 28 Jan 2026 11:32:48 -0400	[thread overview]
Message-ID: <20260128153248.GK1641016@ziepe.ca> (raw)
In-Reply-To: <20260127103109.32163-6-sriharsha.basavapatna@broadcom.com>

On Tue, Jan 27, 2026 at 04:01:09PM +0530, Sriharsha Basavapatna wrote:

>  struct bnxt_re_cq_resp {
> @@ -121,6 +124,7 @@ struct bnxt_re_resize_cq_req {
>  
>  enum bnxt_re_qp_mask {
>  	BNXT_RE_QP_REQ_MASK_VAR_WQE_SQ_SLOTS = 0x1,
> +	BNXT_RE_QP_DV_SUPPORT = 0x2,
>  };

This is set on the response but there are no new response fields? That seems
backwards?
  
>  struct bnxt_re_qp_req {
> @@ -129,11 +133,22 @@ struct bnxt_re_qp_req {
>  	__aligned_u64 qp_handle;
>  	__aligned_u64 comp_mask;
>  	__u32 sq_slots;
> +	__u32 pd_id;
> +	__u32 sq_wqe_sz;
> +	__u32 sq_psn_sz;
> +	__u32 sq_npsn;
> +	__u32 rq_slots;
> +	__u32 rq_wqe_sz;
> +};

How does compatablity work here? Old userspace will send a short
structure, the new kernel should effectively see 0 at all these fields
is that OK? Sizes of 0 sound bad don't they?

New userspace will send a long structure and old kernels will ignore
the new bits. Is that OK?

I would expect you to set QP_REQ_MASK_SIZES in the *req* comp_mask. If
old kernel then the kernel fails the creation and userspace can do
something else.

If the userspace passes QP_REQ_MASK_SIZES and the ioctl succeeds then
everthing is OK. Delete the comp_maks in the rep structure.

Also, what is "pd_id"? The other users of pd_id in prior patches seem
to be actual RDMA PDs. Why is something like this being passed here?
The QP already gets a PD from the core interface, why do you need
another pd?

Also the old kernels have a bug:

	struct bnxt_re_qp_req ureq;

		if (ib_copy_from_udata(&ureq, udata,  min(udata->inlen, sizeof(ureq))))
			return -EFAULT;

It should have been "ureq = {};". Those sorts of things must be fixed
or this compatability stuff is really broken/security problem! Please
audit all your ib_copy_from_udata()s!!

Jason

  reply	other threads:[~2026-01-28 15:32 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27 10:31 [PATCH rdma-next v9 0/5] RDMA/bnxt_re: Support direct verbs Sriharsha Basavapatna
2026-01-27 10:31 ` [PATCH rdma-next v9 1/5] RDMA/uverbs: Support QP creation with user allocated memory Sriharsha Basavapatna
2026-01-27 12:12   ` Jiri Pirko
2026-01-27 13:04     ` Sriharsha Basavapatna
2026-01-28 10:16       ` Jiri Pirko
2026-01-28 12:31   ` Leon Romanovsky
2026-01-27 10:31 ` [PATCH rdma-next v9 2/5] RDMA/bnxt_re: Move the UAPI methods to a dedicated file Sriharsha Basavapatna
2026-01-27 10:31 ` [PATCH rdma-next v9 3/5] RDMA/bnxt_re: Refactor bnxt_qplib_create_qp() function Sriharsha Basavapatna
2026-01-27 10:31 ` [PATCH rdma-next v9 4/5] RDMA/bnxt_re: Direct Verbs: Support DBR verbs Sriharsha Basavapatna
2026-01-27 12:30   ` Jiri Pirko
2026-01-27 14:15     ` Jason Gunthorpe
2026-01-27 15:07       ` Jiri Pirko
2026-01-27 15:56         ` Jason Gunthorpe
2026-01-28 10:04           ` Jiri Pirko
2026-01-28 15:33   ` Jason Gunthorpe
2026-01-27 10:31 ` [PATCH rdma-next v9 5/5] RDMA/bnxt_re: Direct Verbs: Support CQ and QP verbs Sriharsha Basavapatna
2026-01-28 15:32   ` Jason Gunthorpe [this message]
2026-01-28 15:51     ` Jason Gunthorpe
2026-01-28 18:03       ` Sriharsha Basavapatna
2026-01-28 19:41         ` Jason Gunthorpe
2026-01-28 16:54     ` Sriharsha Basavapatna
2026-01-28 17:57       ` Sriharsha Basavapatna
2026-01-28 19:42         ` Jason Gunthorpe
2026-02-02 14:19           ` Sriharsha Basavapatna
2026-02-02 17:48             ` Jason Gunthorpe
2026-02-03  5:05               ` Sriharsha Basavapatna
2026-02-03  8:57                 ` Jiri Pirko
2026-01-28 17:58       ` Jason Gunthorpe
2026-01-28 15:46   ` Jason Gunthorpe
2026-02-02 14:19     ` Sriharsha Basavapatna

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260128153248.GK1641016@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=andrew.gospodarek@broadcom.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=selvin.xavier@broadcom.com \
    --cc=sriharsha.basavapatna@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox