From patchwork Wed Jan 6 17:53:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohit Maheshwari X-Patchwork-Id: 12002041 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EDC1C433E0 for ; Wed, 6 Jan 2021 17:54:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4AED423123 for ; Wed, 6 Jan 2021 17:54:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726435AbhAFRy2 (ORCPT ); Wed, 6 Jan 2021 12:54:28 -0500 Received: from stargate.chelsio.com ([12.32.117.8]:24846 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbhAFRy2 (ORCPT ); Wed, 6 Jan 2021 12:54:28 -0500 Received: from localhost.localdomain (redhouse.blr.asicdesigners.com [10.193.185.57]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id 106HrSU1026716; Wed, 6 Jan 2021 09:53:29 -0800 From: Rohit Maheshwari To: kuba@kernel.org, netdev@vger.kernel.org, davem@davemloft.net Cc: secdev@chelsio.com, Rohit Maheshwari Subject: [net] net: feature check mandating HW_CSUM is wrong Date: Wed, 6 Jan 2021 23:23:27 +0530 Message-Id: <20210106175327.5606-1-rohitm@chelsio.com> X-Mailer: git-send-email 2.18.1 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Mandating NETIF_F_HW_CSUM to enable TLS offload feature is wrong. And it broke tls offload feature for the drivers, which are still using NETIF_F_IP_CSUM or NETIF_F_IPV6_CSUM. We should use NETIF_F_CSUM_MASK instead. Fixes: ae0b04b238e2 ("net: Disable NETIF_F_HW_TLS_TX when HW_CSUM is disabled") Signed-off-by: Rohit Maheshwari --- net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c index a46334906c94..b1f99287f280 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -9643,7 +9643,7 @@ static netdev_features_t netdev_fix_features(struct net_device *dev, } } - if ((features & NETIF_F_HW_TLS_TX) && !(features & NETIF_F_HW_CSUM)) { + if ((features & NETIF_F_HW_TLS_TX) && !(features & NETIF_F_CSUM_MASK)) { netdev_dbg(dev, "Dropping TLS TX HW offload feature since no CSUM feature.\n"); features &= ~NETIF_F_HW_TLS_TX; }