Skip to content

Commit

Permalink
net/mlx5e: IPoIB, Fix RX checksum statistics update
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Feras Daoud authored and Saeed Mahameed committed Mar 11, 2019
1 parent 6ffb630 commit 3d6f3cd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1295,8 +1295,14 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq,

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

skb->ip_summed = CHECKSUM_COMPLETE;
skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
if (netdev->features & NETIF_F_RXCSUM) {
skb->ip_summed = CHECKSUM_COMPLETE;
skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
stats->csum_complete++;
} else {
skb->ip_summed = CHECKSUM_NONE;
stats->csum_none++;
}

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

skb->dev = netdev;

stats->csum_complete++;
stats->packets++;
stats->bytes += cqe_bcnt;
}
Expand Down

0 comments on commit 3d6f3cd

Please sign in to comment.