aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorGal Pressman <galp@mellanox.com>2017-03-21 09:59:19 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-30 03:41:21 -0400
commitc87ef8734d25509a9e0b6057aec3a6db8b8631ba (patch)
tree6ad277ebe0fad78362c34d53f5c6c28b787322f8 /drivers/net/ethernet
parent36bb24fadbaad57233c655d98bad058f188aab94 (diff)
net/mlx5e: Count LRO packets correctly
[ Upstream commit 8ab7e2ae15d84ba758b2c8c6f4075722e9bd2a08 ] 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: e586b3b0baee ("net/mlx5: Ethernet Datapath files") Signed-off-by: Gal Pressman <galp@mellanox.com> Cc: kernel-team@fb.com Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_rx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index 796bdf06122c..7309ae3b8c7b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -602,6 +602,10 @@ static inline void mlx5e_build_rx_skb(struct mlx5_cqe64 *cqe,
602 if (lro_num_seg > 1) { 602 if (lro_num_seg > 1) {
603 mlx5e_lro_update_hdr(skb, cqe, cqe_bcnt); 603 mlx5e_lro_update_hdr(skb, cqe, cqe_bcnt);
604 skb_shinfo(skb)->gso_size = DIV_ROUND_UP(cqe_bcnt, lro_num_seg); 604 skb_shinfo(skb)->gso_size = DIV_ROUND_UP(cqe_bcnt, lro_num_seg);
605 /* Subtract one since we already counted this as one
606 * "regular" packet in mlx5e_complete_rx_cqe()
607 */
608 rq->stats.packets += lro_num_seg - 1;
605 rq->stats.lro_packets++; 609 rq->stats.lro_packets++;
606 rq->stats.lro_bytes += cqe_bcnt; 610 rq->stats.lro_bytes += cqe_bcnt;
607 } 611 }