svn commit: r263332 - head/sys/dev/sfxge
Gleb Smirnoff
glebius at FreeBSD.org
Wed Mar 19 06:03:27 UTC 2014
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 <Boris.Misenov at oktetlabs.ru>
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
More information about the svn-src-head
mailing list