net: mana: Set tx_packets to post gso processing packet count
PATCH 1/1 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
--- drivers/net/ethernet/microsoft/mana/mana_en.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ethernet/microsoft/mana/mana_en.c +7 -3
@@ -251,10 +251,10 @@ netdev_tx_t mana_start_xmit(struct sk_buff *skb, struct net_device *ndev)struct netdev_queue *net_txq;struct mana_stats_tx *tx_stats;struct gdma_queue *gdma_sq; +int err, len, num_gso_seg;unsigned int csum_type;struct mana_txq *txq;struct mana_cq *cq; -int err, len;if (unlikely (!apc->port_is_up)) goto tx_drop;
@@ -407,6 +407,7 @@ netdev_tx_t mana_start_xmit(struct sk_buff *skb, struct net_device *ndev)skb_queue_tail (&txq->pending_skbs, skb); len = skb->len; + num_gso_seg =skb_is_gso (skb) ?skb_shinfo (skb)->gso_segs :1 ; net_txq =netdev_get_tx_queue (ndev, txq_idx); err = mana_gd_post_work_request(gdma_sq, &pkg.wqe_req,
@@ -431,10 +432,13 @@ netdev_tx_t mana_start_xmit(struct sk_buff *skb, struct net_device *ndev)/* skb may be freed after mana_gd_post_work_request. Do not use it. */ skb =NULL ; +/* Populated the packet and bytes counters based on post GSO packet +* calculations +*/ tx_stats = &txq->stats;u64_stats_update_begin (&tx_stats->syncp); - tx_stats->packets++; - tx_stats->bytes += len; + tx_stats->packets += num_gso_seg; + tx_stats->bytes += len + ((num_gso_seg -1 ) * gso_hs);u64_stats_update_end (&tx_stats->syncp); tx_busy:
base-commit: 8909f5f4ecd551c2299b28e05254b77424c8c7dc
Signature · 1 line
2.34.1
Quoted 22 lines
-----Original Message-----
From: Shradha Gupta <[email protected]>
Sent: Tuesday, June 17, 2025 7:34 AM
To: Dexuan Cui <[email protected]>; Wei Liu <[email protected]>; Haiyang Zhang <[email protected]>; KY Srinivasan <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Konstantin Taranov <[email protected]>; Souradeep Chakrabarti <[email protected]>; Erni Sri Satya Vennela <[email protected]>; Long Li <[email protected]>; Dipayaan Roy <[email protected]>; Shiraz Saleem <[email protected]>
Cc: Shradha Gupta <[email protected]>; [email protected]; [email protected]; linux- [email protected]; Paul Rosswurm <[email protected]>; Shradha Gupta <[email protected]>
Subject: [PATCH net-next] net: mana: Settx_packetsto post gso processing packet count
Quoted 6 lines
Allow
tx_packetsandtx_bytescounter 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 <[email protected]>
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Quoted 8 lines · On Tue, 17 Jun 2025 04:33:41 -0700 you wrote:
Allow
tx_packetsandtx_bytescounter 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 <[email protected]>[...]
Here is the summary with links:
- [net-next] net: mana: Set tx_packets to post gso processing packet count
https://git.kernel.org/netdev/net-next/c/7399ef984022
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html