Skip to content

Commit 5f6d12d

Browse files
finlaymdavem330
authored andcommitted
net/mlx5e: Move to checksum complete
Use checksum complete for all IP packets, unless they are HW LRO, in which case, use checksum unnecessary. Signed-off-by: Matthew Finlay <matt@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 928cfe8 commit 5f6d12d

File tree

1 file changed

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

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,15 @@ static inline bool is_first_ethertype_ip(struct sk_buff *skb)
167167
static inline void mlx5e_handle_csum(struct net_device *netdev,
168168
struct mlx5_cqe64 *cqe,
169169
struct mlx5e_rq *rq,
170-
struct sk_buff *skb)
170+
struct sk_buff *skb,
171+
bool lro)
171172
{
172173
if (unlikely(!(netdev->features & NETIF_F_RXCSUM)))
173174
goto csum_none;
174175

175-
if (likely(cqe->hds_ip_ext & CQE_L4_OK)) {
176+
if (lro) {
176177
skb->ip_summed = CHECKSUM_UNNECESSARY;
177-
} else if (is_first_ethertype_ip(skb)) {
178+
} else if (likely(is_first_ethertype_ip(skb))) {
178179
skb->ip_summed = CHECKSUM_COMPLETE;
179180
skb->csum = csum_unfold((__force __sum16)cqe->check_sum);
180181
rq->stats.csum_sw++;
@@ -211,7 +212,7 @@ static inline void mlx5e_build_rx_skb(struct mlx5_cqe64 *cqe,
211212
if (unlikely(mlx5e_rx_hw_stamp(tstamp)))
212213
mlx5e_fill_hwstamp(tstamp, get_cqe_ts(cqe), skb_hwtstamps(skb));
213214

214-
mlx5e_handle_csum(netdev, cqe, rq, skb);
215+
mlx5e_handle_csum(netdev, cqe, rq, skb, !!lro_num_seg);
215216

216217
skb->protocol = eth_type_trans(skb, netdev);
217218

0 commit comments

Comments
 (0)