From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 06:03:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E5278C8; Wed, 19 Mar 2014 06:03:27 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 518C277F; Wed, 19 Mar 2014 06:03:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2J63RKB068469; Wed, 19 Mar 2014 06:03:27 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2J63QF7068466; Wed, 19 Mar 2014 06:03:26 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403190603.s2J63QF7068466@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 19 Mar 2014 06:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263332 - 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-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 06:03:27 -0000 Author: glebius Date: Wed Mar 19 06:03:26 2014 New Revision: 263332 URL: http://svnweb.freebsd.org/changeset/base/263332 Log: Add counter for Tx errors returned from if_transmit. Submitted-by: Boris Misenov Sponsored by: Solarflare Communications, Inc. Modified: head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/sfxge/sfxge_tx.h Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Wed Mar 19 03:33:32 2014 (r263331) +++ head/sys/dev/sfxge/sfxge_tx.c Wed Mar 19 06:03:26 2014 (r263332) @@ -500,6 +500,11 @@ sfxge_tx_packet_add(struct sfxge_txq *tx int locked; int rc; + if (!SFXGE_LINK_UP(txq->sc)) { + rc = ENETDOWN; + goto fail; + } + /* * Try to grab the txq lock. If we are able to get the lock, * the packet will be appended to the "get list" of the deferred @@ -537,6 +542,7 @@ sfxge_tx_packet_add(struct sfxge_txq *tx fail: m_freem(m); + atomic_add_long(&txq->early_drops, 1); return (rc); } @@ -587,11 +593,6 @@ sfxge_if_transmit(struct ifnet *ifp, str KASSERT(ifp->if_flags & IFF_UP, ("interface not up")); - if (!SFXGE_LINK_UP(sc)) { - m_freem(m); - return (ENETDOWN); - } - /* Pick the desired transmit queue. */ if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_TSO)) { int index = 0; @@ -1391,6 +1392,7 @@ static const struct { SFXGE_TX_STAT(tso_long_headers, tso_long_headers), SFXGE_TX_STAT(tx_collapses, collapses), SFXGE_TX_STAT(tx_drops, drops), + SFXGE_TX_STAT(tx_early_drops, early_drops), }; static int Modified: head/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.h Wed Mar 19 03:33:32 2014 (r263331) +++ head/sys/dev/sfxge/sfxge_tx.h Wed Mar 19 06:03:26 2014 (r263332) @@ -159,6 +159,7 @@ struct sfxge_txq { unsigned long tso_long_headers; unsigned long collapses; unsigned long drops; + unsigned long early_drops; /* The following fields change more often, and are used mostly * on the completion path