Commit 8f9eb8bb authored by Dragos Tatulea's avatar Dragos Tatulea Committed by Jakub Kicinski

net/mlx5e: SHAMPO, Make GRO counters more precise

Don't count non GRO packets. A non GRO packet is a packet with
a GRO cb count of 1.
Signed-off-by: default avatarDragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/r/20240603212219.1037656-10-tariqt@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f5a699e0
...@@ -189,17 +189,19 @@ the software port. ...@@ -189,17 +189,19 @@ the software port.
* - `rx[i]_gro_packets` * - `rx[i]_gro_packets`
- Number of received packets processed using hardware-accelerated GRO. The - Number of received packets processed using hardware-accelerated GRO. The
number of hardware GRO offloaded packets received on ring i. number of hardware GRO offloaded packets received on ring i. Only true GRO
packets are counted: only packets that are in an SKB with a GRO count > 1.
- Acceleration - Acceleration
* - `rx[i]_gro_bytes` * - `rx[i]_gro_bytes`
- Number of received bytes processed using hardware-accelerated GRO. The - Number of received bytes processed using hardware-accelerated GRO. The
number of hardware GRO offloaded bytes received on ring i. number of hardware GRO offloaded bytes received on ring i. Only true GRO
packets are counted: only packets that are in an SKB with a GRO count > 1.
- Acceleration - Acceleration
* - `rx[i]_gro_skbs` * - `rx[i]_gro_skbs`
- The number of receive SKBs constructed while performing - The number of GRO SKBs constructed from hardware-accelerated GRO. Only SKBs
hardware-accelerated GRO. with a GRO count > 1 are counted.
- Informative - Informative
* - `rx[i]_gro_match_packets` * - `rx[i]_gro_match_packets`
......
...@@ -1596,9 +1596,7 @@ static void mlx5e_shampo_complete_rx_cqe(struct mlx5e_rq *rq, ...@@ -1596,9 +1596,7 @@ static void mlx5e_shampo_complete_rx_cqe(struct mlx5e_rq *rq,
struct mlx5e_rq_stats *stats = rq->stats; struct mlx5e_rq_stats *stats = rq->stats;
stats->packets++; stats->packets++;
stats->gro_packets++;
stats->bytes += cqe_bcnt; stats->bytes += cqe_bcnt;
stats->gro_bytes += cqe_bcnt;
if (NAPI_GRO_CB(skb)->count != 1) if (NAPI_GRO_CB(skb)->count != 1)
return; return;
mlx5e_build_rx_skb(cqe, cqe_bcnt, rq, skb); mlx5e_build_rx_skb(cqe, cqe_bcnt, rq, skb);
...@@ -2240,14 +2238,19 @@ mlx5e_shampo_flush_skb(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe, bool match) ...@@ -2240,14 +2238,19 @@ mlx5e_shampo_flush_skb(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe, bool match)
{ {
struct sk_buff *skb = rq->hw_gro_data->skb; struct sk_buff *skb = rq->hw_gro_data->skb;
struct mlx5e_rq_stats *stats = rq->stats; struct mlx5e_rq_stats *stats = rq->stats;
u16 gro_count = NAPI_GRO_CB(skb)->count;
stats->gro_skbs++;
if (likely(skb_shinfo(skb)->nr_frags)) if (likely(skb_shinfo(skb)->nr_frags))
mlx5e_shampo_align_fragment(skb, rq->mpwqe.log_stride_sz); mlx5e_shampo_align_fragment(skb, rq->mpwqe.log_stride_sz);
if (NAPI_GRO_CB(skb)->count > 1) if (gro_count > 1) {
stats->gro_skbs++;
stats->gro_packets += gro_count;
stats->gro_bytes += skb->data_len + skb_headlen(skb) * gro_count;
mlx5e_shampo_update_hdr(rq, cqe, match); mlx5e_shampo_update_hdr(rq, cqe, match);
else } else {
skb_shinfo(skb)->gso_size = 0; skb_shinfo(skb)->gso_size = 0;
}
napi_gro_receive(rq->cq.napi, skb); napi_gro_receive(rq->cq.napi, skb);
rq->hw_gro_data->skb = NULL; rq->hw_gro_data->skb = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment