Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: mana: Set tx_packets to post gso processing packet count

Allow tx_packets and tx_bytes counter in the driver to represent
the packets transmitted post GSO processing.

Currently they are populated as bigger pre-GSO packets and bytes

Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Shradha Gupta and committed by
David S. Miller
7399ef98 dfec1c14

+7 -3
+7 -3
drivers/net/ethernet/microsoft/mana/mana_en.c
··· 251 251 struct netdev_queue *net_txq; 252 252 struct mana_stats_tx *tx_stats; 253 253 struct gdma_queue *gdma_sq; 254 + int err, len, num_gso_seg; 254 255 unsigned int csum_type; 255 256 struct mana_txq *txq; 256 257 struct mana_cq *cq; 257 - int err, len; 258 258 259 259 if (unlikely(!apc->port_is_up)) 260 260 goto tx_drop; ··· 407 407 skb_queue_tail(&txq->pending_skbs, skb); 408 408 409 409 len = skb->len; 410 + num_gso_seg = skb_is_gso(skb) ? skb_shinfo(skb)->gso_segs : 1; 410 411 net_txq = netdev_get_tx_queue(ndev, txq_idx); 411 412 412 413 err = mana_gd_post_work_request(gdma_sq, &pkg.wqe_req, ··· 432 431 /* skb may be freed after mana_gd_post_work_request. Do not use it. */ 433 432 skb = NULL; 434 433 434 + /* Populated the packet and bytes counters based on post GSO packet 435 + * calculations 436 + */ 435 437 tx_stats = &txq->stats; 436 438 u64_stats_update_begin(&tx_stats->syncp); 437 - tx_stats->packets++; 438 - tx_stats->bytes += len; 439 + tx_stats->packets += num_gso_seg; 440 + tx_stats->bytes += len + ((num_gso_seg - 1) * gso_hs); 439 441 u64_stats_update_end(&tx_stats->syncp); 440 442 441 443 tx_busy: