From owner-svn-src-all@FreeBSD.ORG Mon Mar 23 15:44:18 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AF50144; Mon, 23 Mar 2015 15:44:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3616FF53; Mon, 23 Mar 2015 15:44:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NFiIID045848; Mon, 23 Mar 2015 15:44:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NFiI90045847; Mon, 23 Mar 2015 15:44:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503231544.t2NFiI90045847@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 23 Mar 2015 15:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280374 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2015 15:44:18 -0000 Author: arybchik Date: Mon Mar 23 15:44:17 2015 New Revision: 280374 URL: https://svnweb.freebsd.org/changeset/base/280374 Log: 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. Differential Revision: https://reviews.freebsd.org/D2075 Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Mon Mar 23 15:27:33 2015 (r280373) +++ head/sys/dev/sfxge/sfxge_tx.c Mon Mar 23 15:44:17 2015 (r280374) @@ -676,7 +676,16 @@ sfxge_if_transmit(struct ifnet *ifp, str 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)) {