From e1a3d10e9e9ad270d90bf3d00713c03c8f50d4fd Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Thu, 5 Feb 2015 12:10:23 +0000 Subject: [PATCH] sfxge: Add statistics for partially dropped TSO packets Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) --- sys/dev/sfxge/sfxge_tx.c | 10 ++++++++-- sys/dev/sfxge/sfxge_tx.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c index ec6fa267b11..394a751f19a 100644 --- a/sys/dev/sfxge/sfxge_tx.c +++ b/sys/dev/sfxge/sfxge_tx.c @@ -1094,12 +1094,16 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf, * roll back the work we have done. */ if (txq->n_pend_desc > - SFXGE_TSO_MAX_DESC - (1 + SFXGE_TX_MAPPING_MAX_SEG)) + SFXGE_TSO_MAX_DESC - (1 + SFXGE_TX_MAPPING_MAX_SEG)) { + txq->tso_pdrop_too_many++; break; + } next_id = (id + 1) & txq->ptr_mask; if (__predict_false(tso_start_new_packet(txq, &tso, - next_id))) + next_id))) { + txq->tso_pdrop_no_rsrc++; break; + } id = next_id; } } @@ -1516,6 +1520,8 @@ static const struct { SFXGE_TX_STAT(tso_bursts, tso_bursts), SFXGE_TX_STAT(tso_packets, tso_packets), SFXGE_TX_STAT(tso_long_headers, tso_long_headers), + SFXGE_TX_STAT(tso_pdrop_too_many, tso_pdrop_too_many), + SFXGE_TX_STAT(tso_pdrop_no_rsrc, tso_pdrop_no_rsrc), SFXGE_TX_STAT(tx_collapses, collapses), SFXGE_TX_STAT(tx_drops, drops), SFXGE_TX_STAT(tx_get_overflow, get_overflow), diff --git a/sys/dev/sfxge/sfxge_tx.h b/sys/dev/sfxge/sfxge_tx.h index 2beaa2bc54c..510cb3fae72 100644 --- a/sys/dev/sfxge/sfxge_tx.h +++ b/sys/dev/sfxge/sfxge_tx.h @@ -201,6 +201,8 @@ struct sfxge_txq { unsigned long get_non_tcp_overflow; unsigned long put_overflow; unsigned long netdown_drops; + unsigned long tso_pdrop_too_many; + unsigned long tso_pdrop_no_rsrc; /* The following fields change more often, and are used mostly * on the completion path