From patchwork Thu Mar 2 09:58:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13157026 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FC7CC678D4 for ; Thu, 2 Mar 2023 10:03:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229794AbjCBKDY (ORCPT ); Thu, 2 Mar 2023 05:03:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230373AbjCBKCM (ORCPT ); Thu, 2 Mar 2023 05:02:12 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF8F943910 for ; Thu, 2 Mar 2023 02:01:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ToSVmtKJZPuykejOyOCA/PGK9MoId1qVSVqw+F3EowOfSCyZF839me4sQZN+8IyNjNARYkGlKKAjqfz0rjh9y+MKYUQQL9mNwdHpBGUbwIXRQTnyY3NcEAst1r34IzJ5BSegKu7eJCOdeEWL/pp1REGNUV6BXNppv/jJwzhQmsXQvaGOj1R8ljKLilfZpKF/baWVE+zYUTlPqSkIeWGPXJpMTwPblD/0kjtoqCry+6HPxOll8ODjPt7TwXK0TGe/uvXa6e2uJ22X9CeFuo4u3CxZfryy50V77paE/QpdJTPteeLcxCDuJTVlsFCgxW4jAe7YXBH3z4/97GKvejYzhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Em64dQQd2jTFUpuNzXAO82pd4eDvPmO78PCBw01qtOc=; b=JJlZHDIrQczQhKIIQbptmIBMnQxKTyAaDfMLKheEGpKcNiZmQKjnEH1zZjfqn+7W2OgzbXFYEzd/AG2jiMy+dk/+G45KwayISTxbL+MpT3VSsc736wpTmLaBdR7yFhvZPv5vV5r+hURAsAN5+swX6WHR2P5X7Y8I84uxsivbKLP47OjEIoX2vXY6FGpnKdTzoD4ESmWfuSJzxmanWXEV9BQ1DPkA8zeAZXSv23VmBD3YpdPkzCTL9dc2VCBLdzpuUueoAbZjAxEcXOFbrGf+2NrstjMzMSDGojU0ldY0LG1adYkRanVoutq9WOyXV7l0taR/sAauD/kaHqHzzN4VeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Em64dQQd2jTFUpuNzXAO82pd4eDvPmO78PCBw01qtOc=; b=HJSEuYP++/GRipmq2k2nWqq4T2vswo22g6Myr6Gdn7tuimcpz5d7odtES+CY2bD8moZdVWhbGPPEP/HCfqV0Zm6wbzutDqoxxXrYUok+6abtp2Ll/MxmSssf96/cXMK3pAJLJ6pmyWA7tJ6OX8rcjBHLLgGFc86E9QGIXHquBMA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by SJ0PR13MB5692.namprd13.prod.outlook.com (2603:10b6:a03:407::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.18; Thu, 2 Mar 2023 09:58:58 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::85f5:bdb:fb9e:294c]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::85f5:bdb:fb9e:294c%3]) with mapi id 15.20.6156.018; Thu, 2 Mar 2023 09:58:58 +0000 From: Simon Horman To: David Miller , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, oss-drivers@corigine.com, Huanhuan Wang , Louis Peens , Simon Horman Subject: [PATCH net 1/3] nfp: fix incorrectly set csum flag for nfd3 path Date: Thu, 2 Mar 2023 10:58:28 +0100 Message-Id: <20230302095830.2512535-2-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230302095830.2512535-1-simon.horman@corigine.com> References: <20230302095830.2512535-1-simon.horman@corigine.com> X-ClientProxiedBy: AS4PR10CA0008.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5dc::10) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|SJ0PR13MB5692:EE_ X-MS-Office365-Filtering-Correlation-Id: 7bdfd4c2-e859-43f8-209e-08db1b04bda9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wg9ixQJuwtwqtFKwzmlwxf+6owWRm9q5AjEDqcKheORwrc1zkj/68JhJuIRgoXhBiNkANTQCpnA5s1Ap1y1R7FhntOJPRVe/V8gOe7K+lsTxW5WS5xmiSE5zzsk/TFmEHtmwx5qx1JXPN59UuoJC4UK3s7g421JU56i7KL0xmUvMvJMHNYR6kmmN9yVbRHn97/QHlt0ocQavJmgrkX3Sm9sRaZp/fvA8PUFfufg8SLYYzd5woQ0AsZQRToFP+BS7os0T6WLMH/72qKmq/L1HMexvP+jjptG9Bb8ilHPeXJ/tYG2raWVSFSO/qoJOLRGBlPUgxJ5OoDKZlk2igbIQo5zxQldqRafE0MwcKUoBs02ukOZ4OLuLOIwvl+H6NHLlpAL17/EoPg7tt5GK0WTt2cgC83Kg8lV3BqhnkPeCGMiPR8Jtk2m1Bo3c9DR4sYg+tVgMUjZXWECnmMMDkNKZFLP10zgXDduh3U0lv88cQb5CNDA/01GGZq9L8eQLG9U9uEvY2Jvu1KHo1Rs5AYFr6OhWSMgTQhnWF+hjM6F1O1BK3zf6SbSDdBT5LrHAefw9BzdXkgCaNi4eAYRGjSXDOxCi9KjJbgMDv7mvS7VZUSkrnM9/XZe8xsl8hklVeJZx6S4hZSQQ83AaILs4cXm1hQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(136003)(376002)(396003)(366004)(39840400004)(451199018)(5660300002)(2616005)(44832011)(6666004)(54906003)(107886003)(110136005)(52116002)(38100700002)(6486002)(478600001)(41300700001)(186003)(36756003)(6512007)(8936002)(6506007)(1076003)(316002)(4326008)(86362001)(66556008)(66476007)(8676002)(66946007)(83380400001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kTElDPwy2hb2m++Qhnsxo5fMUC88HeVxgv8KR6jvT10PVOef2v66ejjofaFY7yBmif4UZS1MEnojQwIxkGAEHlF/bNKdlNwAEdKSmwLFEoHpln81Edjo5+5BBBAR2BjSbqPRg8gIPKHNHnMmsKrhJjfyJdnkJLy4NgsPXR5gYPEfdaLnkQbqPebtfL8neUzgaKWZ1z0z5VRnPFUwW1IIiqdmdySy08i+q4TRdet/uWMheKzUO5KXp55PJCD47WMrDZRGUPOHNinB/tHddlXaEOiPdwYHyp3qcnLxjjYHjmHNhdMwqDSIEpU1oZ7Aa/hku9/W2bfUd/YiwuOXKM3qfMGEXHaLiyol6Qkqem12lnZ/Xjg25sNHQTdhriLC+3oxHca0qONzffVqxZvHFsr1rZB7maLuoskr26gpXNJV7XJjuOuh/MQwkwlrVeXfgs1XXkDqNweD0x0mjFRKjp+Gg3VQgCDFVHyD91UMFWz+X3hsDN4cLLXWFw8ohst/64kCWvgFUfxFAiUlXdEeyC6SpWlNeO373EsC141dyItttht2sQzsFkStQhU/EkeNyanLQ5gjCZmX44yiKUDFQ2ZKm8NyV7QqL4lVkB2Qo/K7mARmlV4lXMtNW2sNq5snzZTO5bsUASVYM7LL92EfqJICgAtWFXFQHuna5t+w/d7iij0aZAj0P4KMiqbjUUzhc1Sy7RvWsQbj26H10Y9tBRqBjFf7aT5H4xf1ntd6y3U/T1MY0cV4+QkPKIbMr8/iDRFmHFtQ4yraFM94BS3IYyKEoJ+OiMtOaNsI/jgLnxPmewRxT7UIsQz6/idNSs8eJzhAQFWUzxvHK0bkDBENeRSnnuvDx4Jggral/uTSNA3el+X7Jv3IbggwJNpJC+Z2rS051lRkCIXvBnck0XI3JOEpiAVrODArhl1STcgvv2wPKVb05ZIIcPsBIp2+ZwQo6Lq7p1TOJauWRPiCqV1pPTM9KDaGFwuBSsGQZNdmWZQ0xu0Ce8hYGSTrj6mCjsYCUTJoOoPGIvyg2PEY/PC1fiwCLCAMEmUkMagk+FBJ4RV47c1eg9bmJaavlslPO0872v3C3lKlwCuAF5YpHTCLMpk9fMosHH/f+MGEDDBGIARbwbhyWz8FhIvGEBn6z/tZIrVEgvtQFVrcdxOGS18K5vuWNIhcKGR0xUjUKOgvxywW54hYkgjfs32luOIhoMZubLg64iJA6YCogg3D/ProsgInXFwGIxnhk5f4DXg9ZRqNZTtSpD6w8R7FEIcf4YyRDrZ5RZDmxIZAQEL/GXGgVr5ucRVDgZyxXiBQxlJroWhb8RyecTAhePzDLLsvP+yCb6KC7kja5RZPmp/oa49Mlc7/BwgVoIMlYUoJ6HZYFAmf2tWp8WneQPNG+KG3KrfXQlkKwlHNtR5PQnMvJjWXiwNtEFJ9NVE44GVKVvVyPgbYOXOmaf+x/4RucKMtnlnA6Gs4b4n6eEL5cQ7FYelBvCEvbTj4RH8ixLh+6lPqGOfJVAZTYBwZbDhGksBfaW/ogtSB0PRg8grXhYYNwSXp4C3ufPM9So/O8Qo5SPCmrkYLF9Y45C2JprK0GAHVDY//O8h7EtoTyd8AXzgt+xoo+G30qBKRDoajsSx86O+UEPxqsBRdks8yeCJr4ZmK8JB1ClCDASyFWdWLLUBoMUlOmvLyeg== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7bdfd4c2-e859-43f8-209e-08db1b04bda9 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2023 09:58:58.0883 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AAoXKrC8uGs3T/QolDkaKChaKZXdQraPyVJ8E7+DaYEp8E2luC3Lbh7+wSP30ImRt5WXhMao2DeWK1Gwsajm54bKHoBVwBEOBAJhbwxF8ck= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR13MB5692 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Huanhuan Wang The csum flag of IPsec packet are set repeatedly. Therefore, the csum flag set of IPsec and non-IPsec packet need to be distinguished. As the ipv6 header does not have a csum field, so l3-csum flag is not required to be set for ipv6 case. L4-csum flag include the tcp csum flag and udp csum flag, we shouldn't set the udp and tcp csum flag at the same time for one packet, should set l4-csum flag according to the transport layer is tcp or udp. Fixes: 57f273adbcd4 ("nfp: add framework to support ipsec offloading") Signed-off-by: Huanhuan Wang Reviewed-by: Louis Peens Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfd3/dp.c | 7 +++--- .../net/ethernet/netronome/nfp/nfd3/ipsec.c | 25 +++++++++++++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfd3/dp.c b/drivers/net/ethernet/netronome/nfp/nfd3/dp.c index 59fb0583cc08..0cc026b0aefd 100644 --- a/drivers/net/ethernet/netronome/nfp/nfd3/dp.c +++ b/drivers/net/ethernet/netronome/nfp/nfd3/dp.c @@ -324,14 +324,15 @@ netdev_tx_t nfp_nfd3_tx(struct sk_buff *skb, struct net_device *netdev) /* Do not reorder - tso may adjust pkt cnt, vlan may override fields */ nfp_nfd3_tx_tso(r_vec, txbuf, txd, skb, md_bytes); - nfp_nfd3_tx_csum(dp, r_vec, txbuf, txd, skb); + if (ipsec) + nfp_nfd3_ipsec_tx(txd, skb); + else + nfp_nfd3_tx_csum(dp, r_vec, txbuf, txd, skb); if (skb_vlan_tag_present(skb) && dp->ctrl & NFP_NET_CFG_CTRL_TXVLAN) { txd->flags |= NFD3_DESC_TX_VLAN; txd->vlan = cpu_to_le16(skb_vlan_tag_get(skb)); } - if (ipsec) - nfp_nfd3_ipsec_tx(txd, skb); /* Gather DMA */ if (nr_frags > 0) { __le64 second_half; diff --git a/drivers/net/ethernet/netronome/nfp/nfd3/ipsec.c b/drivers/net/ethernet/netronome/nfp/nfd3/ipsec.c index e90f8c975903..51087693072c 100644 --- a/drivers/net/ethernet/netronome/nfp/nfd3/ipsec.c +++ b/drivers/net/ethernet/netronome/nfp/nfd3/ipsec.c @@ -10,9 +10,30 @@ void nfp_nfd3_ipsec_tx(struct nfp_nfd3_tx_desc *txd, struct sk_buff *skb) { struct xfrm_state *x = xfrm_input_state(skb); + struct xfrm_offload *xo = xfrm_offload(skb); + struct iphdr *iph = ip_hdr(skb); + int l4_proto; if (x->xso.dev && (x->xso.dev->features & NETIF_F_HW_ESP_TX_CSUM)) { - txd->flags |= NFD3_DESC_TX_CSUM | NFD3_DESC_TX_IP4_CSUM | - NFD3_DESC_TX_TCP_CSUM | NFD3_DESC_TX_UDP_CSUM; + txd->flags |= NFD3_DESC_TX_CSUM; + + if (iph->version == 4) + txd->flags |= NFD3_DESC_TX_IP4_CSUM; + + if (x->props.mode == XFRM_MODE_TRANSPORT) + l4_proto = xo->proto; + else if (x->props.mode == XFRM_MODE_TUNNEL) + l4_proto = xo->inner_ipproto; + else + return; + + switch (l4_proto) { + case IPPROTO_UDP: + txd->flags |= NFD3_DESC_TX_UDP_CSUM; + return; + case IPPROTO_TCP: + txd->flags |= NFD3_DESC_TX_TCP_CSUM; + return; + } } } From patchwork Thu Mar 2 09:58:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13157024 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03FB1C87FF1 for ; Thu, 2 Mar 2023 10:02:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230070AbjCBKBy (ORCPT ); Thu, 2 Mar 2023 05:01:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbjCBKB1 (ORCPT ); Thu, 2 Mar 2023 05:01:27 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA998457E1 for ; Thu, 2 Mar 2023 02:00:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b71oOj7sE+4jj1OWCCKvk+J+t5It99MKg+rQztfW9HHleg5IQSMFSdnR+L158khQ4weVoCz/x1anVKcMbOCKUNODr9zNQwnULygYjS39AK82OGhaeORAElEaD4YdsjZUmwkVQIUNMPThXiUE/OhEHREdJ20iADLhUHDc7EIbhd6bpOIwSMlXkVlY+vxORUgFArWgJdjX8rz+wOO3JO7uLc7SppJyWNk9hpv1BdarIc3gOL/k7AHQIKiEqiZnvFiLX4vkhafilhKVwJz7rrDKIu6xT+llzxD5DL4M/Yk6vl9Qg3Ih5suQEJh3hN3Ysk8kTn6tYfVitSj8oY08oJJbAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zlHsAftJ1ZtRqscibEj1gxHP1eEHKr1vXZr4ACcHOPs=; b=ZwKsHQARLBnYxmHdN02H2N7G9cMvcupwPo5NNcjzTZgzIKEVp1C072SXD7GP6rCqB3yYoVWrwJUzDHS14odgFlZuYP52U0h28r8vMYf/ioJsB+/u0UYnyDdKXl09ymIiwzuyC6KY6KsuSU3Oa+gPQ6LZccqzM8u5GGx4v0YT3YKk8hgQXOV7H52f4qJq4jSV9EASTIPzPW0tz1+tYsCmac2QmdGPnV9F9C4h1F74K2LnzkxwM7PvNtL9QaVUkt83vkuGLMVnoJLdXsJ3ApNz9iUH4w64iJftpNUQjyCk0wNcFi3IMJq/WITh+yPpDxIQ7+4q4riOulhsJS3PNl/0Bw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zlHsAftJ1ZtRqscibEj1gxHP1eEHKr1vXZr4ACcHOPs=; b=LvJ053Hx0cYn2mgRzEt5O7U5E6Id5F1O7jShyBqFrVHcASEaPaEV00uCD2aJLStt9cLnJ+yH8Sd/r0b2zjARgmTpp49aHVDEaC3JHSB2pO6mbTzlPy+AxyawoOauj1fzJJTJFiK5k0Kwi0OqwSwAvAfuPnie3vgC6vMXYeBR42w= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by SJ0PR13MB5692.namprd13.prod.outlook.com (2603:10b6:a03:407::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.18; Thu, 2 Mar 2023 09:59:00 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::85f5:bdb:fb9e:294c]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::85f5:bdb:fb9e:294c%3]) with mapi id 15.20.6156.018; Thu, 2 Mar 2023 09:59:00 +0000 From: Simon Horman To: David Miller , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, oss-drivers@corigine.com, Huanhuan Wang , Louis Peens , Simon Horman Subject: [PATCH net 2/3] nfp: fix incorrectly set csum flag for nfdk path Date: Thu, 2 Mar 2023 10:58:29 +0100 Message-Id: <20230302095830.2512535-3-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230302095830.2512535-1-simon.horman@corigine.com> References: <20230302095830.2512535-1-simon.horman@corigine.com> X-ClientProxiedBy: AS4PR10CA0008.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5dc::10) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|SJ0PR13MB5692:EE_ X-MS-Office365-Filtering-Correlation-Id: 492ba72a-87fc-4aa8-f2ff-08db1b04bebf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NlVbhD3jqPB8Az1RdrmugldKVF2UF/+u0J88NxxHWR64NfcpLU0BjfBrVU132sSFvLRYLvjXHaSnAKcbUBe+V3j29myBC8XhZPpHzCwCw97p+OhsBtPuD6/P2p3WG6iVAldQPQcatd7RM1VtKoJ4t3nyzugnC/WSW6UJYbs+TjWCsBd+d5rrNLyeh9BTFvRPcJWyPGNdJKFrQs0d9LRWZykgFm0TKtBU7pHS5u/GQsOiNF8eVUdy7qx/RhOjaK3zBelrxuaA871sEOdZR8BBecJFRphKZmOkjIJvX1Zby0Z0Ghki0nWAjS0ncge75B6CHVXmG7QyR731cMcJUHT8wgNpN0c2op0YckmLs5CtbCNmJlxxqtxc0l4jv58bxmVziO3gJFcUA5UEgB7r2akxh9zdFde2ugLg9i5UOTxHm/2MOHXnKkF51IiG4/rxqQbtW2AKJEG0PolLMaYx9dnzQ0IHLxk6Rep/xCwkCoi6b9YfykUldRxDZnljBiVb+5HE282gjSYcv09ENNK/k4nCOwH09ZAzGuSgzGgTdwvzpoDWpl7uaSn9mVSpXzoTaIS2bF1FbXQu1OXS72f7WP7LJcZZAdbjHSPtFM6J6hEeHAuK6ApDlM9Fnaabk71Mxlzx9fiGmaHXZGTzjJhOgVRk/w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(136003)(376002)(396003)(366004)(39840400004)(451199018)(5660300002)(2616005)(44832011)(6666004)(54906003)(107886003)(110136005)(52116002)(38100700002)(6486002)(478600001)(41300700001)(186003)(36756003)(6512007)(8936002)(6506007)(1076003)(316002)(4326008)(86362001)(66556008)(66476007)(8676002)(66946007)(83380400001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xKujbxpbn0mTHAwKqaepBocvRfqpFtAhXH2QC9xdNo5kojIgRyHBJW9N0YD2NhKiyzRSQpskfXqmmKOsQCooQlza6ETtAHx+6o+0wFR3BmITj9jhFgbJ3S/aCXH7I33Or8FUVZCCnGPZHdvraQa8d+dCSGNoLKBI7wy04cEnUT5qFIdmHUbhx6mo2UdcV6QCcd3m8Ny7HmPsA7RkOiGLOG8hUS42Ms5HzisWAvWNaKUyuuMKY2QNuWXQ9QSUT2ihr0uOE/GFxqT/LYbfrjaGPfN4akMbC/YBAMkxN1wzfKbvfNEWfDfFDX5OhWr5NDR4zYXIi1zNlK0tByPq2Lncs8JeFKT336TOngeiW5FtsPaNpmNighZM+dxNAFMlQu5JGf7K8jCT970xJr4Cvd8xKdq280xooQH46qK3l+CCzCSp6d7wU/Sg+ASVmewobq7UXUFmUDyFRoY/c5qkTevJFwGOXcIXYHhMwsaQPtjrkNL9A11IoOuVDF+RuY3dXv8kGXjKqNxVaLD9mwbFNT3+VqX2J6OOIUAoy7fDoIRNP80uly9aJgN+FirC1t/d+qyXIvrt65rGAjTELnNO4WROSRzLf5IryHC9dq9cxS5OsOJI5Ur+6pB1xTxGypDWPxZMgddd8IDrvozAWgFmvNtZmu6XEMc122K/zvCOubiqhlkJX6MHIvQLU8sTWit6FPVNBs/KP6fXzlevfVBlxhXlNBW8VkvlVLPzQbX+UPEqDhRm33GxY6xWBqMxWLBchw2JScbfZkWyL9pDmhW3dwd/dQArEbtpGb/Cw8dqVq0tmmfC84kKAOb+PSk1Yawo3rFcUXxY3B37d0mWzNI7CXXI7/xRDqohPMphyj9132HafKR75QjLAUyEJawDKigBg+jKa0AVJ/ggvj5iilzlgzx/Ww7ffyphSBbXgJ7tHGcexmFVr6kKzJnXF3srfzZEm7IkU6zFo8CA56ds/fmHEV9CGlpWRRBg9nHSNPzEanFwUudTdz4sG+cNvenaRdHeZKolc45s2oeATwiYPinrx/E4h9tritpuoA9lxoxsIeiu8A9YrwsdXg1OhSnLJUn5yyadX26genZHKXlqWVZ6nDm2Bvx8Zf0e57DUYf1hkig/QqOeacBvEf8qOXHtSaJvC9pzrNJ0Dgc0fuSu4MFgfo18DzciESsgh6E2FMzpGZKxGeW7bPiiViJWU5YN/ilKRjRbbiyzzd6zBnQWrQzXYxGA3p2RRx2qVZdSKySBkbHTc8pdtFseZtDe64pV2vOd40AAeQkVx8bFceZnwVgFgsYKGbXhLDyfh/HPcTTtnUrj61L87FFc+wlHlsyoUKjeF5w/rvK46kdPXyg/CaXCcT6C3SUmWpG6O65HLp4VfztzbN41tANG5RxOUh0VN0FmYU06ijOW8rLxdFEKsDQ4iTlUlTNAgu/Op5TZDemwNWraO1o0zma2HA2CNh7Zmm6/h0CUt30jBi0O+r84pYp79Y6ZOa/jUmhjvA05sm1FDLAIteRhnuGlLvE6v2JO4800SrhbAgIc0xpuz2DgvooOhfS96YRSwUZHuNQbgdrkO+mF4tS2QJf/m3bmQEMCduPyQIpWl5XSkc7TCt0rXEX8b2+v9UZciv0nV1qoDVF7pi2JT9J7FlnuEQKSqezMgXeoz5Gn5NEJBlQqGrOoxeXVEi6Wkw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 492ba72a-87fc-4aa8-f2ff-08db1b04bebf X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2023 09:58:59.8689 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: akMTH8tia+g3Al2IGFhZcUur/Si4mTlePsXjHE4rQYDQnUcA7VoxDdFDBqSGDxlD0DoMkOD5xrDBcgy/uHVOfH0NoDE6sLkkg2MDJiMhr0U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR13MB5692 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Huanhuan Wang The csum flag of IPsec packet are set repeatedly. Therefore, the csum flag set of IPsec and non-IPsec packet need to be distinguished. As the ipv6 header does not have a csum field, so l3-csum flag is not required to be set for ipv6 case. Fixes: 436396f26d50 ("nfp: support IPsec offloading for NFP3800") Signed-off-by: Huanhuan Wang Reviewed-by: Louis Peens Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfdk/dp.c | 6 ++++-- drivers/net/ethernet/netronome/nfp/nfdk/ipsec.c | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfdk/dp.c b/drivers/net/ethernet/netronome/nfp/nfdk/dp.c index d60c0e991a91..33b6d74adb4b 100644 --- a/drivers/net/ethernet/netronome/nfp/nfdk/dp.c +++ b/drivers/net/ethernet/netronome/nfp/nfdk/dp.c @@ -387,7 +387,8 @@ netdev_tx_t nfp_nfdk_tx(struct sk_buff *skb, struct net_device *netdev) if (!skb_is_gso(skb)) { real_len = skb->len; /* Metadata desc */ - metadata = nfp_nfdk_tx_csum(dp, r_vec, 1, skb, metadata); + if (!ipsec) + metadata = nfp_nfdk_tx_csum(dp, r_vec, 1, skb, metadata); txd->raw = cpu_to_le64(metadata); txd++; } else { @@ -395,7 +396,8 @@ netdev_tx_t nfp_nfdk_tx(struct sk_buff *skb, struct net_device *netdev) (txd + 1)->raw = nfp_nfdk_tx_tso(r_vec, txbuf, skb); real_len = txbuf->real_len; /* Metadata desc */ - metadata = nfp_nfdk_tx_csum(dp, r_vec, txbuf->pkt_cnt, skb, metadata); + if (!ipsec) + metadata = nfp_nfdk_tx_csum(dp, r_vec, txbuf->pkt_cnt, skb, metadata); txd->raw = cpu_to_le64(metadata); txd += 2; txbuf++; diff --git a/drivers/net/ethernet/netronome/nfp/nfdk/ipsec.c b/drivers/net/ethernet/netronome/nfp/nfdk/ipsec.c index 58d8f59eb885..cec199f4c852 100644 --- a/drivers/net/ethernet/netronome/nfp/nfdk/ipsec.c +++ b/drivers/net/ethernet/netronome/nfp/nfdk/ipsec.c @@ -9,9 +9,13 @@ u64 nfp_nfdk_ipsec_tx(u64 flags, struct sk_buff *skb) { struct xfrm_state *x = xfrm_input_state(skb); + struct iphdr *iph = ip_hdr(skb); - if (x->xso.dev && (x->xso.dev->features & NETIF_F_HW_ESP_TX_CSUM)) - flags |= NFDK_DESC_TX_L3_CSUM | NFDK_DESC_TX_L4_CSUM; + if (x->xso.dev && (x->xso.dev->features & NETIF_F_HW_ESP_TX_CSUM)) { + if (iph->version == 4) + flags |= NFDK_DESC_TX_L3_CSUM; + flags |= NFDK_DESC_TX_L4_CSUM; + } return flags; } From patchwork Thu Mar 2 09:58:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13157033 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A3E2C678D4 for ; Thu, 2 Mar 2023 10:04:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229840AbjCBKD6 (ORCPT ); Thu, 2 Mar 2023 05:03:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230162AbjCBKDN (ORCPT ); Thu, 2 Mar 2023 05:03:13 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2103.outbound.protection.outlook.com [40.107.92.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DEFC3B3DF for ; Thu, 2 Mar 2023 02:02:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JUV8S2kvdGlbQZrOIbNondoE14gfoUEx0dYzGK6AOAUuoKWgPHGsr1vGaL6vwuSTmqWppBI30GBaeesquOVa+egVuhCelLTsCE5JoizUlnKmtu2Wuvo9tNRGK/X9pfI/q79lb9w+ckuThSVT6LuxXilFwPdiCk7p9uL7p4udZQOXcF9CWBrlyZIb+qN4vwoc2L2RcUJF35PUnnX79LZ3+fD2iIakJfdWH0nGRvGHJbpAtGkmHoaxQNtoLCIsrEEB6z7B72NUxRzAaWDPVKSWubiOeUtJA5c+6FSeVl23tJHiRNliKI5Er+6wtwQ9OnjqOYWVSRGEOxYRU7lQPkHCAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=w3AGYHwqHDlP4ts4sQ+R0AXMvdpk1u25Eg38SMf1zkk=; b=LAytyjxieDB2HZzVpRnJVZXV8ruQupue+XKInNRfNFQRlzpNyUynkXgKcqQ8AJuuySp+nDjBF2obdgaIHPLu154cHGWwexUXun9mDIaPo+y5n3IViHTsutQTTqQr0xRVvUfr9iiio9obPtPaGMLTRoWuP4DuZ8IZJhtG6Ux3fzWTdhAOF+jjOln/BDl2A98xm5qfms4rcGkVMqInqwA+zrY/f8E7GiM087crbjEL+Md/B3X2aWidmvNgvOdgvaPRj+o6wE3w+wVApG9OjWfvhJHsRfnSQEaOCXN6x5q2OeV88ZABAqbAj5qYujKGTrT6Iva/h/73H+cNazR3znRaEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=w3AGYHwqHDlP4ts4sQ+R0AXMvdpk1u25Eg38SMf1zkk=; b=IiQAVh6B3uMCj8VMriZLS40s48jntSJQhfyXmCAWRPpRWHsPzmO0lEYY+fez8PmAimi044nwL+8IDBdB3rG+PlRpQPD4WP1p6NZtjXPmTkZkltbki6q0RMDdmp+XA1+5HH7CB/0ce/dl47OGrDbnIoVMiy4SOY9ly9SqM9zG7ts= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by SJ0PR13MB5692.namprd13.prod.outlook.com (2603:10b6:a03:407::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.18; Thu, 2 Mar 2023 09:59:01 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::85f5:bdb:fb9e:294c]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::85f5:bdb:fb9e:294c%3]) with mapi id 15.20.6156.018; Thu, 2 Mar 2023 09:59:01 +0000 From: Simon Horman To: David Miller , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, oss-drivers@corigine.com, Huanhuan Wang , Simon Horman Subject: [PATCH net 3/3] nfp: fix esp-tx-csum-offload doesn't take effect Date: Thu, 2 Mar 2023 10:58:30 +0100 Message-Id: <20230302095830.2512535-4-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230302095830.2512535-1-simon.horman@corigine.com> References: <20230302095830.2512535-1-simon.horman@corigine.com> X-ClientProxiedBy: AS4PR10CA0008.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5dc::10) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|SJ0PR13MB5692:EE_ X-MS-Office365-Filtering-Correlation-Id: b0d8e91b-6c2b-4c5a-b1cd-08db1b04bfb5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kXTOmNL/CjHmDQdzSXLXypkI2wu58VRsduI9r2kiEZp1if4M/L55N1W5zAm7bSfNavPva7DiYWN+AGnwHBUC7f/NMPfyBRIRwVjH3VEW4/A7Qf8w+Ma4VKwLPM1wBpaDxigQqy2DgVVGhN9JkK36Q844Sjz0VkdvARg6RbehrUTNL+OG4bmUoK1IT/NTi9SNEbZOE5WgyE2ik2LWmeVSliSiFaWVkU3ppc7JSXsGWKsbxY9yfyw5Bqy7/Y5VNECmlkWA9FFuwzY5wgxqSnO0+GAUKneA4Fbl/H8rYGN2XCDaWQmZc/94L1kRRZ7AXLOvbSyRNHxI+w5q0eMDrZYGdY4lyPictLqzRGWzyLQ30RKQo0TgMb2gyTnvqthkcrSjk/1YwcIzZxWpoOvu8qLAphN+6YTfw8Q7U6/Cn5giO8wZd8oSht8TSlbCXwfKCnwk29EBC5qKZFppgpmZke5odBeQu5V95lkwOlxK1xId2n4ENe/tKuOwKWQln4z8DraSzAbgHB/VCYvo93/2ANoP5ECtz3PjqQ6/O9P5kxa7u9Z4YBsQK4O7gIVK90zgUxtPmpqE8c308tn6fGE93OuCqIXMS5AwxpFQ4yclSlX2ixn7qhjB1xkoalJygLpZFeWCtcmTlcJYB+/vlbctRc2yUA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(136003)(376002)(396003)(366004)(39840400004)(451199018)(5660300002)(2616005)(44832011)(6666004)(54906003)(107886003)(110136005)(52116002)(38100700002)(6486002)(478600001)(41300700001)(186003)(36756003)(6512007)(8936002)(6506007)(1076003)(316002)(4326008)(86362001)(66556008)(66476007)(8676002)(66946007)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: t0tMNiOmORINtnGS9uAaCAa/ZILfaF595FcDCfXfagzieRXuHGgWmYgqRi+GxHmoQarmJgypOBrY+petxss0vcrCHP+wyZaSLmt1+8XJuLZTA3gnGDfCqG33wD4yGlM2kYrEthuyIjIoxOALKSZsOs3RhqQSyY4eXOJP7shvtfC11zfbvdhUiZSWPHhw+cfuK97FXtVPgBIaU7dyHzp7OiRZ3nKWuSQsBaNgjCg0TjhwcZUGZ1fz3gigkNNFJt5PMTWnmwo7eX+S/o3bn6cRKdT9ooSG7ap2ybb6wZ/VICIjYd5zBXP/nA62WKpEO6D9KWKpOLmPM/HM/dA5B9CVXZSXv3XaG5lUsVZXlsnJdE6z/9O2T/UqaEBpZnU6zwSrBTWYMVBh7ApfQP2n50+YodcOqMl6xw8CbOpLhwqhKpPBwNociL+vg12ggZ/XS1yfSDDYp991p9Wj/PrDhhylB07lqANKnBYvkG+MB8tW8pmaECK6kjggoPVihX5irLqNCCATtTb9mUqhdrEWD6gH58MiUaPxA2zrRCLHuYtuwObZJ2nKPvpfw966nh3MJ/tcoROOi1ntEqfjbfrzgGPZozSGJryrQpSwnQLeKGOaoqBO0sZvnyZyrDZUFBZuQV/3nHmOQP0XHOKfvXSTj/EYpWW9IvZqpcvMtQ5BE9OmVoUJZxqXWs0ivXsfFBJeQ1MPLM6wE6ncyfBJqAngNkVtAiDc5TjDPCfHGl+RsXnTkQHkXqY/8/ARZOgV0ffoueUu4PAnVe2PKifLoUvod6eE4HsaFWmtQm9qcO/SVv4BO9iJwWCWWL+/8nLMJh1g+Ou6nh687HX5zVs6qBq1L2p4EjFQvMwoucIXBP3Svpo+efXjZ5goBFmv2iiBUEnBNjnmnzBjmBVEwb3qd41EPn9BCIBC3dE9EP5/AYpy1i9iRImaHBfD2DiJBFxaF3+PxZFJIlFDeAhXcXYss/qjqGLRJSXhkgaaSBPize6KZMcE6HtOY8I7FIzd4zY6FMsPcsJWgLjQ87FNnvyl5bGUs5s+iNRcLUtykMHT7m7cPLc78uTPMyiPsRHDnyyqMQeNsEHwxdRcX6iBKV/5cMokTnU/emWqqsiQDyZ/+IisnB34607zVFbG8lHpbdjO5yJxpqeqd1AbdpTQD3xhh7vnr5LD1FJKjrs3+JBi6A1o8YnIhaP0pR1y0ZN5MIx2/fUF4uUoYmv6Ajuqv76NrTNdSzJyoV1v9Ag5EblhEjuK9cisKf2Qb909HzU4TdmX+1YKkhmaVr35NVM1MDUBwxLo/KFcFbY+5Z4z/ZGSvwBRahOW95DZrodSL7Ct9UjSevlglFrWZmFqprMG3oBLE+/2f41f7XepRDFEC51xwUifHOWmgtkfvEjjqccQ/yChunZOmF0nn0sI6A91nu5/FgIzuY92BsZXZ6z/Ga8nRKTuJmI3V1QEL2wUrOaeahn2yXTUeFg94IVbAUMuU1WYlTUHdEeAqXINxxtQAXWvI7ErCUVGF8rvM8atEQmp0QCZYhPwZcaf9B2rcK41nh1HNE9ATcep9eaKj8oFfmhIGNXo3fmmLeatA0KoQkhJXV9TmkPJ3bjYAq8A/Mrzh/dF7xow5tMXd7DWyu8Gs/14dXsgmNl0Q1pqw7D8ItIXVbriA/FBccuBc/F/jNloBeuNVVRI1VSUGQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0d8e91b-6c2b-4c5a-b1cd-08db1b04bfb5 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2023 09:59:01.6356 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AC/+WurhuNdGOkoVvypcjRx4yjCH+LzasUcsrE/i0XhX75aFA1CThURB5x4Nr95ePd4kJf47ngkPTI1yvUPyAWUxW8zNkKzDm5Qwyb4slWc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR13MB5692 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Huanhuan Wang When esp-tx-csum-offload is set to on, the protocol stack shouldn't calculate the IPsec offload packet's csum, but it does. Because the callback `.ndo_features_check` incorrectly masked NETIF_F_CSUM_MASK bit. Fixes: 57f273adbcd4 ("nfp: add framework to support ipsec offloading") Signed-off-by: Huanhuan Wang Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index 81b7ca0ad222..62f0bf91d1e1 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -38,6 +38,7 @@ #include #include #include +#include #include "nfpcore/nfp_dev.h" #include "nfpcore/nfp_nsp.h" @@ -1897,6 +1898,9 @@ nfp_net_features_check(struct sk_buff *skb, struct net_device *dev, features &= ~NETIF_F_GSO_MASK; } + if (xfrm_offload(skb)) + return features; + /* VXLAN/GRE check */ switch (vlan_get_protocol(skb)) { case htons(ETH_P_IP):