Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/xen xennetback(4): Fix membars in xennetback_rx...



details:   https://anonhg.NetBSD.org/src/rev/0c0b4f9cf490
branches:  trunk
changeset: 373720:0c0b4f9cf490
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Feb 25 00:34:25 2023 +0000

description:
xennetback(4): Fix 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 already issues xen_wmb, no
  need to add one explicitly.

- After pushing responses, must issue xen_wmb (not xen_rmb) before
  hypervisor_notify_via_evtchn.

diffstat:

 sys/arch/xen/xen/xennetback_xenbus.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 9987aaf6694a -r 0c0b4f9cf490 sys/arch/xen/xen/xennetback_xenbus.c
--- a/sys/arch/xen/xen/xennetback_xenbus.c      Sat Feb 25 00:34:13 2023 +0000
+++ b/sys/arch/xen/xen/xennetback_xenbus.c      Sat Feb 25 00:34:25 2023 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xennetback_xenbus.c,v 1.109 2023/02/25 00:34:13 riastradh Exp $      */
+/*      $NetBSD: xennetback_xenbus.c,v 1.110 2023/02/25 00:34:25 riastradh Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.109 2023/02/25 00:34:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.110 2023/02/25 00:34:25 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1022,14 +1022,13 @@
        }
 
        /* 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();
+               xen_wmb();
                XENPRINTF(("%s receive event\n",
                    xneti->xni_if.if_xname));
                hypervisor_notify_via_evtchn(xneti->xni_evtchn);



Home | Main Index | Thread Index | Old Index