Skip to content

Commit 3d6f3cd

Browse files
ferasdSaeed Mahameed
authored andcommitted
net/mlx5e: IPoIB, Fix RX checksum statistics update
Update the RX checksum only if the feature is enabled. Fixes: 9d6bd75 ("net/mlx5e: IPoIB, RX handler") Signed-off-by: Feras Daoud <ferasda@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
1 parent 6ffb630 commit 3d6f3cd

File tree

1 file changed

+8
-3
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,8 +1295,14 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq,
12951295

12961296
skb->protocol = *((__be16 *)(skb->data));
12971297

1298-
skb->ip_summed = CHECKSUM_COMPLETE;
1299-
skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
1298+
if (netdev->features & NETIF_F_RXCSUM) {
1299+
skb->ip_summed = CHECKSUM_COMPLETE;
1300+
skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
1301+
stats->csum_complete++;
1302+
} else {
1303+
skb->ip_summed = CHECKSUM_NONE;
1304+
stats->csum_none++;
1305+
}
13001306

13011307
if (unlikely(mlx5e_rx_hw_stamp(tstamp)))
13021308
skb_hwtstamps(skb)->hwtstamp =
@@ -1315,7 +1321,6 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq,
13151321

13161322
skb->dev = netdev;
13171323

1318-
stats->csum_complete++;
13191324
stats->packets++;
13201325
stats->bytes += cqe_bcnt;
13211326
}

0 commit comments

Comments
 (0)