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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

patchbot
# HG changeset patch
# User Jan Beulich <[hidden email]>
# 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 <[hidden email]>
---


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
[hidden email]
https://lists.xenproject.org/xen-changelog