From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BA744A04A7; Mon, 24 Jan 2022 11:16:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 43BD0410E1; Mon, 24 Jan 2022 11:16:35 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id D337D40E0F for ; Mon, 24 Jan 2022 11:16:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643019394; x=1674555394; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=55Apb/T/gmaucb0FPGt8PlaVwghcPP1uLp5hL8pvwm4=; b=ndLUqBVcuk5W+VjJz3VqjmzZUaSnKW8u8lG1m1gsUXetQsjzJJSKwn5p JHquk4wvFSRXTEQbJPLOD90kbvZV6+ZOwDe6n7jjMD6FjG1P2oBTW5WOF /w4AAOE9iXbX1NFUfEQ9tXDrg4c50l/rVGcR3DQbxJRcUOyC5XOK8jhTE haCJ4tunfGU0kZ9O14wbjndw3jQOves9jNPnbemOhyQ/iPMiKNSGHM92s YzMprfEBtDo0nxvq8DE9iJ8MiCZYus6tMu7wxABx8wYReeXOBATzy7GPb 4c6Ev0g3HKlcnNtud7XDgXHKPFmOfwx8iOSuXvxRqFl2ocHeKNuKmmOSN Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10236"; a="245959366" X-IronPort-AV: E=Sophos;i="5.88,311,1635231600"; d="scan'208";a="245959366" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2022 02:16:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,311,1635231600"; d="scan'208";a="580322493" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga008.fm.intel.com with ESMTP; 24 Jan 2022 02:16:32 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 24 Jan 2022 02:16:31 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 24 Jan 2022 02:16:31 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.44) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 24 Jan 2022 02:16:31 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kn+sGLGLkkWSuxDA4iMeqHYAzQPy5UtWsAcu+QYVnOKPXmn2rooNQM0zdbuoUua6dFOHe47CgJIUVntILufRNv1L1uFnJV+jwrdQ/UZsViwNzcQaI6xLBC6wQ4afFoXfjqRY1kQIGJPFu8yH0ow4rsZBS+uXe9P8mqJZaBB1NyWFmv8G4pu6eWO8GzPLvdy6AYFRSdNU2VZ1YoyK6F8jcL+B8DOkCsp6x3AaFh91/bdE2FT9baTCPCzSbneRC19jczZrTbGJxrr7NLI/viq8ZfbW7+UZ7ClCuSAoMV5So5HVW03iYu8W0WH1fOJrbZmPm9Z/mgj3eXvkCt4YiPZPRw== 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=x2t/GCW6z3KJzFRQgTjQKBXsba+14H6GY+I0F49w9pM=; b=a+nlfHkQvnwVnOsmIN8NcvjTZv1+FOMhgDvRvHLfxqeNgFI/wSslWFuWyADzh4kXnSQd613hO166cep1ntzvLCQlXAS5oqElcOTjkpEETQFDV6x96NJwiTS4PVc8U8Ulb9ZHZZ80NQFj619pNh/+0eap6IcQSqQKip9KSxCEZOq2Hf3hAjXYLwrOKG7T3ybj4v9YwLriavLUHyKf/fdRh7cm7SIh0Rp4Dgtw4Nor7m/1dfu7FA8DBfWaMMtm0jVTIV/YI1O88iYUoq8CHIf0YfPIqTKqWQ87Y8aLGVCOo92AZPA4sa9IHLxXQoKhN/zjSkVxkY6hKFomDMMxZHQrjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by CH2PR11MB4389.namprd11.prod.outlook.com (2603:10b6:610:3f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.12; Mon, 24 Jan 2022 10:16:29 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e%7]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 10:16:29 +0000 Message-ID: <22bb76ad-3275-1085-bfe3-c712e276fbb9@intel.com> Date: Mon, 24 Jan 2022 10:16:23 +0000 Content-Language: en-US To: "Li, Xiaoyun" , "Singh, Aman Deep" , "olivier.matz@6wind.com" , "mb@smartsharesystems.com" , "Ananyev, Konstantin" , "stephen@networkplumber.org" , "Medvedkin, Vladimir" CC: "dev@dpdk.org" , "Pai G, Sunil" References: <20211015051306.320328-1-xiaoyun.li@intel.com> <20220106160333.762686-1-xiaoyun.li@intel.com> <20220106160333.762686-3-xiaoyun.li@intel.com> <1c366b66-4e1a-94ba-e1af-161a1dded713@intel.com> From: Ferruh Yigit Subject: Re: [PATCH v5 2/2] testpmd: fix l4 sw csum over multi segments X-User: ferruhy In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0253.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8a::25) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8887bd3e-179a-47b3-2ce2-08d9df229627 X-MS-TrafficTypeDiagnostic: CH2PR11MB4389:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W48iXfYVQxEdOIjDE4TvtRiFr6igk7aeiZNbI0bVQZMxOr2RXNLU2ypI/EUAzrJq3U8uUmBr8/rm+8CuruDJcHNR9CLkYtTPPgnIbwa6biA/gRVkj66P5URkP0S4dSW+ODDcv9zulsajsqWyRUNgIbzHYX15I7jR++AGtjRpH18aqMcR1ScNHYIBwkClMDt9sfANOE+SL1gDJQbMOcvkif6+AfC4+UtjCxzfIxsMS4lvb2RU21K6qbunvwHFB4ijUu8nz+S4XdT4aYpeUC+6IsVVdGel/gH5PKpxj3OZmoG+HK6ozKUg+eY95ZPlBhT209QY/OR82ruYRytbmzqXupvaGrN+ngQZewtnMAf7rPkdfWCOz5g2p4noIsbBXA5tGH1N0fmJdMUr6FXn8HygJeR0U+Y7Y2MXEX9V6rr9lyZvCPM+JAAx12x2ZrmtkV3IwGMSSH8g5vqaVl59y3cprXzcWCAqnkaXXmDMJi2/PXbL8oSXiVB35qONm+K8hgo4q8PmeElxnSBLQm4rNkxcm4NTju8hw520fXFjVdFqbhzoym9RobMlujHk/6uwcAfeNwZ0fdRIfuJVvgBqUZYAMhmu4PfBBovVzx69W8Ztdlm8NOM8IeCpaVFsX8vR1Fn7sr+1zccWNzM63JIXnk6+x1R/lIgjCcFKFxB5atbBlDi9kaoL6/Zx6UCb8wgg4yjfePBmmI2LGJabGA9dVvkkXZ6Dz031KLFsnZC0zpi1ahI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(66476007)(8676002)(8936002)(110136005)(38100700002)(66556008)(44832011)(6486002)(83380400001)(5660300002)(66946007)(508600001)(4326008)(316002)(6506007)(107886003)(53546011)(54906003)(2906002)(26005)(6636002)(82960400001)(6512007)(31686004)(2616005)(31696002)(921005)(6666004)(86362001)(186003)(36756003)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SHpHeGdoVU5FTDJSa0lhdHNaOC9LcXozT1pBU3lrMlh1eHBSQWlIakovWWgy?= =?utf-8?B?NDJpSFJKVXVJdFoyMWpPcUhmM080QURrc2RhamdXT2EwRVNheFp0Zi9FaDhq?= =?utf-8?B?T2VMSWtFV25kZ0RpWTNtQUF0eUV0RVVPajZRcVhacUxtcTRLNmJNZ3Bkbmtl?= =?utf-8?B?UWpkMGZlUjIwZ3hJV05kMXdYc01PbFI5Smlvbi9ibkE5WEVCUml5dFRHdFRz?= =?utf-8?B?NG04QTRaZmEzK1FGWHB1UmNjVWZXQlpoRmI2Q1NWZXd2WVpzbFJaWlRoUmxn?= =?utf-8?B?Mnl0d1pSQzNidy9KL0QyQzBiY2I4WFJPOHBwNGs4WjMyNUY0QnJIaE5D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WMFdW?= =?utf-8?Q?hvVKo1JHL2Icx5x7nvlz9Aw=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 8887bd3e-179a-47b3-2ce2-08d9df229627 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 10:16:29.3180 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: x6o/kA1sjEgNRugzHIuSEwFsEs9JTS91BwkkyxRLvcRP9yJSdpv8h7KK9PFrW9W0hkLHNzZnNl7jeaBAtbG/Tg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR11MB4389 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 1/24/2022 9:43 AM, Li, Xiaoyun wrote: > Hi > >> -----Original Message----- >> From: Yigit, Ferruh >> Sent: Friday, January 21, 2022 15:17 >> To: Li, Xiaoyun ; Singh, Aman Deep >> ; olivier.matz@6wind.com; >> mb@smartsharesystems.com; Ananyev, Konstantin >> ; stephen@networkplumber.org; >> Medvedkin, Vladimir >> Cc: dev@dpdk.org; Pai G, Sunil >> Subject: Re: [PATCH v5 2/2] testpmd: fix l4 sw csum over multi segments >> >> On 1/6/2022 4:03 PM, Xiaoyun Li wrote: >>> In csum forwarding mode, software UDP/TCP csum calculation only takes >>> the first segment into account while using the whole packet length so >>> the calculation will read invalid memory region with multi-segments >>> packets and will get wrong value. >>> This patch fixes this issue. >>> >>> Signed-off-by: Xiaoyun Li >>> Tested-by: Sunil Pai G >> >> Can you please check following check-git-log.sh warnings: >> >> ./devtools/check-git-log.sh -2 >> Wrong headline label: >> testpmd: fix l4 sw csum over multi segments Wrong headline case: >> "testpmd: fix l4 sw csum over multi segments": l4 --> L4 Wrong >> headline case: >> "testpmd: fix l4 sw csum over multi segments": sw --> SW >> Missing 'Fixes' tag: >> testpmd: fix l4 sw csum over multi segments >> > > Will fix this in next version. > BTW, should I change the patch name to "app/testpmd: enable L4 SW csum over multi segments"? or ignore the fixline complaining? > Please change the patch title, and it would be good to provide a fix patch, thanks. >> >> >>> --- >>> app/test-pmd/csumonly.c | 41 ++++++++++++++++++++++++++----------- >> ---- >>> 1 file changed, 26 insertions(+), 15 deletions(-) >>> >>> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index >>> 2aeea243b6..0fbe1f1be7 100644 >>> --- a/app/test-pmd/csumonly.c >>> +++ b/app/test-pmd/csumonly.c >>> @@ -96,12 +96,13 @@ struct simple_gre_hdr { >>> } __rte_packed; >>> >>> static uint16_t >>> -get_udptcp_checksum(void *l3_hdr, void *l4_hdr, uint16_t ethertype) >>> +get_udptcp_checksum(struct rte_mbuf *m, void *l3_hdr, uint16_t l4_off, >>> + uint16_t ethertype) >>> { >>> if (ethertype == _htons(RTE_ETHER_TYPE_IPV4)) >>> - return rte_ipv4_udptcp_cksum(l3_hdr, l4_hdr); >>> + return rte_ipv4_udptcp_cksum_mbuf(m, l3_hdr, l4_off); >>> else /* assume ethertype == RTE_ETHER_TYPE_IPV6 */ >>> - return rte_ipv6_udptcp_cksum(l3_hdr, l4_hdr); >>> + return rte_ipv6_udptcp_cksum_mbuf(m, l3_hdr, l4_off); >>> } >>> >>> /* Parse an IPv4 header to fill l3_len, l4_len, and l4_proto */ @@ >>> -460,7 +461,7 @@ parse_encap_ip(void *encap_ip, struct >> testpmd_offload_info *info) >>> * depending on the testpmd command line configuration */ >>> static uint64_t >>> process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info >> *info, >>> - uint64_t tx_offloads) >>> + uint64_t tx_offloads, struct rte_mbuf *m) >>> { >>> struct rte_ipv4_hdr *ipv4_hdr = l3_hdr; >>> struct rte_udp_hdr *udp_hdr; >>> @@ -468,6 +469,7 @@ process_inner_cksums(void *l3_hdr, const struct >> testpmd_offload_info *info, >>> struct rte_sctp_hdr *sctp_hdr; >>> uint64_t ol_flags = 0; >>> uint32_t max_pkt_len, tso_segsz = 0; >>> + uint16_t l4_off; >>> >>> /* ensure packet is large enough to require tso */ >>> if (!info->is_tunnel) { >>> @@ -510,9 +512,15 @@ process_inner_cksums(void *l3_hdr, const struct >> testpmd_offload_info *info, >>> if (tx_offloads & >> RTE_ETH_TX_OFFLOAD_UDP_CKSUM) { >>> ol_flags |= RTE_MBUF_F_TX_UDP_CKSUM; >>> } else { >>> + if (info->is_tunnel) >>> + l4_off = info->l2_len + >>> + info->outer_l3_len + >>> + info->l2_len + info->l3_len; >>> + else >>> + l4_off = info->l2_len + info->l3_len; >>> udp_hdr->dgram_cksum = 0; >>> udp_hdr->dgram_cksum = >>> - get_udptcp_checksum(l3_hdr, >> udp_hdr, >>> + get_udptcp_checksum(m, l3_hdr, >> l4_off, >>> info->ethertype); >>> } >>> } >>> @@ -527,9 +535,14 @@ process_inner_cksums(void *l3_hdr, const struct >> testpmd_offload_info *info, >>> else if (tx_offloads & RTE_ETH_TX_OFFLOAD_TCP_CKSUM) { >>> ol_flags |= RTE_MBUF_F_TX_TCP_CKSUM; >>> } else { >>> + if (info->is_tunnel) >>> + l4_off = info->l2_len + info->outer_l3_len + >>> + info->l2_len + info->l3_len; >>> + else >>> + l4_off = info->l2_len + info->l3_len; >>> tcp_hdr->cksum = 0; >>> tcp_hdr->cksum = >>> - get_udptcp_checksum(l3_hdr, tcp_hdr, >>> + get_udptcp_checksum(m, l3_hdr, l4_off, >>> info->ethertype); >>> } >>> #ifdef RTE_LIB_GSO >>> @@ -557,7 +570,7 @@ process_inner_cksums(void *l3_hdr, const struct >> testpmd_offload_info *info, >>> /* Calculate the checksum of outer header */ >>> static uint64_t >>> process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info >> *info, >>> - uint64_t tx_offloads, int tso_enabled) >>> + uint64_t tx_offloads, int tso_enabled, struct rte_mbuf *m) >>> { >>> struct rte_ipv4_hdr *ipv4_hdr = outer_l3_hdr; >>> struct rte_ipv6_hdr *ipv6_hdr = outer_l3_hdr; @@ -611,12 +624,9 >> @@ >>> process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info >> *info, >>> /* do not recalculate udp cksum if it was 0 */ >>> if (udp_hdr->dgram_cksum != 0) { >>> udp_hdr->dgram_cksum = 0; >>> - if (info->outer_ethertype == _htons(RTE_ETHER_TYPE_IPV4)) >>> - udp_hdr->dgram_cksum = >>> - rte_ipv4_udptcp_cksum(ipv4_hdr, udp_hdr); >>> - else >>> - udp_hdr->dgram_cksum = >>> - rte_ipv6_udptcp_cksum(ipv6_hdr, udp_hdr); >>> + udp_hdr->dgram_cksum = get_udptcp_checksum(m, >> outer_l3_hdr, >>> + info->l2_len + info->outer_l3_len, >>> + info->outer_ethertype); >>> } >>> >>> return ol_flags; >>> @@ -957,7 +967,7 @@ pkt_burst_checksum_forward(struct fwd_stream >> *fs) >>> >>> /* process checksums of inner headers first */ >>> tx_ol_flags |= process_inner_cksums(l3_hdr, &info, >>> - tx_offloads); >>> + tx_offloads, m); >>> >>> /* Then process outer headers if any. Note that the software >>> * checksum will be wrong if one of the inner checksums is >> @@ >>> -965,7 +975,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) >>> if (info.is_tunnel == 1) { >>> tx_ol_flags |= process_outer_cksums(outer_l3_hdr, >> &info, >>> tx_offloads, >>> - !!(tx_ol_flags & >> RTE_MBUF_F_TX_TCP_SEG)); >>> + !!(tx_ol_flags & >> RTE_MBUF_F_TX_TCP_SEG), >>> + m); >>> } >>> >>> /* step 3: fill the mbuf meta data (flags and header lengths) >> */ >