All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adit Ranadive <aditr@vmware.com>
To: Leon Romanovsky <leonro@leon.nu>, Yuval Shaia <yuval.shaia@oracle.com>
Cc: "dledford@redhat.com" <dledford@redhat.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	pv-drivers <pv-drivers@vmware.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"Jorgen S. Hansen" <jhansen@vmware.com>,
	Aditya Sarwade <asarwade@vmware.com>,
	George Zhang <georgezhang@vmware.com>,
	Bryan Tan <bryantan@vmware.com>
Subject: RE: [PATCH v4 09/16] IB/pvrdma: Add support for Completion Queues
Date: Sun, 18 Sep 2016 20:36:55 +0000	[thread overview]
Message-ID: <BLUPR0501MB83604E10410486A3F068950C5F50@BLUPR0501MB836.namprd05.prod.outlook.com> (raw)
In-Reply-To: <20160918170707.GL2923@leon.nu>

On Sun, Sep 18, 2016 at 10:07:18 -0700, Leon Romanovsky wrote: 
> On Thu, Sep 15, 2016 at 10:36:12AM +0300, Yuval Shaia wrote:
> > Hi Adit,
> > Please see my comments inline.
> >
> > Besides that I have no more comment for this patch.
> >
> > Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
> >
> > Yuval
> >
> > On Thu, Sep 15, 2016 at 12:07:29AM +0000, Adit Ranadive wrote:
> > > On Wed, Sep 14, 2016 at 05:43:37 -0700, Yuval Shaia wrote:
> > > > On Sun, Sep 11, 2016 at 09:49:19PM -0700, Adit Ranadive wrote:
> > > > > +
> > > > > +static int pvrdma_poll_one(struct pvrdma_cq *cq, struct pvrdma_qp
> > > > **cur_qp,
> > > > > +			   struct ib_wc *wc)
> > > > > +{
> > > > > +	struct pvrdma_dev *dev = to_vdev(cq->ibcq.device);
> > > > > +	int has_data;
> > > > > +	unsigned int head;
> > > > > +	bool tried = false;
> > > > > +	struct pvrdma_cqe *cqe;
> > > > > +
> > > > > +retry:
> > > > > +	has_data = pvrdma_idx_ring_has_data(&cq->ring_state->rx,
> > > > > +					    cq->ibcq.cqe, &head);
> > > > > +	if (has_data == 0) {
> > > > > +		if (tried)
> > > > > +			return -EAGAIN;
> > > > > +
> > > > > +		/* Pass down POLL to give physical HCA a chance to poll. */
> > > > > +		pvrdma_write_uar_cq(dev, cq->cq_handle |
> > > > PVRDMA_UAR_CQ_POLL);
> > > > > +
> > > > > +		tried = true;
> > > > > +		goto retry;
> > > > > +	} else if (has_data == PVRDMA_INVALID_IDX) {
> > > >
> > > > I didn't went throw the entire life cycle of RX-ring's head and tail but you
> > > > need to make sure that PVRDMA_INVALID_IDX error is recoverable one, i.e
> > > > there is probability that in the next call to pvrdma_poll_one it will be fine.
> > > > Otherwise it is an endless loop.
> > >
> > > We have never run into this issue internally but I don't think we can recover here
> >
> > I briefly reviewed the life cycle of RX-ring's head and tail and didn't
> > caught any suspicious place that might corrupt it.
> > So glad to see that you never encountered this case.
> >
> > > in the driver. The only way to recover would be to destroy and recreate the CQ
> > > which we shouldn't do since it could be used by multiple QPs.
> >
> > Agree.
> > But don't they hit the same problem too?
> >
> > > We don't have a way yet to recover in the device. Once we add that this check
> > > should go away.
> >
> > To be honest i have no idea how to do that - i was expecting driver's vendors
> > to come up with an ideas :)
> > I once came up with an idea to force restart of the driver but it was
> > rejected.
> >
> > >
> > > The reason I returned an error value from poll_cq in v3 was to break the possible
> > > loop so that it might give clients a chance to recover. But since poll_cq is not expected
> > > to fail I just log the device error here. I can revert to that version if you want to break
> > > the possible loop.
> >
> > Clients (ULPs) cannot recover from this case. They even do not check the
> > reason of the error and treats any error as -EAGAIN.
> 
> It is because poll_one is not expected to fall.

Poll_one is an internal function in our driver. ULPs should still be okay I think as long as poll_cq
does not fail, no?

WARNING: multiple messages have this Message-ID (diff)
From: Adit Ranadive <aditr@vmware.com>
To: Leon Romanovsky <leonro@leon.nu>, Yuval Shaia <yuval.shaia@oracle.com>
Cc: "dledford@redhat.com" <dledford@redhat.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	pv-drivers <pv-drivers@vmware.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"Jorgen S. Hansen" <jhansen@vmware.com>,
	Aditya Sarwade <asarwade@vmware.com>,
	George Zhang <georgezhang@vmware.com>,
	Bryan Tan <bryantan@vmware.com>
Subject: RE: [PATCH v4 09/16] IB/pvrdma: Add support for Completion Queues
Date: Sun, 18 Sep 2016 20:36:55 +0000	[thread overview]
Message-ID: <BLUPR0501MB83604E10410486A3F068950C5F50@BLUPR0501MB836.namprd05.prod.outlook.com> (raw)
In-Reply-To: <20160918170707.GL2923@leon.nu>

On Sun, Sep 18, 2016 at 10:07:18 -0700, Leon Romanovsky wrote:=20
> On Thu, Sep 15, 2016 at 10:36:12AM +0300, Yuval Shaia wrote:
> > Hi Adit,
> > Please see my comments inline.
> >
> > Besides that I have no more comment for this patch.
> >
> > Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
> >
> > Yuval
> >
> > On Thu, Sep 15, 2016 at 12:07:29AM +0000, Adit Ranadive wrote:
> > > On Wed, Sep 14, 2016 at 05:43:37 -0700, Yuval Shaia wrote:
> > > > On Sun, Sep 11, 2016 at 09:49:19PM -0700, Adit Ranadive wrote:
> > > > > +
> > > > > +static int pvrdma_poll_one(struct pvrdma_cq *cq, struct pvrdma_q=
p
> > > > **cur_qp,
> > > > > +			   struct ib_wc *wc)
> > > > > +{
> > > > > +	struct pvrdma_dev *dev =3D to_vdev(cq->ibcq.device);
> > > > > +	int has_data;
> > > > > +	unsigned int head;
> > > > > +	bool tried =3D false;
> > > > > +	struct pvrdma_cqe *cqe;
> > > > > +
> > > > > +retry:
> > > > > +	has_data =3D pvrdma_idx_ring_has_data(&cq->ring_state->rx,
> > > > > +					    cq->ibcq.cqe, &head);
> > > > > +	if (has_data =3D=3D 0) {
> > > > > +		if (tried)
> > > > > +			return -EAGAIN;
> > > > > +
> > > > > +		/* Pass down POLL to give physical HCA a chance to poll. */
> > > > > +		pvrdma_write_uar_cq(dev, cq->cq_handle |
> > > > PVRDMA_UAR_CQ_POLL);
> > > > > +
> > > > > +		tried =3D true;
> > > > > +		goto retry;
> > > > > +	} else if (has_data =3D=3D PVRDMA_INVALID_IDX) {
> > > >
> > > > I didn't went throw the entire life cycle of RX-ring's head and tai=
l but you
> > > > need to make sure that PVRDMA_INVALID_IDX error is recoverable one,=
 i.e
> > > > there is probability that in the next call to pvrdma_poll_one it wi=
ll be fine.
> > > > Otherwise it is an endless loop.
> > >
> > > We have never run into this issue internally but I don't think we can=
 recover here
> >
> > I briefly reviewed the life cycle of RX-ring's head and tail and didn't
> > caught any suspicious place that might corrupt it.
> > So glad to see that you never encountered this case.
> >
> > > in the driver. The only way to recover would be to destroy and recrea=
te the CQ
> > > which we shouldn't do since it could be used by multiple QPs.
> >
> > Agree.
> > But don't they hit the same problem too?
> >
> > > We don't have a way yet to recover in the device. Once we add that th=
is check
> > > should go away.
> >
> > To be honest i have no idea how to do that - i was expecting driver's v=
endors
> > to come up with an ideas :)
> > I once came up with an idea to force restart of the driver but it was
> > rejected.
> >
> > >
> > > The reason I returned an error value from poll_cq in v3 was to break =
the possible
> > > loop so that it might give clients a chance to recover. But since pol=
l_cq is not expected
> > > to fail I just log the device error here. I can revert to that versio=
n if you want to break
> > > the possible loop.
> >
> > Clients (ULPs) cannot recover from this case. They even do not check th=
e
> > reason of the error and treats any error as -EAGAIN.
>=20
> It is because poll_one is not expected to fall.

Poll_one is an internal function in our driver. ULPs should still be okay I=
 think as long as poll_cq
does not fail, no?

  reply	other threads:[~2016-09-18 20:36 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12  4:49 [PATCH v4 00/16] Add Paravirtual RDMA Driver Adit Ranadive
2016-09-12  4:49 ` Adit Ranadive
2016-09-12  4:49 ` Adit Ranadive
2016-09-12  4:49 ` [PATCH v4 01/16] vmxnet3: Move PCI Id to pci_ids.h Adit Ranadive
2016-09-12  4:49   ` Adit Ranadive
     [not found]   ` <1473655766-31628-2-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2016-09-12 17:21     ` Bjorn Helgaas
2016-09-12 17:21       ` Bjorn Helgaas
2016-09-14 11:08   ` Yuval Shaia
     [not found]     ` <20160914110854.GA15800-Hxa29pjIrETlQW142y8m19+IiqhCXseY@public.gmane.org>
2016-09-14 16:00       ` Adit Ranadive
2016-09-14 16:00         ` Adit Ranadive
2016-09-14 16:24         ` Yuval Shaia
2016-09-14 19:36           ` Adit Ranadive
2016-09-14 19:36             ` Adit Ranadive
2016-09-15  7:55             ` Yuval Shaia
     [not found]             ` <DM2PR0501MB84422A1029EE72FC727F960C5F10-SXUgMXdxDSdudfUQJyYm35LWcSx1hRipwIZJ9u9yWa8oOQlpcoRfSA@public.gmane.org>
2016-09-20 13:37               ` Bjorn Helgaas
2016-09-20 13:37                 ` Bjorn Helgaas
2016-09-12  4:49 ` [PATCH v4 03/16] IB/pvrdma: Add virtual device RDMA structures Adit Ranadive
2016-09-12  4:49   ` Adit Ranadive
2016-09-12 17:50   ` Jason Gunthorpe
2016-09-12  4:49 ` [PATCH v4 04/16] IB/pvrdma: Add the paravirtual RDMA device specification Adit Ranadive
2016-09-12  4:49   ` Adit Ranadive
2016-09-12  4:49 ` [PATCH v4 05/16] IB/pvrdma: Add functions for Verbs support Adit Ranadive
2016-09-12  4:49   ` Adit Ranadive
2016-09-14 12:28   ` Yuval Shaia
     [not found]   ` <1473655766-31628-6-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2016-09-14 12:49     ` Christoph Hellwig
2016-09-14 12:49       ` Christoph Hellwig
2016-09-15  0:10       ` Adit Ranadive
2016-09-15  0:10         ` Adit Ranadive
     [not found]         ` <BLUPR0501MB836AB8BF5108322033C5DD6C5F00-84Rf5TRaNBMVDhIuTCx1aJLWcSx1hRipwIZJ9u9yWa8oOQlpcoRfSA@public.gmane.org>
2016-09-15  6:15           ` Christoph Hellwig
2016-09-15  6:15             ` Christoph Hellwig
2016-09-15  7:15             ` Leon Romanovsky
2016-09-12  4:49 ` [PATCH v4 06/16] IB/pvrdma: Add paravirtual rdma device Adit Ranadive
2016-09-12  4:49   ` Adit Ranadive
     [not found]   ` <1473655766-31628-7-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2016-09-14 11:17     ` Yuval Shaia
2016-09-14 11:17       ` Yuval Shaia
2016-09-12  4:49 ` [PATCH v4 09/16] IB/pvrdma: Add support for Completion Queues Adit Ranadive
2016-09-12  4:49   ` Adit Ranadive
2016-09-14 12:43   ` Yuval Shaia
2016-09-15  0:07     ` Adit Ranadive
2016-09-15  0:07       ` Adit Ranadive
2016-09-15  7:36       ` Yuval Shaia
2016-09-18 17:07         ` Leon Romanovsky
2016-09-18 20:36           ` Adit Ranadive [this message]
2016-09-18 20:36             ` Adit Ranadive
     [not found]             ` <BLUPR0501MB83604E10410486A3F068950C5F50-84Rf5TRaNBMVDhIuTCx1aJLWcSx1hRipwIZJ9u9yWa8oOQlpcoRfSA@public.gmane.org>
2016-09-19  3:24               ` Leon Romanovsky
2016-09-19  3:24                 ` Leon Romanovsky
     [not found] ` <1473655766-31628-1-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2016-09-12  4:49   ` [PATCH v4 02/16] IB/pvrdma: Add user-level shared functions Adit Ranadive
2016-09-12  4:49     ` Adit Ranadive
2016-09-12  4:49     ` Adit Ranadive
2016-09-12 17:49     ` Jason Gunthorpe
2016-09-12  4:49   ` [PATCH v4 07/16] IB/pvrdma: Add helper functions Adit Ranadive
2016-09-12  4:49     ` Adit Ranadive
2016-09-12  4:49     ` Adit Ranadive
     [not found]     ` <1473655766-31628-8-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2016-09-14 11:21       ` Yuval Shaia
2016-09-14 11:21         ` Yuval Shaia
2016-09-12  4:49   ` [PATCH v4 08/16] IB/pvrdma: Add device command support Adit Ranadive
2016-09-12  4:49     ` Adit Ranadive
2016-09-12  4:49     ` Adit Ranadive
2016-09-12  4:49   ` [PATCH v4 10/16] IB/pvrdma: Add UAR support Adit Ranadive
2016-09-12  4:49     ` Adit Ranadive
2016-09-12  4:49     ` Adit Ranadive
2016-09-12  4:49   ` [PATCH v4 14/16] IB/pvrdma: Add Kconfig and Makefile Adit Ranadive
2016-09-12  4:49     ` Adit Ranadive
2016-09-12  4:49     ` Adit Ranadive
2016-09-12  4:49 ` [PATCH v4 11/16] IB/pvrdma: Add support for memory regions Adit Ranadive
2016-09-12  4:49   ` Adit Ranadive
2016-09-14 12:46   ` Yuval Shaia
2016-09-12  4:49 ` [PATCH v4 12/16] IB/pvrdma: Add Queue Pair support Adit Ranadive
2016-09-12  4:49   ` Adit Ranadive
     [not found]   ` <1473655766-31628-13-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2016-09-14 16:32     ` Yuval Shaia
2016-09-14 16:32       ` Yuval Shaia
2016-09-12  4:49 ` [PATCH v4 13/16] IB/pvrdma: Add the main driver module for PVRDMA Adit Ranadive
2016-09-12  4:49   ` Adit Ranadive
     [not found]   ` <1473655766-31628-14-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2016-09-14 16:38     ` Yuval Shaia
2016-09-14 16:38       ` Yuval Shaia
2016-09-12  4:49 ` [PATCH v4 15/16] IB: Add PVRDMA driver Adit Ranadive
2016-09-12  4:49   ` Adit Ranadive
     [not found]   ` <1473655766-31628-16-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2016-09-12  7:32     ` kbuild test robot
2016-09-12  7:32       ` kbuild test robot
2016-09-12  7:32       ` kbuild test robot
2016-09-12  9:00     ` kbuild test robot
2016-09-12  9:00       ` kbuild test robot
2016-09-12  9:00       ` kbuild test robot
2016-09-12  4:49 ` [PATCH v4 16/16] MAINTAINERS: Update for " Adit Ranadive
2016-09-12  4:49   ` Adit Ranadive
2016-09-12 17:52   ` Jason Gunthorpe
2016-09-12 22:13     ` Adit Ranadive
2016-09-12 22:13       ` Adit Ranadive
2016-09-15  7:27     ` Leon Romanovsky
2016-09-12 18:02 ` [PATCH v4 00/16] Add Paravirtual RDMA Driver Jason Gunthorpe
2016-09-12 22:43   ` Adit Ranadive
2016-09-12 22:43     ` Adit Ranadive
     [not found]     ` <BLUPR0501MB836ED564F2AE7AB9221AC25C5FF0-84Rf5TRaNBMVDhIuTCx1aJLWcSx1hRipwIZJ9u9yWa8oOQlpcoRfSA@public.gmane.org>
2016-09-12 23:16       ` Jason Gunthorpe
2016-09-12 23:16         ` Jason Gunthorpe
2016-09-14 17:36     ` Jason Gunthorpe
2016-09-14 19:44       ` Adit Ranadive
2016-09-14 19:44         ` Adit Ranadive
2016-09-14 20:50         ` Jason Gunthorpe
2016-09-14 22:03         ` Woodruff, Robert J
2016-09-14 22:20           ` Woodruff, Robert J
     [not found]             ` <9C6B67F36DCAFC479B1CF6A967258A8C7DE14D3E-8oqHQFITsIFqS6EAlXoojrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-09-14 22:59               ` Jason Gunthorpe
2016-09-14 22:59                 ` Jason Gunthorpe
2016-09-16 16:32                 ` Jason Gunthorpe
2016-09-16 16:43                   ` Woodruff, Robert J
2016-09-15  7:02       ` 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=BLUPR0501MB83604E10410486A3F068950C5F50@BLUPR0501MB836.namprd05.prod.outlook.com \
    --to=aditr@vmware.com \
    --cc=asarwade@vmware.com \
    --cc=bryantan@vmware.com \
    --cc=dledford@redhat.com \
    --cc=georgezhang@vmware.com \
    --cc=jhansen@vmware.com \
    --cc=leonro@leon.nu \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pv-drivers@vmware.com \
    --cc=yuval.shaia@oracle.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 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.