From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: [PATCH net-next] net/mlx4_en: CHECKSUM_COMPLETE support for fragments Date: Tue, 27 Mar 2018 14:21:14 -0700 Message-ID: <20180327212114.164202-1-edumazet@google.com> Cc: netdev , Eric Dumazet , Eric Dumazet , Willem de Bruijn , Tariq Toukan To: "David S . Miller" Return-path: Received: from mail-pf0-f193.google.com ([209.85.192.193]:36886 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbeC0VVY (ORCPT ); Tue, 27 Mar 2018 17:21:24 -0400 Received: by mail-pf0-f193.google.com with SMTP id t16so129836pfh.4 for ; Tue, 27 Mar 2018 14:21:24 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: Refine the RX check summing handling to propagate the hardware provided checksum so that we do not have to compute it later in software. Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Cc: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index 05787efef492b1c0c6ce540ef73647fad91ce282..5c613c6663da51a4ae792eeb4d8956b54655786b 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c @@ -821,14 +821,12 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud skb_record_rx_queue(skb, cq_ring); if (likely(dev->features & NETIF_F_RXCSUM)) { - if (cqe->status & cpu_to_be16(MLX4_CQE_STATUS_TCP | - MLX4_CQE_STATUS_UDP)) { + if ((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_TCP | + MLX4_CQE_STATUS_UDP)) && + (cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) && + cqe->checksum == cpu_to_be16(0xffff)) { bool l2_tunnel; - if (!((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) && - cqe->checksum == cpu_to_be16(0xffff))) - goto csum_none; - l2_tunnel = (dev->hw_enc_features & NETIF_F_RXCSUM) && (cqe->vlan_my_qpn & cpu_to_be32(MLX4_CQE_L2_TUNNEL)); ip_summed = CHECKSUM_UNNECESSARY; -- 2.17.0.rc1.321.gba9d0f2565-goog