From: Leon Romanovsky <leon@kernel.org>
To: Konstantin Taranov <kotaranov@microsoft.com>
Cc: Konstantin Taranov <kotaranov@linux.microsoft.com>,
Wei Hu <weh@microsoft.com>,
"sharmaajay@microsoft.com" <sharmaajay@microsoft.com>,
Long Li <longli@microsoft.com>, "jgg@ziepe.ca" <jgg@ziepe.ca>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH rdma-next 1/1] RDMA/mana_ib: indicate that inline data is not supported
Date: Tue, 16 Jul 2024 17:22:23 +0300 [thread overview]
Message-ID: <20240716142223.GC5630@unreal> (raw)
In-Reply-To: <PAXPR83MB0559406ED7CCDAFC0CAEC63DB4A22@PAXPR83MB0559.EURPRD83.prod.outlook.com>
On Tue, Jul 16, 2024 at 01:42:49PM +0000, Konstantin Taranov wrote:
> > > Set max_inline_data to zero during RC QP creation.
> > >
> > > Fixes: fdefb9184962 ("RDMA/mana_ib: Implement uapi to create and
> > > destroy RC QP")
> > > Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
> > > ---
> > > drivers/infiniband/hw/mana/qp.c | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/drivers/infiniband/hw/mana/qp.c
> > > b/drivers/infiniband/hw/mana/qp.c index 73d67c853b6f..d9f24a763e72
> > > 100644
> > > --- a/drivers/infiniband/hw/mana/qp.c
> > > +++ b/drivers/infiniband/hw/mana/qp.c
> > > @@ -426,6 +426,8 @@ static int mana_ib_create_rc_qp(struct ib_qp *ibqp,
> > struct ib_pd *ibpd,
> > > u64 flags = 0;
> > > u32 doorbell;
> > >
> > > + /* inline data is not supported */
> > > + attr->cap.max_inline_data = 0;
> >
> > Can you please point to me to the flow where attr is not zeroed before?
> >
>
> Sorry, I do not understand the question. I cannot point to something that is not in the code.
>
> It is to support the case when user asks for x bytes inlined
> when it creates a QP, and we respond with actual allowed inline
> data for the created QP. (as defined in: "The function ibv_create_qp()
> will update the qp_init_attr->cap struct with the actual QP values of
> the QP that was created;")
>
> The kernel logic is inside "static int create_qp(struct uverbs_attr_bundle *attrs, struct ib_uverbs_ex_create_qp *cmd)"
> where we do the following:
> attr.cap.max_inline_data = cmd->max_inline_data;
> qp = ib_create_qp_user(..,&attr,..);
Awesome, ib_create_qp_user() is called exactly in two places, and in
both cases I see this line "struct ib_qp_init_attr attr = {}; "
It means that attr is zeroed.
Thanks
> resp.base.max_inline_data = attr.cap.max_inline_data;
>
> So, my change makes sure that the response will have 0 and not the value the user asked,
> as we do not support inlining. So without the fix, the user who was asking for inlining was falsely
> seeing that we support it (example of such an application is rdma_server from librdmacm).
>
> Thanks
>
> > Thanks
> >
> > > if (!udata || udata->inlen < sizeof(ucmd))
> > > return -EINVAL;
> > >
> > > --
> > > 2.43.0
> > >
next prev parent reply other threads:[~2024-07-16 14:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-16 10:48 [PATCH rdma-next 1/1] RDMA/mana_ib: indicate that inline data is not supported Konstantin Taranov
2024-07-16 11:14 ` Leon Romanovsky
2024-07-16 13:42 ` Konstantin Taranov
2024-07-16 14:22 ` Leon Romanovsky [this message]
2024-07-16 14:55 ` Konstantin Taranov
2024-07-16 17:06 ` Leon Romanovsky
2024-07-16 17:25 ` [EXTERNAL] " Konstantin Taranov
2024-07-17 6:22 ` Leon Romanovsky
2024-07-17 16:34 ` Jason Gunthorpe
2024-07-18 15:05 ` Konstantin Taranov
2024-07-18 16:48 ` Jason Gunthorpe
2024-07-19 10:51 ` Konstantin Taranov
2024-07-21 6:56 ` Leon Romanovsky
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=20240716142223.GC5630@unreal \
--to=leon@kernel.org \
--cc=jgg@ziepe.ca \
--cc=kotaranov@linux.microsoft.com \
--cc=kotaranov@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=sharmaajay@microsoft.com \
--cc=weh@microsoft.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