[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] netfront: make req_prod check properly deal with index wraps


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
  • Date: Thu, 03 May 2018 08:22:03 +0000
  • Delivery-date: Thu, 03 May 2018 08:22:09 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xenproject.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1525335399 -7200
#      Thu May 03 10:16:39 2018 +0200
# Node ID bd81621b04afff0f403d1701970d12ebf05eccb1
# Parent  f8a110b3f989066e9b987739323c427a030efd45
netfront: make req_prod check properly deal with index wraps

Using > on bare ring indexes is always wrong, as this will fail when the
indexes wrap. Since the private req_prod_pvt is never behind the shared
req_prod, simply use != here.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r f8a110b3f989 -r bd81621b04af drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c   Thu May 03 10:15:19 2018 +0200
+++ b/drivers/xen/netfront/netfront.c   Thu May 03 10:16:39 2018 +0200
@@ -775,7 +775,7 @@ no_skb:
 
        /* Is the batch large enough to be worthwhile? */
        if (i < (np->rx_target/2)) {
-               if (req_prod > np->rx.sring->req_prod)
+               if (req_prod != np->rx.sring->req_prod)
                        goto push;
                return;
        }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.