Module Name: src Committed By: msaitoh Date: Thu Jul 4 09:02:24 UTC 2019
Modified Files: src/sys/dev/pci/ixgbe: ixgbe.c ixv.c Log Message: On ENETRESET case, not continue and quit the ifflags_cb() function because if_init() will do the same thing. To generate a diff of this commit: cvs rdiff -u -r1.191 -r1.192 src/sys/dev/pci/ixgbe/ixgbe.c cvs rdiff -u -r1.117 -r1.118 src/sys/dev/pci/ixgbe/ixv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ixgbe/ixgbe.c diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.191 src/sys/dev/pci/ixgbe/ixgbe.c:1.192 --- src/sys/dev/pci/ixgbe/ixgbe.c:1.191 Tue Jul 2 08:38:48 2019 +++ src/sys/dev/pci/ixgbe/ixgbe.c Thu Jul 4 09:02:24 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe.c,v 1.191 2019/07/02 08:38:48 msaitoh Exp $ */ +/* $NetBSD: ixgbe.c,v 1.192 2019/07/04 09:02:24 msaitoh Exp $ */ /****************************************************************************** @@ -6137,7 +6137,7 @@ ixgbe_ifflags_cb(struct ethercom *ec) { struct ifnet *ifp = &ec->ec_if; struct adapter *adapter = ifp->if_softc; - int change, rc = 0; + int change, rv = 0; IXGBE_CORE_LOCK(adapter); @@ -6145,17 +6145,19 @@ ixgbe_ifflags_cb(struct ethercom *ec) if (change != 0) adapter->if_flags = ifp->if_flags; - if ((change & ~(IFF_CANTCHANGE | IFF_DEBUG)) != 0) - rc = ENETRESET; - else if ((change & IFF_PROMISC) != 0) + if ((change & ~(IFF_CANTCHANGE | IFF_DEBUG)) != 0) { + rv = ENETRESET; + goto out; + } else if ((change & IFF_PROMISC) != 0) ixgbe_set_promisc(adapter); /* Set up VLAN support and filter */ ixgbe_setup_vlan_hw_support(adapter); +out: IXGBE_CORE_UNLOCK(adapter); - return rc; + return rv; } /************************************************************************ Index: src/sys/dev/pci/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.117 src/sys/dev/pci/ixgbe/ixv.c:1.118 --- src/sys/dev/pci/ixgbe/ixv.c:1.117 Tue Jul 2 07:20:07 2019 +++ src/sys/dev/pci/ixgbe/ixv.c Thu Jul 4 09:02:24 2019 @@ -1,4 +1,4 @@ -/*$NetBSD: ixv.c,v 1.117 2019/07/02 07:20:07 msaitoh Exp $*/ +/*$NetBSD: ixv.c,v 1.118 2019/07/04 09:02:24 msaitoh Exp $*/ /****************************************************************************** @@ -2730,7 +2730,7 @@ ixv_ifflags_cb(struct ethercom *ec) { struct ifnet *ifp = &ec->ec_if; struct adapter *adapter = ifp->if_softc; - int change, rc = 0; + int change, rv = 0; IXGBE_CORE_LOCK(adapter); @@ -2738,15 +2738,18 @@ ixv_ifflags_cb(struct ethercom *ec) if (change != 0) adapter->if_flags = ifp->if_flags; - if ((change & ~(IFF_CANTCHANGE | IFF_DEBUG)) != 0) - rc = ENETRESET; + if ((change & ~(IFF_CANTCHANGE | IFF_DEBUG)) != 0) { + rv = ENETRESET; + goto out; + } /* Set up VLAN support and filter */ ixv_setup_vlan_support(adapter); +out: IXGBE_CORE_UNLOCK(adapter); - return rc; + return rv; }