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 6741CA0547; Mon, 18 Oct 2021 05:16:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2BAE140041; Mon, 18 Oct 2021 05:16:53 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id F38644003C; Mon, 18 Oct 2021 05:16:50 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10140"; a="208264688" X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="208264688" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2021 20:16:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="593631601" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga004.jf.intel.com with ESMTP; 17 Oct 2021 20:16:49 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx604.amr.corp.intel.com (10.18.126.84) 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 20:16:49 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx608.amr.corp.intel.com (10.18.126.88) 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 20:16:48 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) 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 20:16:48 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.177) by edgegateway.intel.com (192.55.55.68) 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 20:16:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mLjHR5UQp0jzzZJ1UYGJVR0YHGrWWatoQ+zhtVDvizaBXg6QGL+Dph/SeEHhy8N/JV+m+rb8+1EM8zaOAv5uaO3OO4G5LUhjQdMAUMTe8kpt07Ut/xGOB0VBEnkwZ24C5hPj/Gk2QBy2dlnO7Qr+GOvYvogTxKM0hdGBSPq17YK5ZnC2fvfOOXqkDNLw/Zwtc0wWV1uykElE5Zf2G92OWyBqZGTEqMxzvnYQ5PvZWGRw0uaAstcSaLqYFc+4bh22cNPZh1tTeLPY6JZ6LBon1qna/u3iEb+4LDyGHT5tx9NpJ7Vzq/qDiY6gpftQG0r7OtejfVZsEOuOYy5lfqJK9w== 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=RjmLkAP5uMruX1yyBZ7debVrWlN8coLK5hfhIxD0kFw=; b=DtTQrtqgCmcG9rOyizoLlFNZg+Sua37Gl2nMUWki6/hgMxfcQ+UaMOOORr/XIQQv74aBOgxT4TQjsnqbj5CRcdQsn2dR2oj5/vBBl+ebxk6pVgoqMRwB62fuzSiLDZ4p/Djee1wQgNugO48zZ1W/fmmUz6Io3zdEe6pABnl08nkM7gUtpWHbKpYM8MnyOyoRamoLYIawebamkNHY4DyHCyF87gv7qRMZ51n0Kg7M1QWMXhvaMBu19N65shmIvaw1x/qVtnCdV3nVSnCC9mNHBQcxxkoeY2On2iAG+hj6QwrGZW66ecD5RrpG/gm9HQZSR1ndDZ/zaKcBjxmmbablMw== 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=RjmLkAP5uMruX1yyBZ7debVrWlN8coLK5hfhIxD0kFw=; b=Kao8SuuObilOdHgJoMYzTiOETcfRFzZaAPmmnCgX7dKRd8SIg0eVEm+8Ini2DDgweeU983i8rAU6nXwPE+oNYgPcBP4O7g5EZaVUPW5kzgczio1DoJrlE8R/XXyPVYxiC3ofBRQ3247HBNvTB5vIhqvYSBf4L5AzShNiS1j2E1c= Received: from DM4PR11MB5534.namprd11.prod.outlook.com (2603:10b6:5:391::22) by DM5PR11MB1899.namprd11.prod.outlook.com (2603:10b6:3:10b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Mon, 18 Oct 2021 03:16:47 +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 03:16:47 +0000 From: "Li, Xiaoyun" To: 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+VK6BXS6vYFXOAgAACF1A= Date: Mon, 18 Oct 2021 03:16:47 +0000 Message-ID: References: <20211015051306.320328-1-xiaoyun.li@intel.com> <20211017200003.2bfbcf8c@hermes.local> In-Reply-To: <20211017200003.2bfbcf8c@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: networkplumber.org; dkim=none (message not signed) header.d=none;networkplumber.org; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5ed0402e-e26b-4527-b580-08d991e5b87b x-ms-traffictypediagnostic: DM5PR11MB1899: 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: rzGEfY2gPuqaS7Q7i8lnjKV4VTapLMfIXmIXOY/E6fV7H+hdOX1quQhCfiCzQDRJWs6pT+QokSTLR4binYUmbT0B6Z0k2TdKOAG4aFEN3QJDrZepRZF7MZpQO3FB0FUya1ngrae1MUBlK6c9l0RjIEyub4EGc8yPGpEQWDL4bTw137OkCaY/zoijib0/YwIdEeBQuPxYLcI5SKTQVQjm5j0fjDmlQLihzM24PxDlRqaTaKXFbGg6lsva6DK0aG/9VTiS6x/AZeNqb1OBTDozfsjGcqBIZGdWq9nu+xp/KBmFKGOyLUNUJX0+oFti5dvbMjEu3BW2096UfQBiJolK3A6kM8saU5kRDJi+wP8PNK5JMTYkPpZ9z2jBqLfcJnkXnDLsCkNecIeSIKo1aeByqPOnZWr0+3oklEH2/1gma62mg/DQXSJNfkrZ11J1gbJ9RBkliU9p3F0Hsdhot0kQGU4ricn3SNyuoE8ZKjYLgeSJ9tGT3iyeBjgeANQc8QCuxYuheqKy6GncvDEAkiHjPZrzFNhbdEKOAVTfIBgyV+EJtzu6+bBHw2jUhmH4Qp2EDQpS1c1ZKN9es/o74Akk1ab59oeGtLVs/v7ey3e2NOr41Tc7xfbxkToH70PL7mDRdjPnLrxpbROCJ/+kZC+wGrLWYLUx7hG7nqL8EbHY1skKmpFhU7QVSttUP0fas2YlMLepmZieQxCHAL+nBb+rrg== 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)(9686003)(186003)(53546011)(6506007)(71200400001)(55016002)(82960400001)(26005)(508600001)(122000001)(7696005)(5660300002)(86362001)(33656002)(4326008)(66556008)(64756008)(66446008)(38070700005)(66476007)(66946007)(76116006)(83380400001)(52536014)(38100700002)(6916009)(8676002)(316002)(54906003)(2906002)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Jo01AEcLfn1VO2Rv9MNZelATPEAH9RBDk9F0dWMTpWEUY+grm/ixnZO2M9s8?= =?us-ascii?Q?s0IVcUQ9wGJQ7Sj2GSbRsfQDVIY1kSN3XiraNlw/Cf2dBQlfHgAdnC4zUuAH?= =?us-ascii?Q?CQRE3I5LGESafBhP2xuQdY/wVsJdbEgUMRbs1YSP7Te6bBG+7V0eSGE5ev1K?= =?us-ascii?Q?bQnXxujm04CK9YaEILHCZLM9Ao5DdUcyuMKEFc/78Eno634nYjs12f5qZc4S?= =?us-ascii?Q?Hx1/H+fUPhsiU6zsGkJHQJyjOeplTI0h0nglBNx+izZKhSNUyf8N+RYXRXsC?= =?us-ascii?Q?/3+/uEcyrrm5BJoXAdHPnjt6SHSkiG701mzig7u+lZU0E3pkK+CxiKdRlQD4?= =?us-ascii?Q?/63c40ag++rXzv+nimmAAer2u6MMH+GFam6zKFooUeprVAscYFZtm9BXcrRo?= =?us-ascii?Q?blpUjrG+4ZIbgC3jouB06oLfZ7SVdn0rsgLyh+iOyUeHyy8dSKnBvdp85zUg?= =?us-ascii?Q?bhaHJIGI8gl5jcyDFepp3571pyyh1D3aX0jJNROdBUdLYH9quwVjv5IEdunx?= =?us-ascii?Q?fA2PwEkyfUO40lpWpRhDeNRo2ooUoedMFTG27l2L2mXjZmrU327EoXxlsiIj?= =?us-ascii?Q?D87Iyp7Q5HafJYv8CZSq2h4rVfFSeiC4TlY2q/fJRsksnzzmNHbixlCTDKpx?= =?us-ascii?Q?eMwCdUhl/syxIVRkXGqlZTnD3NNr0zeAWnpR2+p+WVdY5nEE+UM6acNHg76w?= =?us-ascii?Q?EMIF4y+2YKVRjdEVpPhoyYSAnVcbpZTzn22OBKDGyjSJ8xss/2tXvc/NP729?= =?us-ascii?Q?qzoCMK+8+4ZDWMion3phzRfzPPsHVV01Mt+saWEHnuRc5LjCHpmrUl4z7lrR?= =?us-ascii?Q?I5nBt6tyX3/BAgK4NFKhuiWMPJyl18R+JLKQIp4cu+JVaMhx97AI+0eNs5FP?= =?us-ascii?Q?482oB6vkPrhyzUbnw4LWXpg+iJyebAoDNKLpPhSn30efZKjp5u1xbnqKWlpp?= =?us-ascii?Q?Mb6tGrmwxWVvRnfu5Mta8GzNko9472Vf5OXU9eFjK9Ee4U+sLdzBpVsyjhVG?= =?us-ascii?Q?GKy3K/h84eN8ncgl1gk2uI8kCu/6ZljawX+XnTi6keDeUaJ+HImWauB8C+ig?= =?us-ascii?Q?p0AdET+MR8rMa6ubdmgBHojsVbLZbkXu1pTjY7Q4se6Bsv7lsXVZn7FrJO1R?= =?us-ascii?Q?P6/OELiWPQuPmUVUOf54M+LqfG4V1PrEUNrPa4ryHCzmjVom6GsLar05hCWX?= =?us-ascii?Q?TqeOvASOnltIv99PxujhB8W1G0pg+cI+5SYiZe2EJ97gzD1dp1oYnOf2qXYW?= =?us-ascii?Q?zMRghgjGx9iIZwo9AEQLYERtRlrdTuKbzEWP9flCC1COy2u0vaThvRGsCMkT?= =?us-ascii?Q?jsXcZJhcHOIlcTDD8zhgxqLZ?= 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: 5ed0402e-e26b-4527-b580-08d991e5b87b X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Oct 2021 03:16:47.7164 (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: ccuxb/S6writa+DlmvSnBZknQpTO5qhTaF6DZLvp4KlmkeytU4eExOLoLRlg8iV9JnjyCFbaWNngYreY3k4G8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1899 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" Hi > -----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 >=20 > On Fri, 15 Oct 2021 13:13:06 +0800 > Xiaoyun Li wrote: >=20 > > + /* 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; > > >=20 > Rather than copying whole packet, make the code handle checksum streaming= . Copying is the easiest way to do this. 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 th= e second segment and the following segments, they may need to add a special= 2 bytes 0x0 at the start. Also, mbuf is not passed down to process_inner/outer_chksum so the change w= ill be a lot.