Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp5844543ybn; Sun, 29 Sep 2019 06:58:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqUZAvBf4dm1Y4BvRvzhHbWWzrSNcNnr63vXmZQnKmq4xj/HPPlh0Zoaq6xOXRCULp9aNw X-Received: by 2002:a50:b545:: with SMTP id z5mr14834018edd.203.1569765524656; Sun, 29 Sep 2019 06:58:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569765524; cv=none; d=google.com; s=arc-20160816; b=YGo83j26VrG7cwufI3dCAh3XYrZAVwtn7pU2f8fAciyIZqxnv4vcu/zc1eQUzUdfMw fvQFbGOX/dSGRMJJdxEYcdWaNauELwPx1XHWEkPEqrdFg7RdokHEMVy5Nl8G3FYHzVCE qMwAuYNuiaDMJHrTw+XWyrZXINEOAEHKZokdjPGW4Ip/PwJ8h8R0I2SFbx6OqgPgT/OL XKd64IpiDRyZawMxljHGVBCxbKxr2WRiYB6mL24WxlFTEp8AlNfAKNbihINxfaCf7Avy QQjQj2/l4qsP8vhHpOA58+zidQRcZpYG9OX5wuIDbGLvZp0JaguiWcNOBUcyL+7bnjRc TldQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bS5JwlYYn+8wBVeQxzq+ffG2p3HkoGwRa7D9dhiIZMk=; b=HL+Y91l8FVoNYppI4vQ2BNMws8qGdQLTPiibsTc8eSLwJCMkDMNKhnSB+V2j03MhVa hlkjVdeej8ENvTsPNWn/R7JaKwzxGvpDXr8gkutzVqCav9q6iK/VlEPIGmgKoOE3rjWw 7wwDU+wiwL+hqXXm6hKTApU+1FRO42wrcPUWJY3IPJYGOpL9eJ0qkfjXTo3SxoDqE6XO owpF13W4BeD7ej+7KCmhEJC3q0c7hxB6erUTHXxVR9qcZjFrkJdQiJ4GzQmKZ1VWE6o+ PUgd4Vufa7j6ZVi0YPI0xEJKEOxGPHTeuq0AO45AqzUc1ErO/fN8gzJxMDc7YyalZclN FxIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HJRGuQPD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g21si5464221ejk.23.2019.09.29.06.58.20; Sun, 29 Sep 2019 06:58:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HJRGuQPD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729271AbfI2N5e (ORCPT + 99 others); Sun, 29 Sep 2019 09:57:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:37834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729240AbfI2N5c (ORCPT ); Sun, 29 Sep 2019 09:57:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0868421835; Sun, 29 Sep 2019 13:57:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569765451; bh=+OYwP19RhWuLwdi9dWYB9JjNHhAy3RS3munsabWWZF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HJRGuQPD4a5sxU58X4qA1t/dtPAMnFID+Rj7SNEb9W+Lv0ZaYTjEWbzmHBMn5GVKT 0R82pvGVvarc+o2D3XFRoJkOk2RN+Bu5aAgRAtNfhIaxMNvZP62iwRBQ7GMjuGNVC+ oyeXmQexiHFIlj4g0RzkU7VV+i39BOJdJAyh4ON0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alaa Hleihel , Or Gerlitz , Saeed Mahameed Subject: [PATCH 4.19 16/63] net/mlx5e: dont set CHECKSUM_COMPLETE on SCTP packets Date: Sun, 29 Sep 2019 15:53:49 +0200 Message-Id: <20190929135035.043739528@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190929135031.382429403@linuxfoundation.org> References: <20190929135031.382429403@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alaa Hleihel [ Upstream commit fe1dc069990c1f290ef6b99adb46332c03258f38 ] CHECKSUM_COMPLETE is not applicable to SCTP protocol. Setting it for SCTP packets leads to CRC32c validation failure. Fixes: bbceefce9adf ("net/mlx5e: Support RX CHECKSUM_COMPLETE") Signed-off-by: Alaa Hleihel Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -725,6 +725,14 @@ static u32 mlx5e_get_fcs(const struct sk return __get_unaligned_cpu32(fcs_bytes); } +static u8 get_ip_proto(struct sk_buff *skb, __be16 proto) +{ + void *ip_p = skb->data + sizeof(struct ethhdr); + + return (proto == htons(ETH_P_IP)) ? ((struct iphdr *)ip_p)->protocol : + ((struct ipv6hdr *)ip_p)->nexthdr; +} + #define short_frame(size) ((size) <= ETH_ZLEN + ETH_FCS_LEN) static inline void mlx5e_handle_csum(struct net_device *netdev, @@ -758,6 +766,9 @@ static inline void mlx5e_handle_csum(str goto csum_unnecessary; if (likely(is_last_ethertype_ip(skb, &network_depth, &proto))) { + if (unlikely(get_ip_proto(skb, proto) == IPPROTO_SCTP)) + goto csum_unnecessary; + skb->ip_summed = CHECKSUM_COMPLETE; skb->csum = csum_unfold((__force __sum16)cqe->check_sum); if (network_depth > ETH_HLEN)