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 687EFA0547; Mon, 18 Oct 2021 06:41:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E674F40041; Mon, 18 Oct 2021 06:41:07 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id D9CE14003C; Mon, 18 Oct 2021 06:41:05 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10140"; a="251621970" X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="251621970" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2021 21:41:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="565854065" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 17 Oct 2021 21:41:00 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Sun, 17 Oct 2021 21:40:59 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Sun, 17 Oct 2021 21:40:58 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Sun, 17 Oct 2021 21:40:58 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.175) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Sun, 17 Oct 2021 21:40:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f8NxhxiGfwfCRyCpboHDNXUXbBteXFMnUyEHHS1KfxvaNKldZ39UrbJ5ImcZHEhl9Daq0JwUZPuN6z1LWa3NPi6/rbx5xmLq8uaFdTkids3r0jN9eJ0Ptt0ZNk3grk0JStmzqLjSQWvt72nt23y1umqZrC0pImJIgYk0YIZkLA3nEZ81UX9PFfR/LfI8T8ITtHNtjK08iVbZF+LwV0X7qo5Y+Rkacd28u0aPOTR5AddZxqBOlFiiIpC2vc9MXlQLTB2XfZZfEzcy3ft8PHHx/fBXgvNJouSR5RqmPwrhaYU3O/d/3NCTGmoxNyv2CEo6ZsCUu8bGkapID/zJiL3nIA== 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=/5NSeQB6qeaSrzqwbmi32DFMEzqT6YKqfQL35JdicYY=; b=RFxYns1NYAYFA+MKLzm+XK9pwRnyxrF4cKBScUFYYcU2pGbjONYvlHHmNvZ0LrDX7FYAxiD8aLTbWsNC/AIUotrL9YolxMwywv5gOtqETPGkJnKvfqS297J3tZ4jg5xqoNbaPSZY6og2sY/wE7dmHVqhyL907aAm9BmMhQrQ9NlF2uVRV+eIrtoJMsUAS8dfwKAnoiKs7EKkpXnMJOKwpg3PHvKfHh83bbhzWnFfmYg37aKo4JVziC4O1PPVht7yNzZF8R3JO9Pc1/CPB4q3fQX3n/1msfz32LnnSGX6D81/FwGzD5/HXDodIZqX40+QsIiNb+9sHIVMqkihFg7bUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/5NSeQB6qeaSrzqwbmi32DFMEzqT6YKqfQL35JdicYY=; b=A42vsCYwY+eef/AJJ28TTOV7jU96aEWfyBAws2oPFqXoMVXqkyXoD4gIipdjKFhKUi4vGdtRZeRofrp80JDrPuMGU4WMSXQZRnQHZeKohkqosgYf4vO8vTUt9DhSiZKhdk1LnvUDJf2f1ELDfxdH1sVX4f++smeJAxOVtRmFKXk= Received: from DM4PR11MB5534.namprd11.prod.outlook.com (2603:10b6:5:391::22) by DM6PR11MB3129.namprd11.prod.outlook.com (2603:10b6:5:65::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Mon, 18 Oct 2021 04:40:57 +0000 Received: from DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::3d9b:76d7:e274:bad3]) by DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::3d9b:76d7:e274:bad3%4]) with mapi id 15.20.4608.018; Mon, 18 Oct 2021 04:40:57 +0000 From: "Li, Xiaoyun" To: "Li, Xiaoyun" , Stephen Hemminger CC: "Yigit, Ferruh" , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: fix l4 sw csum over multi segments Thread-Index: AQHXwYVaz7SPKH1dmE+Jm4+VK6BXS6vYFXOAgAACF1CAABnVgA== Date: Mon, 18 Oct 2021 04:40:57 +0000 Message-ID: References: <20211015051306.320328-1-xiaoyun.li@intel.com> <20211017200003.2bfbcf8c@hermes.local> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 85b55266-d951-4bab-2e00-08d991f17a52 x-ms-traffictypediagnostic: DM6PR11MB3129: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hrhGW/4aqNAq4qNuLC2ZU9Tx2Zj0XPq2Q5yui1T6iGf39tDv6gHn92nKp2wgPNYknReUP/581/DhXq7ePXb7nQ3npBwfzmNg1EnniQS97w4qGXYXiT7FpfHv1a9zD4LinUmfbSqrUpMT0gAmlkeRm0v7CEDpk5ewROYdcoCNXxJqrcDuV4mPCt5vuv9if+onpBQ8hEc4jswBP/YQTvdbjBlJnvpEZUinjQ7D1PVupg2ZirYOhOx72RTlKHXY/4BU6EhHbcNQuDmLBuigzS/eUpYclAoKlMaR8YV24piff14yf1BfJmGOgqOQgxtQ721tGcICW/Px3uh/ZmzL8WkCIcCx1bpupRqAyrQVyDlwx8dSjaQkBgYALCDT159U6aiLhDWSbvY4SM8QdPt8Ys8y0/orucrAH789B9yt6VYoX5aYbYIqy7wRLJjYvmkN0i6zmzmOmvt1OrMYxJ0uiG2wUNoQty00WsTpHolGJOKk20kqKGOsfgsAaIFTukf1PusdAcKik0iVK1hCcypOy4wwXFMr8oa7fSGc2cHM6XED42KYxKRoCWxjMP8uIUJGEKXz6OaGmCYrlr1c1rBK4/l6EnOTJdytJr32TuFt5rRVhgzcNeN/GEdMOqeHIChrWJ4sgv0I5CNqzDxWnnxDebx1Sf48lWSAJHHsBfpLOF9RqYEcB1Xgbl2//mcwdHsNBfhjFBNZ5/4CCzLrGF8d9wDquw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5534.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(82960400001)(71200400001)(2906002)(110136005)(54906003)(122000001)(55016002)(5660300002)(7696005)(9686003)(316002)(38100700002)(66446008)(86362001)(64756008)(66556008)(508600001)(186003)(8936002)(26005)(33656002)(76116006)(66476007)(4326008)(66946007)(38070700005)(8676002)(2940100002)(53546011)(52536014)(6506007)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?e3C8/L5h10E/7b0PDDvb/2YZx6OgVgzho++K9VBiiOD/k9MBlaflQYvfRtGX?= =?us-ascii?Q?+35MKlKdAjpms6lDu1r5/362bARsoLmz9UEs4xaCZwUke5fb0hFbZc+73RYK?= =?us-ascii?Q?tpwZHjyzioyds/f4XD+P0GtoUmx9GwF4DzpsnZTVbf5hEdH0bKPzWCwmmPvi?= =?us-ascii?Q?Hvc3A2IcWUiNIhRZJtoWofOq47xTXWhAMcDnJAICL2IZcaNNnki7ifnMZSF1?= =?us-ascii?Q?8zX6tDfIu9GIRgA6P+FfpDygkJpUCLw0dB24ltmmJ8D86V/d9asp6iOhcaDP?= =?us-ascii?Q?sUGt8ef7dVsKnIxAAw3ELQyjGRlXb5LXQKgtCdPr10fxQtmzmwTheChKPCMi?= =?us-ascii?Q?L/OKSzRseA+3KHaBmw8HxQE58S3QuobEStYQfMurDdjrh6q0R/ENfVEjQ3Ap?= =?us-ascii?Q?SZnxbxasMtZ9GyVhgGe9kNgKeVx4IfCdc4M3Stp2vyT4avrG+l6iLNeKdg/S?= =?us-ascii?Q?5S9GH3rX3gIs0fdq/nd4lc/+YXOjuRnxmw6H0mueCDriAKHoohLj8WjqHcoX?= =?us-ascii?Q?xclBVlwAmv9aF9LMYBZ5oeZ2S0O50FGEogubTc1A+5SQ2Di6/LF9402mj1ny?= =?us-ascii?Q?VeGq+sXsjQFnM8Q/z7M6FF9bAvnppHSzAJsMPV5qDMPCkAcyQFxkbttcWhmb?= =?us-ascii?Q?hyuynGKaxeGOnUwr6tC90AjBntBorx5yk0/2zWXY9r1ivgUe6/nwP6e6GS7o?= =?us-ascii?Q?eBQ7VpB12srprk3bkX4vpHYDF7Bz/AdxQwhIjndtXrQ4TywbbDUz/wv/+JVZ?= =?us-ascii?Q?o5pILt7JNoSiSlS6urm7bF3oXgyANvFSiwkcoFu4LymCnk8R6EBJu27rAvda?= =?us-ascii?Q?uS4h6SF3sKnnbHepNnrWWHS1n39PHUxLVg8ejmcIdwLYN/Z5PZ41qXhd/YkU?= =?us-ascii?Q?lOkxXSV/0I8ZeB5p0wdFa8ZsM4GQT+ZuyNlkqrDp5GmqZBS52hMdCXgMLJyz?= =?us-ascii?Q?SyiM/cKS5UE1qatexRMeXQoTBH1v4xMvoy9Hdn4VVdQq1mDBUPfDoDtpYvT2?= =?us-ascii?Q?cei/Fqk7mgQX/a5CKwNa0Bsbuuq+3rwaOksGsfpiUSu+R1hu4lhI6gqf0qo/?= =?us-ascii?Q?KSc5rINwtyMAOZ4YrtSiM58evuw5XbfMs/5J5OUhBO5d6mqA1X7kOGX7MLXU?= =?us-ascii?Q?9vo+j3HSy6G2Fjn4yF93aviN2MLbCaIm7mXLdbmjAaGHND6ADUvbJzuRDhoi?= =?us-ascii?Q?Rq0OxGvP/Mvwwq+OeikAxi0lRn7K99nPb2fRlFSAIVwvU7cY7kJf6Bgz8reT?= =?us-ascii?Q?tlJo7Tta7qKe4b9eXH83xZk/oMTxBLMmhmueOAtFLVrs/GlRPeWZPvrKCOEn?= =?us-ascii?Q?pkmzyQsK14OCxaMp/Ov+bMId?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5534.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85b55266-d951-4bab-2e00-08d991f17a52 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Oct 2021 04:40:57.3972 (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: EgyQpz1guEtxBSxHb5HO6yBWBrxGz2D2ST5rLGrwRYb/8m9Sa7oAncJOJLkzz/HgwMpBVt2RDGlqsnJsP+0wnw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3129 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix l4 sw csum over multi segments 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 Sender: "dev" > -----Original Message----- > From: dev On Behalf Of Li, Xiaoyun > Sent: Monday, October 18, 2021 11:17 > To: Stephen Hemminger > Cc: Yigit, Ferruh ; dev@dpdk.org; stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix l4 sw csum over multi > segments >=20 > Hi >=20 > > -----Original Message----- > > From: Stephen Hemminger > > Sent: Monday, October 18, 2021 11:00 > > To: Li, Xiaoyun > > Cc: Yigit, Ferruh ; dev@dpdk.org; > > stable@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix l4 sw csum over multi > > segments > > > > On Fri, 15 Oct 2021 13:13:06 +0800 > > Xiaoyun Li wrote: > > > > > + /* When sw csum is needed, multi-segs needs a buf to contain > > > + * the whole packet for later UDP/TCP csum calculation. > > > + */ > > > + if (m->nb_segs > 1 && !(tx_ol_flags & PKT_TX_TCP_SEG) && > > > + !(tx_offloads & UDP_TCP_CSUM)) { > > > + l3_buf =3D rte_zmalloc("csum l3_buf", > > > + info.pkt_len - info.l2_len, > > > + RTE_CACHE_LINE_SIZE); > > > + rte_pktmbuf_read(m, info.l2_len, > > > + info.pkt_len - info.l2_len, l3_buf); > > > + l3_hdr =3D l3_buf; > > > + } else > > > + l3_hdr =3D (char *)eth_hdr + info.l2_len; > > > > > > > Rather than copying whole packet, make the code handle checksum streami= ng. >=20 > Copying is the easiest way to do this. >=20 > The problem of handling checksum streaming is that in the first segment, = l2 and > l3 hdr len is 14 bytes when checksum takes 4 bytes each time. > If the datalen of the first segment is 4 bytes aligned (usual case), for = the second > segment and the following segments, they may need to add a special 2 byte= s > 0x0 at the start. > Also, mbuf is not passed down to process_inner/outer_chksum so the change > will be a lot. Also, rte_ipv4/6_udptcp_cksum can't be directly called. Because it only tak= es ip_hdr and whole packet buffer as input.