Skip to content

Commit 8311f0b

Browse files
chelsiocudbgJakub Kicinski
authored andcommitted
cxgb4: add stats for MQPRIO QoS offload Tx path
Export necessary stats for traffic flowing through MQPRIO QoS offload Tx path. v2: - No change. Signed-off-by: Rahul Lakkireddy <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1a2a14f commit 8311f0b

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

drivers/net/ethernet/chelsio/cxgb4/cxgb4.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,7 @@ struct sge_eohw_txq {
850850
struct sge_txq q; /* HW Txq */
851851
struct adapter *adap; /* Backpointer to adapter */
852852
unsigned long tso; /* # of TSO requests */
853+
unsigned long uso; /* # of USO requests */
853854
unsigned long tx_cso; /* # of Tx checksum offloads */
854855
unsigned long vlan_ins; /* # of Tx VLAN insertions */
855856
unsigned long mapping_err; /* # of I/O MMU packet mapping errors */

drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,6 +2797,7 @@ do { \
27972797
RL("RxAN", stats.an);
27982798
RL("RxNoMem", stats.nomem);
27992799
TL("TSO:", tso);
2800+
TL("USO:", uso);
28002801
TL("TxCSO:", tx_cso);
28012802
TL("VLANins:", vlan_ins);
28022803
TL("TxQFull:", q.stops);

drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,10 @@ static void collect_sge_port_stats(const struct adapter *adap,
242242
const struct port_info *p,
243243
struct queue_port_stats *s)
244244
{
245-
int i;
246245
const struct sge_eth_txq *tx = &adap->sge.ethtxq[p->first_qset];
247246
const struct sge_eth_rxq *rx = &adap->sge.ethrxq[p->first_qset];
247+
struct sge_eohw_txq *eohw_tx;
248+
unsigned int i;
248249

249250
memset(s, 0, sizeof(*s));
250251
for (i = 0; i < p->nqsets; i++, rx++, tx++) {
@@ -257,6 +258,16 @@ static void collect_sge_port_stats(const struct adapter *adap,
257258
s->gro_pkts += rx->stats.lro_pkts;
258259
s->gro_merged += rx->stats.lro_merged;
259260
}
261+
262+
if (adap->sge.eohw_txq) {
263+
eohw_tx = &adap->sge.eohw_txq[p->first_qset];
264+
for (i = 0; i < p->nqsets; i++, eohw_tx++) {
265+
s->tso += eohw_tx->tso;
266+
s->uso += eohw_tx->uso;
267+
s->tx_csum += eohw_tx->tx_cso;
268+
s->vlan_ins += eohw_tx->vlan_ins;
269+
}
270+
}
260271
}
261272

262273
static void collect_adapter_stats(struct adapter *adap, struct adapter_stats *s)

drivers/net/ethernet/chelsio/cxgb4/sge.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,6 +2262,19 @@ static void ethofld_hard_xmit(struct net_device *dev,
22622262
d->addr);
22632263
}
22642264

2265+
if (skb_shinfo(skb)->gso_size) {
2266+
if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4)
2267+
eohw_txq->uso++;
2268+
else
2269+
eohw_txq->tso++;
2270+
eohw_txq->tx_cso += skb_shinfo(skb)->gso_segs;
2271+
} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
2272+
eohw_txq->tx_cso++;
2273+
}
2274+
2275+
if (skb_vlan_tag_present(skb))
2276+
eohw_txq->vlan_ins++;
2277+
22652278
txq_advance(&eohw_txq->q, ndesc);
22662279
cxgb4_ring_tx_db(adap, &eohw_txq->q, ndesc);
22672280
eosw_txq_advance_index(&eosw_txq->last_pidx, 1, eosw_txq->ndesc);
@@ -4546,6 +4559,7 @@ int t4_sge_alloc_ethofld_txq(struct adapter *adap, struct sge_eohw_txq *txq,
45464559
spin_lock_init(&txq->lock);
45474560
txq->adap = adap;
45484561
txq->tso = 0;
4562+
txq->uso = 0;
45494563
txq->tx_cso = 0;
45504564
txq->vlan_ins = 0;
45514565
txq->mapping_err = 0;

0 commit comments

Comments
 (0)