Paul Durrant
2013-Dec-10 13:39 UTC
[PATCH net v3 2/2] xen-netback: napi: don''t prematurely request a tx event
This patch changes the RING_FINAL_CHECK_FOR_REQUESTS in xenvif_build_tx_gops to a check for RING_HAS_UNCONSUMED_REQUESTS as the former call has the side effect of advancing the ring event pointer and therefore inviting another interrupt from the frontend before the napi poll has actually finished, thereby defeating the point of napi. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: David Vrabel <david.vrabel@citrix.com> --- drivers/net/xen-netback/netback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index 83b4e5b..fb512a9 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -1381,7 +1381,7 @@ static unsigned xenvif_tx_build_gops(struct xenvif *vif, int budget) continue; } - RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, work_to_do); + work_to_do = RING_HAS_UNCONSUMED_REQUESTS(&vif->tx); if (!work_to_do) break; -- 1.7.10.4
Malcolm Crossley
2013-Dec-10 17:46 UTC
Re: [PATCH net v3 2/2] xen-netback: napi: don''t prematurely request a tx event
On 10/12/13 13:39, Paul Durrant wrote:> This patch changes the RING_FINAL_CHECK_FOR_REQUESTS in > xenvif_build_tx_gops to a check for RING_HAS_UNCONSUMED_REQUESTS as the > former call has the side effect of advancing the ring event pointer and > therefore inviting another interrupt from the frontend before the napi > poll has actually finished, thereby defeating the point of napi.Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>> Signed-off-by: Paul Durrant <paul.durrant@citrix.com> > Cc: Wei Liu <wei.liu2@citrix.com> > Cc: Ian Campbell <ian.campbell@citrix.com> > Cc: David Vrabel <david.vrabel@citrix.com> > --- > drivers/net/xen-netback/netback.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c > index 83b4e5b..fb512a9 100644 > --- a/drivers/net/xen-netback/netback.c > +++ b/drivers/net/xen-netback/netback.c > @@ -1381,7 +1381,7 @@ static unsigned xenvif_tx_build_gops(struct xenvif *vif, int budget) > continue; > } > > - RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, work_to_do); > + work_to_do = RING_HAS_UNCONSUMED_REQUESTS(&vif->tx); > if (!work_to_do) > break; >
Ian Campbell
2013-Dec-11 09:44 UTC
Re: [PATCH net v3 2/2] xen-netback: napi: don''t prematurely request a tx event
On Tue, 2013-12-10 at 13:39 +0000, Paul Durrant wrote:> This patch changes the RING_FINAL_CHECK_FOR_REQUESTS in > xenvif_build_tx_gops to a check for RING_HAS_UNCONSUMED_REQUESTS as the > former call has the side effect of advancing the ring event pointer and > therefore inviting another interrupt from the frontend before the napi > poll has actually finished, thereby defeating the point of napi.Like I said last time: Can you add a reminder of when/where the ring event pointer is eventually advanced now please.> > Signed-off-by: Paul Durrant <paul.durrant@citrix.com> > Cc: Wei Liu <wei.liu2@citrix.com> > Cc: Ian Campbell <ian.campbell@citrix.com> > Cc: David Vrabel <david.vrabel@citrix.com> > --- > drivers/net/xen-netback/netback.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c > index 83b4e5b..fb512a9 100644 > --- a/drivers/net/xen-netback/netback.c > +++ b/drivers/net/xen-netback/netback.c > @@ -1381,7 +1381,7 @@ static unsigned xenvif_tx_build_gops(struct xenvif *vif, int budget) > continue; > } > > - RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, work_to_do); > + work_to_do = RING_HAS_UNCONSUMED_REQUESTS(&vif->tx); > if (!work_to_do) > break; >
Paul Durrant
2013-Dec-11 10:29 UTC
Re: [PATCH net v3 2/2] xen-netback: napi: don''t prematurely request a tx event
> -----Original Message----- > From: Ian Campbell > Sent: 11 December 2013 09:44 > To: Paul Durrant > Cc: xen-devel@lists.xen.org; netdev@vger.kernel.org; Wei Liu; David Vrabel > Subject: Re: [PATCH net v3 2/2] xen-netback: napi: don''t prematurely > request a tx event > > On Tue, 2013-12-10 at 13:39 +0000, Paul Durrant wrote: > > This patch changes the RING_FINAL_CHECK_FOR_REQUESTS in > > xenvif_build_tx_gops to a check for RING_HAS_UNCONSUMED_REQUESTS > as the > > former call has the side effect of advancing the ring event pointer and > > therefore inviting another interrupt from the frontend before the napi > > poll has actually finished, thereby defeating the point of napi. > > Like I said last time: > > Can you add a reminder of when/where the ring event pointer is > eventually advanced now please. >Sorry, I missed that. Will do. Paul
Paul Durrant
2013-Dec-11 10:34 UTC
Re: [PATCH net v3 2/2] xen-netback: napi: don''t prematurely request a tx event
> -----Original Message----- > From: xen-devel-bounces@lists.xen.org [mailto:xen-devel- > bounces@lists.xen.org] On Behalf Of Malcolm Crossley > Sent: 10 December 2013 17:47 > To: xen-devel@lists.xen.org > Subject: Re: [Xen-devel] [PATCH net v3 2/2] xen-netback: napi: don''t > prematurely request a tx event > > On 10/12/13 13:39, Paul Durrant wrote: > > This patch changes the RING_FINAL_CHECK_FOR_REQUESTS in > > xenvif_build_tx_gops to a check for RING_HAS_UNCONSUMED_REQUESTS > as the > > former call has the side effect of advancing the ring event pointer and > > therefore inviting another interrupt from the frontend before the napi > > poll has actually finished, thereby defeating the point of napi. > Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>Apologies. Indeed I should have added that to my commit comment. Paul> > Signed-off-by: Paul Durrant <paul.durrant@citrix.com> > > Cc: Wei Liu <wei.liu2@citrix.com> > > Cc: Ian Campbell <ian.campbell@citrix.com> > > Cc: David Vrabel <david.vrabel@citrix.com> > > --- > > drivers/net/xen-netback/netback.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen- > netback/netback.c > > index 83b4e5b..fb512a9 100644 > > --- a/drivers/net/xen-netback/netback.c > > +++ b/drivers/net/xen-netback/netback.c > > @@ -1381,7 +1381,7 @@ static unsigned xenvif_tx_build_gops(struct > xenvif *vif, int budget) > > continue; > > } > > > > - RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, > work_to_do); > > + work_to_do = RING_HAS_UNCONSUMED_REQUESTS(&vif- > >tx); > > if (!work_to_do) > > break; > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel