Source-Changes-HG archive

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

[src/trunk]: src/sys/net Use ETHER_LOCK()/ETHER_UNLOCK() suggested by knakahara.



details:   https://anonhg.NetBSD.org/src/rev/ed687cfd4b30
branches:  trunk
changeset: 1002921:ed687cfd4b30
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Aug 21 06:00:07 2019 +0000

description:
Use ETHER_LOCK()/ETHER_UNLOCK() suggested by knakahara.

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |   6 +++---
 sys/dev/pci/ixgbe/ixv.c   |   6 +++---
 sys/net/if_vlan.c         |  12 ++++++------
 3 files changed, 12 insertions(+), 12 deletions(-)

diffs (102 lines):

diff -r bfe78ccbe62b -r ed687cfd4b30 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Wed Aug 21 04:51:41 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed Aug 21 06:00:07 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.200 2019/08/20 04:11:22 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.201 2019/08/21 06:00:07 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -2462,7 +2462,7 @@
        for (i = 0; i < IXGBE_VFTA_SIZE; i++)
                adapter->shadow_vfta[i] = 0;
        /* Generate shadow_vfta from ec_vids */
-       mutex_enter(ec->ec_lock);
+       ETHER_LOCK(ec);
        SIMPLEQ_FOREACH(vlanidp, &ec->ec_vids, vid_list) {
                uint32_t idx;
 
@@ -2470,7 +2470,7 @@
                KASSERT(idx < IXGBE_VFTA_SIZE);
                adapter->shadow_vfta[idx] |= (u32)1 << (vlanidp->vid % 32);
        }
-       mutex_exit(ec->ec_lock);
+       ETHER_UNLOCK(ec);
        for (i = 0; i < IXGBE_VFTA_SIZE; i++)
                IXGBE_WRITE_REG(hw, IXGBE_VFTA(i), adapter->shadow_vfta[i]);
 
diff -r bfe78ccbe62b -r ed687cfd4b30 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Wed Aug 21 04:51:41 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Wed Aug 21 06:00:07 2019 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.126 2019/08/20 04:11:22 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.127 2019/08/21 06:00:07 msaitoh Exp $*/
 
 /******************************************************************************
 
@@ -2001,7 +2001,7 @@
        for (int i = 0; i < IXGBE_VFTA_SIZE; i++)
                adapter->shadow_vfta[i] = 0;
        /* Generate shadow_vfta from ec_vids */
-       mutex_enter(ec->ec_lock);
+       ETHER_LOCK(ec);
        SIMPLEQ_FOREACH(vlanidp, &ec->ec_vids, vid_list) {
                uint32_t idx;
 
@@ -2009,7 +2009,7 @@
                KASSERT(idx < IXGBE_VFTA_SIZE);
                adapter->shadow_vfta[idx] |= (u32)1 << (vlanidp->vid % 32);
        }
-       mutex_exit(ec->ec_lock);
+       ETHER_UNLOCK(ec);
        
        /*
         * A soft reset zero's out the VFTA, so
diff -r bfe78ccbe62b -r ed687cfd4b30 sys/net/if_vlan.c
--- a/sys/net/if_vlan.c Wed Aug 21 04:51:41 2019 +0000
+++ b/sys/net/if_vlan.c Wed Aug 21 06:00:07 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vlan.c,v 1.144 2019/08/20 04:11:22 msaitoh Exp $    */
+/*     $NetBSD: if_vlan.c,v 1.145 2019/08/21 06:00:07 msaitoh Exp $    */
 
 /*
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.144 2019/08/20 04:11:22 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.145 2019/08/21 06:00:07 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -492,9 +492,9 @@
                        goto viderr;
                }
                vidmem->vid = vid;
-               mutex_enter(ec->ec_lock);
+               ETHER_LOCK(ec);
                SIMPLEQ_INSERT_TAIL(&ec->ec_vids, vidmem, vid_list);
-               mutex_exit(ec->ec_lock);
+               ETHER_UNLOCK(ec);
 
                if (ec->ec_vlan_cb != NULL) {
                        /*
@@ -641,7 +641,7 @@
                struct vlanid_list *vlanidp, *tmpp;
                uint16_t vid = EVL_VLANOFTAG(nmib->ifvm_tag);
 
-               mutex_enter(ec->ec_lock);
+               ETHER_LOCK(ec);
                SIMPLEQ_FOREACH_SAFE(vlanidp, &ec->ec_vids, vid_list, tmpp) {
                        if (vlanidp->vid == vid) {
                                SIMPLEQ_REMOVE(&ec->ec_vids, vlanidp,
@@ -649,7 +649,7 @@
                                kmem_free(vlanidp, sizeof(*vlanidp));
                        }
                }
-               mutex_exit(ec->ec_lock);
+               ETHER_UNLOCK(ec);
                if (ec->ec_vlan_cb != NULL) {
                        /*
                         * Call ec_vlan_cb(). It will setup VLAN HW filter or



Home | Main Index | Thread Index | Old Index