Skip to content

Commit 8ab7e2a

Browse files
Gal Pressmandavem330
authored andcommitted
net/mlx5e: Count LRO packets correctly
RX packets statistics ('rx_packets' counter) used to count LRO packets as one, even though it contains multiple segments. This patch will increment the counter by the number of segments, and align the driver with the behavior of other drivers in the stack. Note that no information is lost in this patch due to 'rx_lro_packets' counter existence. Before, ethtool showed: $ ethtool -S ens6 | egrep "rx_packets|rx_lro_packets" rx_packets: 435277 rx_lro_packets: 35847 rx_packets_phy: 1935066 Now, we will see the more logical statistics: $ ethtool -S ens6 | egrep "rx_packets|rx_lro_packets" rx_packets: 1935066 rx_lro_packets: 35847 rx_packets_phy: 1935066 Fixes: e586b3b ("net/mlx5: Ethernet Datapath files") Signed-off-by: Gal Pressman <[email protected]> Cc: [email protected] Signed-off-by: Saeed Mahameed <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d3a4e4d commit 8ab7e2a

File tree

1 file changed

+4
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+4
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,10 @@ static inline void mlx5e_build_rx_skb(struct mlx5_cqe64 *cqe,
601601
if (lro_num_seg > 1) {
602602
mlx5e_lro_update_hdr(skb, cqe, cqe_bcnt);
603603
skb_shinfo(skb)->gso_size = DIV_ROUND_UP(cqe_bcnt, lro_num_seg);
604+
/* Subtract one since we already counted this as one
605+
* "regular" packet in mlx5e_complete_rx_cqe()
606+
*/
607+
rq->stats.packets += lro_num_seg - 1;
604608
rq->stats.lro_packets++;
605609
rq->stats.lro_bytes += cqe_bcnt;
606610
}

0 commit comments

Comments
 (0)