linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adit Ranadive <aditr@vmware.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: "dledford@redhat.com" <dledford@redhat.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	Bryan Tan <bryantan@vmware.com>,
	Pv-drivers <Pv-drivers@vmware.com>
Subject: Re: [PATCH for-next v1] RDMA/vmw_pvrdma: Use resource ids from physical device if available
Date: Sat, 12 Oct 2019 07:03:55 +0000	[thread overview]
Message-ID: <8F02F753-B71A-4F73-83D8-D6224D6C4F6B@vmware.com> (raw)
In-Reply-To: <20191008181544.GA2880@ziepe.ca>

On 10/8/19, 11:15 AM, "Jason Gunthorpe" <jgg@ziepe.ca> wrote:
> 
> On Thu, Sep 19, 2019 at 08:24:56PM +0000, Adit Ranadive wrote:
> 
> >  
> > +	if (!qp->is_kernel) {
> > +		if (ucmd.flags == PVRDMA_USER_QP_CREATE_USE_RESP) {
> 
> Why does this flag exist? Don't old userspaces pass in a 0 length?
> Just use the length to signal new userspace?

I did have that in an earlier version but we decided it to make it more
explicit. It would be easier to add another flag later on if required
than to check the length (which might be same).

> 
> > +			qp_resp.qpn = qp->ibqp.qp_num;
> > +			qp_resp.qp_handle = qp->qp_handle;
> > +			qp_resp.qpn_valid = PVRDMA_USER_QP_CREATE_USE_RESP;
> > +
> > +			if (ib_copy_to_udata(udata, &qp_resp,
> > +					     sizeof(qp_resp))) {
> 
> This should limit the copy size to the length of the user buffer

Probably should be min(sizeof(qp_resp), udata->outlen)?


  reply	other threads:[~2019-10-12  7:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-19 20:24 [PATCH for-next v1] RDMA/vmw_pvrdma: Use resource ids from physical device if available Adit Ranadive
2019-10-08 18:15 ` Jason Gunthorpe
2019-10-12  7:03   ` Adit Ranadive [this message]
2019-10-15 17:06     ` Jason Gunthorpe
2019-10-15 17:16       ` Adit Ranadive

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=8F02F753-B71A-4F73-83D8-D6224D6C4F6B@vmware.com \
    --to=aditr@vmware.com \
    --cc=Pv-drivers@vmware.com \
    --cc=bryantan@vmware.com \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).