Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci/ixgbe Fix a bug that the multicast filter isn't ...



details:   https://anonhg.NetBSD.org/src/rev/25116b297617
branches:  trunk
changeset: 459608:25116b297617
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Sep 18 05:32:15 2019 +0000

description:
Fix a bug that the multicast filter isn't correctly initialized when
the total number of the Ethernet multicast addresses is just 128.
 Changing "<" with "<=" fixes this problem, but it's better to check
ETHER_F_ALLMULTI than it because it's straightforward.

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 4862b1c717ed -r 25116b297617 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Wed Sep 18 05:16:15 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed Sep 18 05:32:15 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.210 2019/09/13 07:55:07 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.211 2019/09/18 05:32:15 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -4429,15 +4429,17 @@
        else if (ec->ec_flags & ETHER_F_ALLMULTI) {
                fctrl |= IXGBE_FCTRL_MPE;
        }
-       ETHER_UNLOCK(ec);
 
        IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl);
 
-       if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) {
+       /* Update multicast filter entries only when it's not ALLMULTI */
+       if ((ec->ec_flags & ETHER_F_ALLMULTI) == 0) {
+               ETHER_UNLOCK(ec);
                update_ptr = (u8 *)mta;
                ixgbe_update_mc_addr_list(&adapter->hw, update_ptr, mcnt,
                    ixgbe_mc_array_itr, TRUE);
-       }
+       } else
+               ETHER_UNLOCK(ec);
 
 } /* ixgbe_set_multi */
 



Home | Main Index | Thread Index | Old Index