Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/marvell Pass all unicast addresses if it is promisc ...



details:   https://anonhg.NetBSD.org/src/rev/93cfd1bb1a20
branches:  trunk
changeset: 813686:93cfd1bb1a20
user:      hikaru <hikaru%NetBSD.org@localhost>
date:      Sat Feb 13 08:44:22 2016 +0000

description:
Pass all unicast addresses if it is promisc mode.

diffstat:

 sys/dev/marvell/if_mvgbe.c |  19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r 66bfcc3ea915 -r 93cfd1bb1a20 sys/dev/marvell/if_mvgbe.c
--- a/sys/dev/marvell/if_mvgbe.c        Sat Feb 13 08:05:06 2016 +0000
+++ b/sys/dev/marvell/if_mvgbe.c        Sat Feb 13 08:44:22 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mvgbe.c,v 1.43 2016/02/09 12:53:17 kiyohara Exp $   */
+/*     $NetBSD: if_mvgbe.c,v 1.44 2016/02/13 08:44:22 hikaru Exp $     */
 /*
  * Copyright (c) 2007, 2008, 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.43 2016/02/09 12:53:17 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.44 2016/02/13 08:44:22 hikaru Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -2238,8 +2238,19 @@
        MVGBE_WRITE(sc, MVGBE_PXC, pxc);
 
        /* Set Destination Address Filter Unicast Table */
-       i = sc->sc_enaddr[5] & 0xf;             /* last nibble */
-       dfut[i>>2] = MVGBE_DF(i&3, MVGBE_DF_QUEUE(0) | MVGBE_DF_PASS);
+       if (ifp->if_flags & IFF_PROMISC) {
+               /* pass all unicast addresses */
+               for (i = 0; i < MVGBE_NDFUT; i++) {
+                       dfut[i] =
+                           MVGBE_DF(0, MVGBE_DF_QUEUE(0) | MVGBE_DF_PASS) |
+                           MVGBE_DF(1, MVGBE_DF_QUEUE(0) | MVGBE_DF_PASS) |
+                           MVGBE_DF(2, MVGBE_DF_QUEUE(0) | MVGBE_DF_PASS) |
+                           MVGBE_DF(3, MVGBE_DF_QUEUE(0) | MVGBE_DF_PASS);
+               }
+       } else {
+               i = sc->sc_enaddr[5] & 0xf;             /* last nibble */
+               dfut[i>>2] = MVGBE_DF(i&3, MVGBE_DF_QUEUE(0) | MVGBE_DF_PASS);
+       }
        MVGBE_WRITE_FILTER(sc, MVGBE_DFUT, dfut, MVGBE_NDFUT);
 
        /* Set Destination Address Filter Multicast Tables */



Home | Main Index | Thread Index | Old Index