Add counter for Tx errors returned from if_transmit.

Submitted-by:	Boris Misenov <Boris.Misenov@oktetlabs.ru>
Sponsored by:	Solarflare Communications, Inc.
This commit is contained in:
Gleb Smirnoff 2014-03-19 06:03:26 +00:00
parent 55fb7d688b
commit d7ac87d3a3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=263332
2 changed files with 8 additions and 5 deletions

View File

@ -500,6 +500,11 @@ sfxge_tx_packet_add(struct sfxge_txq *txq, struct mbuf *m)
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 *txq, struct mbuf *m)
fail:
m_freem(m);
atomic_add_long(&txq->early_drops, 1);
return (rc);
}
@ -587,11 +593,6 @@ sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m)
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

View File

@ -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