diff options
author | arybchik <arybchik@FreeBSD.org> | 2015-03-25 13:47:48 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2015-03-25 13:47:48 +0000 |
commit | a1c7f8fbe510138c5934236004c9b94031e65c15 (patch) | |
tree | b7e132d4c4b7f37bc48b01594cf0be8302106d16 | |
parent | 2a0cc396067f5292b5e2cff99f65fe5acd81b448 (diff) | |
download | FreeBSD-src-a1c7f8fbe510138c5934236004c9b94031e65c15.zip FreeBSD-src-a1c7f8fbe510138c5934236004c9b94031e65c15.tar.gz |
MFC: 280374
sfxge: assert either kernel or internal copy of interface flags
ioctl to put interface down sets ifp->if_flags which holds the intended
administratively defined state and calls driver callback to apply it.
When everything is done, driver updates internal copy of
interface flags sc->if_flags which holds the operational state.
So, transmit from Rx path is possible when interface is intended to be
administratively down in accordance with ifp->if_flags, but not applied
yet and the operational state is up in accordance with sc->if_flags.
Sponsored by: Solarflare Communications, Inc.
Original Differential Revision: https://reviews.freebsd.org/D2075
-rw-r--r-- | sys/dev/sfxge/sfxge_tx.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c index 7ea8005..6fdf60f 100644 --- a/sys/dev/sfxge/sfxge_tx.c +++ b/sys/dev/sfxge/sfxge_tx.c @@ -676,7 +676,16 @@ sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m) sc = (struct sfxge_softc *)ifp->if_softc; - KASSERT(ifp->if_flags & IFF_UP, ("interface not up")); + /* + * Transmit may be called when interface is up from the kernel + * point of view, but not yet up (in progress) from the driver + * point of view. I.e. link aggregation bring up. + * Transmit may be called when interface is up from the driver + * point of view, but already down from the kernel point of + * view. I.e. Rx when interface shutdown is in progress. + */ + KASSERT((ifp->if_flags & IFF_UP) || (sc->if_flags & IFF_UP), + ("interface not up")); /* Pick the desired transmit queue. */ if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_TSO)) { |