Module Name:    src
Committed By:   riastradh
Date:           Wed Aug  9 08:38:47 UTC 2023

Modified Files:
        src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
xvif(4): Omit needless membars in xennetback_rx_copy_process.

- No need for barrier around touching req_cons and rsp_prod_pvt,
  which are private.

- RING_PUSH_RESPONSES_AND_CHECK_NOTIFY updates the shared req_prod and
  then issues xen_mb, which is all that we need between the update of
  shared req_prod and hypervisor_notify_via_evtchn.

  (Between updating the shared req_prod and issuing
  hypervisor_notify_via_evtchn, only xen_wmb is needed.  But after
  writing to the shared req_prod, RING_PUSH_REQUESTS_AND_CHECK_NOTIFY
  must also read from the shared rsp_event, which requires the
  store-before-load ordering that only xen_mb provides.)


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/xen/xen/xennetback_xenbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.121 src/sys/arch/xen/xen/xennetback_xenbus.c:1.122
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.121	Wed Aug  9 08:38:37 2023
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Wed Aug  9 08:38:47 2023
@@ -1,4 +1,4 @@
-/*      $NetBSD: xennetback_xenbus.c,v 1.121 2023/08/09 08:38:37 riastradh Exp $      */
+/*      $NetBSD: xennetback_xenbus.c,v 1.122 2023/08/09 08:38:47 riastradh Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.121 2023/08/09 08:38:37 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.122 2023/08/09 08:38:47 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1024,14 +1024,12 @@ xennetback_rx_copy_process(struct ifnet 
 	}
 
 	/* update pointer */
-	xen_rmb();
 	xneti->xni_rxring.req_cons += queued;
 	xneti->xni_rxring.rsp_prod_pvt += queued;
 	RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&xneti->xni_rxring, notify);
 
 	/* send event */
 	if (notify) {
-		xen_rmb();
 		XENPRINTF(("%s receive event\n",
 		    xneti->xni_if.if_xname));
 		hypervisor_notify_via_evtchn(xneti->xni_evtchn);

Reply via email to