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 13:58:44 -0400 [thread overview]
Message-ID: <20260128175844.GS1641016@ziepe.ca> (raw)
In-Reply-To: <CAHHeUGVLi8ZxK3qpJ+nk6DcDd8365fdru-vPmkKtF6k-P4FAcw@mail.gmail.com>
On Wed, Jan 28, 2026 at 10:24:44PM +0530, Sriharsha Basavapatna wrote:
> On Wed, Jan 28, 2026 at 9:02 PM Jason Gunthorpe <jgg@ziepe.ca> wrote:
> >
> > 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?
> This is set on the response field so that the library can figure out
> if its request for DV QP creation (set through req->comp_mask), was
> successfully executed by the kernel driver or not. If there is an
> older kernel, the resp->comp_mask bit for DV would be 0 and so the new
> library would know its request failed.
It's backwards, we expect old kernels to EOPNOTSUPP when presented
with something that only a new kernel understands. Failing that we
expect that userspace knows to never send something new to an old
kernel with a global flag.
> > 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 kernel won't even look at the new fields if the DV bit is not set
> in req->comp_mask, since bnxt_re_dv_create_qp() won't be called; i.e
> if the request comes from old userspace.
Ok
>
> > New userspace will send a long structure and old kernels will ignore
> > the new bits. Is that OK?
>
> Yes, this is ok, since these new fields are added specifically for the
> DV use-case and a new kernel is required for this functionality.
This does not seem OK, but I guess userspace can detect the resp comp mask
and convert it to a failure. It is not following the design pattern.
> > 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.
> As decisions are made based on DV bit in comp_mask (explained above),
> this is not needed right?
It is, the point is to have a comp mask in the input saying which
values of the input are populated and need to be processed by the
kernel.
I think it is not a big change from what you have here, just check the
comp_mask and add a global bit that this kernel checks those
comp_masks properly. Ideally audit all the structs and make sure all
comp_masks work right so the bit includes everything.
comp_mask should be checked against the list of bits this kernel
supports and if other bits are set return EOPNOTSUPP.
Jason
next prev parent reply other threads:[~2026-01-28 17:58 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
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 [this message]
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=20260128175844.GS1641016@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