From: Adit Ranadive <aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
To: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
pv-drivers-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org,
jhansen-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org,
asarwade-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org,
georgezhang-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org,
bryantan-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH v6 12/16] IB/pvrdma: Add Queue Pair support
Date: Fri, 2 Dec 2016 21:07:09 +0530 [thread overview]
Message-ID: <19db181d-da71-efb3-dfc9-ebe2a7b77916@vmware.com> (raw)
In-Reply-To: <20161114113403.GA11338-Hxa29pjIrERMGUUWBy6pNA@public.gmane.org>
On Mon, Nov 14, 2016 at 1:34:05PM +0200, Yuval Shaia wrote:
> > +/**
> > + * pvrdma_post_send - post send work request entries on a QP
> > + * @ibqp: the QP
> > + * @wr: work request list to post
> > + * @bad_wr: the first bad WR returned
> > + *
> > + * @return: 0 on success, otherwise errno returned.
> > + */
> > +int pvrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
> > + struct ib_send_wr **bad_wr)
> > +{
> > + struct pvrdma_qp *qp = to_vqp(ibqp);
> > + struct pvrdma_dev *dev = to_vdev(ibqp->device);
> > + unsigned long flags;
> > + struct pvrdma_sq_wqe_hdr *wqe_hdr;
> > + struct pvrdma_sge *sge;
> > + int i, index;
> > + int nreq;
> > + int ret;
> > +
> > + /*
> > + * In states lower than RTS, we can fail immediately. In other states,
> > + * just post and let the device figure it out.
> > + */
> > + if (qp->state < IB_QPS_RTS) {
> > + *bad_wr = wr;
> > + return -EINVAL;
> > + }
> > +
> > + spin_lock_irqsave(&qp->sq.lock, flags);
> > +
> > + index = pvrdma_idx(&qp->sq.ring->prod_tail, qp->sq.wqe_cnt);
>
> Not sure if it was discussed so posting "just in case".
> I believe it is unlikely that index will go out of range but since
> pvrdma_idx might return PVRDMA_INVALID_IDX i suggest to add a check here.
> Something like:
> if (unlikely(index == PVRDMA_INVALID_IDX)) {
> *bad_wr = wr;
> return -EFAULT;
> }
>
> Same goes with pvrdma_post_recv
Thanks for the suggestion! We can add that in the next patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-12-02 15:37 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-03 2:10 [PATCH v6 00/16] Add Paravirtual RDMA Driver Adit Ranadive
[not found] ` <cover.1475458407.git.aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2016-10-03 2:10 ` [PATCH v6 01/16] vmxnet3: Move PCI Id to pci_ids.h Adit Ranadive
2016-10-03 2:10 ` [PATCH v6 02/16] IB/pvrdma: Add user-level shared functions Adit Ranadive
[not found] ` <515c704574423b16feb4c3d97847156623a8d042.1475458407.git.aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2016-10-05 13:42 ` Leon Romanovsky
[not found] ` <20161005134254.GH9282-2ukJVAZIZ/Y@public.gmane.org>
2016-10-05 17:43 ` Adit Ranadive
2016-10-03 2:10 ` [PATCH v6 03/16] IB/pvrdma: Add functions for ring traversal Adit Ranadive
2016-10-03 2:10 ` [PATCH v6 04/16] IB/pvrdma: Add the paravirtual RDMA device specification Adit Ranadive
2016-10-03 2:10 ` [PATCH v6 05/16] IB/pvrdma: Add functions for Verbs support Adit Ranadive
2016-10-03 2:10 ` [PATCH v6 06/16] IB/pvrdma: Add paravirtual rdma device Adit Ranadive
2016-10-03 2:10 ` [PATCH v6 07/16] IB/pvrdma: Add helper functions Adit Ranadive
2016-10-03 2:10 ` [PATCH v6 08/16] IB/pvrdma: Add device command support Adit Ranadive
2016-10-03 2:10 ` [PATCH v6 09/16] IB/pvrdma: Add support for Completion Queues Adit Ranadive
2016-10-03 2:10 ` [PATCH v6 10/16] IB/pvrdma: Add UAR support Adit Ranadive
2016-10-03 2:10 ` [PATCH v6 11/16] IB/pvrdma: Add support for memory regions Adit Ranadive
2016-10-03 2:10 ` [PATCH v6 12/16] IB/pvrdma: Add Queue Pair support Adit Ranadive
[not found] ` <6a643e92376856394d45638d80a90619d3abac37.1475458407.git.aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2016-11-14 11:34 ` Yuval Shaia
[not found] ` <20161114113403.GA11338-Hxa29pjIrERMGUUWBy6pNA@public.gmane.org>
2016-12-02 15:37 ` Adit Ranadive [this message]
2016-11-21 15:51 ` Yuval Shaia
2016-12-02 15:18 ` Adit Ranadive
2016-12-02 10:35 ` Yuval Shaia
2016-12-02 13:43 ` Yuval Shaia
2016-12-02 13:07 ` Yuval Shaia
2016-12-02 14:36 ` Adit Ranadive
2016-12-05 17:25 ` Yuval Shaia
2016-12-05 21:21 ` Adit Ranadive
[not found] ` <76188e1e-9b9b-07d6-febd-41827a049837-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2016-12-06 8:00 ` Yuval Shaia
2016-12-11 21:13 ` Yuval Shaia
2016-10-03 2:10 ` [PATCH v6 13/16] IB/pvrdma: Add the main driver module for PVRDMA Adit Ranadive
[not found] ` <d52d003f8befeb883a05b5234a90e7d6430218f2.1475458407.git.aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2016-12-08 12:23 ` Yuval Shaia
2016-12-29 22:31 ` Adit Ranadive
[not found] ` <eb847a54-6319-66a8-3703-bf942cb29084-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2017-01-02 8:50 ` Yuval Shaia
2016-10-03 2:10 ` [PATCH v6 14/16] IB/pvrdma: Add Kconfig and Makefile Adit Ranadive
2016-10-03 2:10 ` [PATCH v6 15/16] IB: Add PVRDMA driver Adit Ranadive
2016-10-03 2:10 ` [PATCH v6 16/16] MAINTAINERS: Update for " Adit Ranadive
2016-10-05 13:44 ` [PATCH v6 00/16] Add Paravirtual RDMA Driver Leon Romanovsky
[not found] ` <20161005134421.GI9282-2ukJVAZIZ/Y@public.gmane.org>
2016-10-21 17:49 ` 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=19db181d-da71-efb3-dfc9-ebe2a7b77916@vmware.com \
--to=aditr-pghwnbhtmq7qt0dzr+alfa@public.gmane.org \
--cc=asarwade-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org \
--cc=bryantan-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=georgezhang-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org \
--cc=jhansen-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=pv-drivers-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org \
--cc=yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.