Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm Add ETHER_LOCK() and ETHER_UNLOCK() to protect ...



details:   https://anonhg.NetBSD.org/src/rev/5756e201d1a3
branches:  trunk
changeset: 1006226:5756e201d1a3
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Jan 06 06:50:00 2020 +0000

description:
Add ETHER_LOCK() and ETHER_UNLOCK() to protect ec_multiaddrs.

XXX These drivers don't check whether enm_addrlo and enm_addrhi are the same
or not, so it won't work correctly if an multicast address entry has a range.

diffstat:

 sys/arch/arm/omap/if_cpsw.c |  6 ++++--
 sys/arch/arm/ti/if_cpsw.c   |  6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diffs (60 lines):

diff -r 2f2942cd0573 -r 5756e201d1a3 sys/arch/arm/omap/if_cpsw.c
--- a/sys/arch/arm/omap/if_cpsw.c       Mon Jan 06 05:38:59 2020 +0000
+++ b/sys/arch/arm/omap/if_cpsw.c       Mon Jan 06 06:50:00 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cpsw.c,v 1.25 2019/05/29 06:17:27 msaitoh Exp $     */
+/*     $NetBSD: if_cpsw.c,v 1.26 2020/01/06 06:50:00 msaitoh Exp $     */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.25 2019/05/29 06:17:27 msaitoh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.26 2020/01/06 06:50:00 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -1543,9 +1543,11 @@
                cpsw_ale_remove_all_mc_entries(sc);
 
        /* Set other multicast addrs desired. */
+       ETHER_LOCK(ec);
        LIST_FOREACH(ifma, &ec->ec_multiaddrs, enm_list) {
                cpsw_ale_mc_entry_set(sc, ALE_PORT_MASK_ALL, ifma->enm_addrlo);
        }
+       ETHER_UNLOCK(ec);
 
        return 0;
 }
diff -r 2f2942cd0573 -r 5756e201d1a3 sys/arch/arm/ti/if_cpsw.c
--- a/sys/arch/arm/ti/if_cpsw.c Mon Jan 06 05:38:59 2020 +0000
+++ b/sys/arch/arm/ti/if_cpsw.c Mon Jan 06 06:50:00 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cpsw.c,v 1.9 2019/11/24 09:37:05 skrll Exp $        */
+/*     $NetBSD: if_cpsw.c,v 1.10 2020/01/06 06:50:00 msaitoh Exp $     */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.9 2019/11/24 09:37:05 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.10 2020/01/06 06:50:00 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -1550,9 +1550,11 @@
                cpsw_ale_remove_all_mc_entries(sc);
 
        /* Set other multicast addrs desired. */
+       ETHER_LOCK(ec);
        LIST_FOREACH(ifma, &ec->ec_multiaddrs, enm_list) {
                cpsw_ale_mc_entry_set(sc, ALE_PORT_MASK_ALL, ifma->enm_addrlo);
        }
+       ETHER_UNLOCK(ec);
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index