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 D6C4CA0C43; Mon, 18 Oct 2021 12:16:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F8C840DDE; Mon, 18 Oct 2021 12:16:15 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id E8D164003C; Mon, 18 Oct 2021 12:16:12 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10140"; a="225676781" X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="225676781" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2021 03:15:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="719320610" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga005.fm.intel.com with ESMTP; 18 Oct 2021 03:15:51 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.2242.12; Mon, 18 Oct 2021 03:15:50 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 18 Oct 2021 03:15:50 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.104) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 18 Oct 2021 03:15:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DZU6h3fXKt3R3nL5YHxK+KmcJjQxigGSgHEIc4CfmZz1LBebfsTDX7MKngLPusR7C3dAXYgSfntRrK/DCEt06+86OTYjorb2HFXUN3tQBpu9ZbGsoU5MJq5pTNepl45HZ7rZeW2fUMzVW50xrETqqIe1KNUdceP4D+G92Gy/L2/xEIscU7ZRsH7R1satcWm6zoH2jE3oYO2aBuLPmO4KL+XNRQTxBfctLoT5q2jdnufXFHLdeKUJtAQqTvZqladB3RC+w9cw0p7k8T6LEGTqzHHmE6DmMGI4JYE8aiU9T3+0vSsDwjpRMkRicZXKDvGjIwraV2u5vlI7GKs7JG4bsw== 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=kLjD18ij5e3MZk29Rs8Wg+3rGd9nmDs+C7xVZ52yLso=; b=Zl14jUlMxS9oXMAqW1sQz3rJTWCv0izwsfrK2bkfPGdvy3Dhpe3bvhrhYdWJ7zV80b7IMMOiAvmcIOcVs/uByXHEw2Qgn7j2hlgkhQyAafq/gljKflWT0Fkh03sygtEVa4SlzkKaeUO9gCe6MN6XHW34aen7/W98bdzWVCYFQalIWrK5bywC+jKVBIMT9tHtMss+nmrYseC9jkgQvd1px0kwfBzp28M57sE4FewvapZCUpE3N6r/XousjPvExKPiLWfmd438dCI+1YeQH98V2moTCIerkSM4mQfYsg52WQI0OAeeoZ7o1pf+w6X8TnccKeT1nIto/yG9eyU8S8lZ+A== 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=kLjD18ij5e3MZk29Rs8Wg+3rGd9nmDs+C7xVZ52yLso=; b=LV7sdzT9bihoNsop48892N/aX1vXNw6+kawQ0OybRkcLRQ4pMdBEtWZpGAqnLOeYyCL1x402xay60xqrzxwEt2tyYkJlwr4LDaJ6mjZAr+4CJlzNSknUBbtdEB68juyZmJ3Fz8hHpI9ZXKCKy7/vJJPKKFfvhjW+J87wLRJRO94= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3132.namprd11.prod.outlook.com (2603:10b6:5:69::24) 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 10:15:43 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd%4]) with mapi id 15.20.4608.018; Mon, 18 Oct 2021 10:15:43 +0000 From: "Ananyev, Konstantin" 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: AQHXwYVraz1h6Ttxr0asJZu1ifKUo6vYFXOAgAAErYCAAG7A4A== Date: Mon, 18 Oct 2021 10:15:42 +0000 Message-ID: References: <20211015051306.320328-1-xiaoyun.li@intel.com> <20211017200003.2bfbcf8c@hermes.local> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 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: 7b81b80a-11ef-46e9-fa87-08d992203e4a x-ms-traffictypediagnostic: DM6PR11MB3132: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cWnSCvl8gouCeVhUe5SqK+FhbGXMIGvm6NQZ62v1S43cb30MvhFkdqSk+MLa27XG4i2Ge3z60rzcDlqU/ZNHIxi2I2bH/l+5OsA4l2lIB3ZdsprN/ihSLIw7EdtLoHr26VG+GfmX1ITrL+zx0wslMia4A5x7xyg5fMKjH7c3uus1J9LIcnsFpPNzNBI3z2LG9z/obG0bmijbVG9tJDBUKeZekiiMkF31QOjarDxNFmDLOfAnifFJv6789BnZqNUREWPq41F6mF5QEgCWCURk0gI6huHFKOeFUw1p70yLVX0DyIfhpWqAqT2nGcAAs9sY1bp8d6BKY5UVhGo2DK5PmJb4KAPt6t1ctYXSliZ7e6AyFm1B/GEaB8DctBJSqnuW93Cm81Noar0kMD2N8+PyD+53vpoESNpZ3340x0RvXVIbgxgjK/22YF5X7EBPmKm1v1L9tM+genIwV490mCHzv6sqwxr+Cm+PBSD6HI/9c1N02E1si2LL/P5+IaAtrozsPku1La6p44Zo5vntMyVFyi0KrlO1augc/4h9u+gr/018zDSE1F7vrTfSwHV5IWzX/bawNyW6yCb56UDx4y9PRmtI+JmGFMXJrafeDiWI4ZlmQsEamh4o+aEHHQ7nH+Rfh+Q4RdFR6HMPO/P3/aJ//oDvRqukHJSEpKlI+K4fPUotbtu/Fbp/Mv0YhPL6dMz2xVF5oSR51dukp/XhV0SA0g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(9686003)(122000001)(8676002)(66446008)(66476007)(66556008)(2906002)(55016002)(66946007)(4326008)(38100700002)(6506007)(71200400001)(316002)(52536014)(64756008)(8936002)(86362001)(82960400001)(76116006)(5660300002)(54906003)(508600001)(186003)(7696005)(33656002)(38070700005)(26005)(55236004)(110136005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ypLpBi/GM9+tHoyq1JuA9HLQoo3pjD2mnoOhtoW1GAR2Yt9oqSIIgkFCcPua?= =?us-ascii?Q?mytYch+T3TUYl5ZgxCkMhhLkyNI0yBHq9t3z6jSI43CGfDXfDq7o134sziVS?= =?us-ascii?Q?ofoR4OrphSdjq9L/rXxIpmf5Rco0NtQJ1lz1AegbSuTEmSQuwSsH9mWRaVv2?= =?us-ascii?Q?caAmoBVsLabRgTy02h7ceQHZee3Xx9kNe97ZkqwZ0F+wg/CcqQZmPnku6ojP?= =?us-ascii?Q?xgcpjWVyp3C0YPeF+Dwv0ITpjPPnrgoTmmAaZTFQE3owc7WrqmgSUOsEm0Te?= =?us-ascii?Q?ziz0pe4WI5HwHnw2u4uXMoANh/7iIYCFde/EI9pJ5Zc0oYyTeFE5wT/ruMdJ?= =?us-ascii?Q?WuEJbWXCAuhZtFkJkLkT7CFFizdxF8SfCHrUaa7IfCTY/3oAz2fvKdQChGI1?= =?us-ascii?Q?0jTTO3t7nAleYM45Shy62DCydyNARrCmJAT9K9f4LRxlULr9lssV4WwxsAwK?= =?us-ascii?Q?ibNwcLBi6iUhZ2rDst/LFF/k3svOkFidHo32Ai97hAGDH8//dgTPPEf588C+?= =?us-ascii?Q?eJZQAo1K7xmUN8MZAq6xqD26jh+m/VhC+s/7pP5JPROmeDb0Q0NTI0Gn48bO?= =?us-ascii?Q?9osHMrrk2PO2DJfRxFPDbZzZMu760OnHM6UVRCaDNcolR3afHjjacGpWzhpx?= =?us-ascii?Q?+b+T7jzrExxFGCfQJm7TRlI08oDBlgg51orvidYosnl97A/t5nw7bobTMot8?= =?us-ascii?Q?sva9cQgOEP6QwUokhYbiKgau329MkCGnsWwCVIvbH9TISgEwj8A3LHSWA1yP?= =?us-ascii?Q?el4Spdvy3ovpmtnBifZE+kFLcjiWJvjM9leA+VTGeeDLlBhbec72Z8siOk2t?= =?us-ascii?Q?vVp0C5RvZlk0XEYvHcqWXM902AHwZNvbsTYH0/caBcYujr+J+HgpmsZulrUe?= =?us-ascii?Q?K4Lk7sbDr7KiPy4Niy4R+FGy6MmztEx3yfqMxIoKH1LwHkeGHbCB9baeOCCc?= =?us-ascii?Q?pdlBKnY02GhZ+SrtKdiVVzwvw7cvxi1w3ecxvRf2OeQaz4dKdcTRkcYdsssJ?= =?us-ascii?Q?1WdgiGOE5DbT8jKTmBUR0Eb71nffkoHDbKumk9IjFTXh/P2lEbwjnQ0qAjkD?= =?us-ascii?Q?f+kfIAo9MYFliLzRUTAp/L7wa8tj++4qEqZr0I4DHrptEg1zEVSs3Xvqefel?= =?us-ascii?Q?q7iWAZ9Z9yljc+yNUs5nv+NgglHYB+lgrvoqE3h+ltdHJUAEKsoXHYFP7fXo?= =?us-ascii?Q?O0TfV7g12PpMDgTr8kxQYsT5XMzgZqED3rsgXQSgj8AMA1v+gpBeIfa44ACA?= =?us-ascii?Q?sueUpZzRzDnPUQZdhL++m9x5Y9IlIpYW6KgYUjjifKpIzUvpvFV2JQVhafmi?= =?us-ascii?Q?oiTw6y3BFXo6BfNMHiP/ZrL3?= 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: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b81b80a-11ef-46e9-fa87-08d992203e4a X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Oct 2021 10:15:42.9676 (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: mboDfpI2UiGZ+mfQ/Mzqb6YsPhILnwVD/y7Nr6qtvh8pQrLp0VLg/vAkig60N1MAL/q3LX7yTaOIGGYmBTe9BicNZfZIs/bp49OlaYc0SlU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3132 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" > > > + /* 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 bytes 0x0 at the start. Didn't understand that one... Why you suddenly need to pad non-first segments with zeroes? Why simply rte_raw_cksum() can't be used for multi-seg case? > Also, mbuf is not passed down to process_inner/outer_chksum so the change= will be a lot. I also think that copying whole packet just to calculate a checksum - way t= oo much overhead.=20