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 2AC5C45B8D; Mon, 21 Oct 2024 04:01:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB27C4028C; Mon, 21 Oct 2024 04:01:01 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2090.outbound.protection.outlook.com [40.107.237.90]) by mails.dpdk.org (Postfix) with ESMTP id 0CBFD4027C for ; Mon, 21 Oct 2024 04:01:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vAsmgjo5mUx+q7vwGpNkif0gV8qHOCx7z61rzLGDeW7DIcA/U/YS8EgpzEHDjT9o7+mjjCvEjPSd3iVrDL7M5Igflsfhve1xFkSU2kBWCWXD+iJkbV4A+f+FmYaJYAhUWLSckHrJlRDy7wa8cDJI5EOqUju7DgWgAXtEKl5ZlZ+IBThnYFjFz40onbwjOmuonYnxdj7AHjYXY9U3Vz8nBk4cDKUqWtAwWhxgIYAi74L27JFwPUKvPAwaRuDuHLgtbCWRnZ67ybaTytN0SzpdZEMd3Zw/Bs1z5ghQkcMwLPwktFvW0T/opdE5FhKQaalFhqXy3FB6vxwWMPfqdK/GIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=3QVkLMD0D+Cv6bleHb3DXXgjXCJJgOmn3bHHB5tNXVg=; b=TDFOBgYYbga0RcnMhdjZtqu6+rsA3rboCQD3CA0XEgsTGyerPkH3gfjEElpkTWU+PNEuGJMvb1kOjEoqphMC0i/cNMdgZXlTvCP3coXZi89rC82BnyNUAvpeSFepTsutSbpw2JNN3UpeiVLvGriu0xRUlEFrIXuIdrH6y2X9BT0nl22hbF8HdOYV0i9nVbQF0jKuM14M1LgwrpqxhZk/d9wHynez7F5jqHWCTyG952F4NQinc5khc7nJPuLLuYotTlc+gWXp9JhPV5nHcTVvPOZLUzD69W6Q7e+LO+UUN1zx9APrb2IOCDNIKyVhAAKlSVDL1mpPFaOZx2F59t9uvw== 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=3QVkLMD0D+Cv6bleHb3DXXgjXCJJgOmn3bHHB5tNXVg=; b=blllmZN0n8HTPsJkGg0wyQ0eekpLljINUs1AAL8qJIlJVFrRsC8CWYtzvHu0VJ4sVx208dPL98qlw6sAMCugcIUQanul6PfKUDKfPp8V0ubZBH6E9PB9+g51KcggjjAe/pk7BENW3OwE0RC002gZKS9r6SnCfe6Atl+d0x3ldWU= Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by LV8PR13MB6811.namprd13.prod.outlook.com (2603:10b6:408:228::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Mon, 21 Oct 2024 02:00:56 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8069.024; Mon, 21 Oct 2024 02:00:55 +0000 From: Chaoyong He To: Stephen Hemminger CC: "dev@dpdk.org" , oss-drivers , Long Wu , =?iso-8859-1?Q?Morten_Br=F8rup?= Subject: RE: [PATCH v2] examples/l3fwd: support setting the data size of mbuf Thread-Topic: [PATCH v2] examples/l3fwd: support setting the data size of mbuf Thread-Index: AQHbIQd52lQtZqBPsE2dGb2c3tRw+7KL0WAAgAADXsCAAAiaAIAAIxvAgACqzoCAA8iFkA== Date: Mon, 21 Oct 2024 02:00:55 +0000 Message-ID: References: <20241016082232.4005800-1-chaoyong.he@corigine.com> <20241018024253.4075609-1-chaoyong.he@corigine.com> <20241017195916.656dacc6@hermes.local> <20241017204206.2dc20546@hermes.local> <20241018085905.1e610ebf@hermes.local> In-Reply-To: <20241018085905.1e610ebf@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR13MB5545:EE_|LV8PR13MB6811:EE_ x-ms-office365-filtering-correlation-id: d06db5f9-37d8-4c52-82dc-08dcf1743311 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|366016|1800799024|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?9jRYJpv6JuerrXtCuYc350oi8ke15lpj5b2gmYqNwruxxIS+73lVP0CTlG?= =?iso-8859-1?Q?MkITzyQ3Zfoj4mroU9eadmxSTuqbtUmyMpP9LixWrJrF5Pk6/ejZU3zHlK?= =?iso-8859-1?Q?u80j77RyYfdyrbXT6iGEkHWrlgFESWgVxJQa9tkGyJBgpGAunNDtvyw/a+?= =?iso-8859-1?Q?Bl6J+M7NZdv6mTSetvEzJo4qYVNkQd7t0UlwsvQTS6UnqUqdnDoIRZW3WQ?= =?iso-8859-1?Q?zJhXMiCpja1j/rtglRWMrJPIFZ3keyak9Pp43hIvluXM8ytOWPUuzRemIy?= =?iso-8859-1?Q?is3+hz24GVqnr9dtWS1wMkIF85Nxq8J5tBOfYJX5q3n4UbY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H10QD/O/MDz6ksbwTrLb8SBwTEX275eF3nBJX?= =?iso-8859-1?Q?O9wAWDRLhdHFQPVh/m8VjMVIudyQ2j9liYibt5cRoHCZnrys0bOQ+Rry9t?= =?iso-8859-1?Q?dfnLcy22wW4IO0W0cPwZm7Sw8VCiK7u3uFo43NYCEZWzN6bXIdmOmH8ArC?= =?iso-8859-1?Q?dsc46ke0799XOBeNRnjowJdQ8pZI0uPQhDFGw2iFbofTyx42fc2wI=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?jMFTiMX1ck/2/CeDjlt/TMXD4CSk12BRBYfxE+NO9kfeIEKevg+a/JZpuE?= =?iso-8859-1?Q?kZ5afOdUFq9MbLMYYPfYo1IW//EcgIa8ixodxWDVuZU7WDEcv1G8v0PbFx?= =?iso-8859-1?Q?bBmaz18oEbh35/+kzAecmlg1tZditVVF3L0IfJge4vg6Qg/B3NDklfBmFP?= =?iso-8859-1?Q?7PfXrrBdyYpeYiVhZ8FHgzIpAnTiq8o2PF4JQ5qvFuuFYNTIrXHkUUYudm?= =?iso-8859-1?Q?za9gggXFxso/rO2pWhl/SqBBaZX2KV6qMewbYeHaVz7x0TUzUuB7aHqc7D?= =?iso-8859-1?Q?x0mbg3vINzumw8bR8XEB57pWVG/yQkBMUNB3qbHh0yYse0auqgT7JPffyd?= =?iso-8859-1?Q?Y5KCtqb6rwEhe0y4HqzeX1Eh2+4Z6+/SZgjn6Pxyl46iJ+gV9mSoWZ4ftv?= =?iso-8859-1?Q?Nw3T0cDec+2UpM/sTNkr6SDydTUv+Lb/zw1oNLfv7MceGkpDaZmTR6d08s?= =?iso-8859-1?Q?hT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+7+/5eWHyVyCS9R?= =?iso-8859-1?Q?1DCXb7HlyWxqOOqsaCMdHHdexRnAH6KWHl4+tzmbjzqSL5IASJjybOwZr2?= =?iso-8859-1?Q?WLAOGAb91uNwoeowpBOIOJoVlpngzkypFLQH9akXO1a/v9+MaUqoPvzP5M?= =?iso-8859-1?Q?WAKIevsmEGzjEHdbccRayAbOY8/D4hfQ7yYwIXY0o9rdRBUWo4IGpDpyBA?= =?iso-8859-1?Q?zku73mw4sU5kPGUPYfM86xn7ha63yhUEgdZg8Dbl/1s4rc+1I0OkIAMikB?= =?iso-8859-1?Q?/d7vTtQ5tgStySb8u2LkzpRdPKdaROgb8q?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d06db5f9-37d8-4c52-82dc-08dcf1743311 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Oct 2024 02:00:55.4788 (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: fpTzuzF/v92jCBQxESsH3PeQW1lXfgdFnxcv9y7pLZIKrcMh0W3aza333Vk6YVnhVqcw4/2mnN+7gw4rJ02tKkidStthl7YGUmiJWCVFl6s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR13MB6811 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 Fri, 18 Oct 2024 05:50:20 +0000 > Chaoyong He wrote: >=20 > > > On Fri, 18 Oct 2024 03:21:28 +0000 > > > Chaoyong He wrote: > > > > > > > > RTE_PKTMBUF_HEADROOM); } > > > > > > + > > > > > > > > > > Not sure why this is needed? What is the problem with the origina= l > code? > > > > > Are you trying to force packets to be segmented? > > > > > > > > Actually, we are trying to force packets *not* segmented by making > > > > the > > > mbuf size large enough to hold the packets. > > > > > > > > In our user case, we start l3fwd app with parameter '--max-pkt-len > > > > 4000', > > > and obviously the original logic with RTE_MBUF_DEFAULT_DATAROOM > mbuf > > > size will cause the packets to be segmented. > > > > Which is not what we want, so we add this new '--mbuf-size=3D4096' > > > parameter, the mbuf size will large enough to hold even the largest p= acket. > > > > > > > > Do you think this make sense? > > > > > > Maybe query the driver, and use the max_rx_pkt_len as input to > > > deciding the right mbuf size. > > > > Sorry, I am not quite understanding here. > > I can't find 'max_rx_pkt_len' in l3fwd app, instead it's exist testpmd = app. > > Could you please explain a little more about the advice? >=20 > In rte_eth_dev_info, I meant the field max_rx_bufsize and there is also > max_rx_pktlen. >=20 > > > > > If max-pkt-len was 4000 and driver can only take 2K buffers, then > > > use 2K mbuf size. > > > If max-pkt-len was 1500 then use mtu + headroom and round up Oh, I understand what you mean now, thanks for the clarification. But the solution you suppose is not flexible enough, thus can't satisfy our= needs. Follow your example and consider this situation: If max-pkt-len was 4000 and driver can only take 2K buffers, then use 2K mbuf size. But we want to measure the performance when the mbuf size is 1024 and 512. Then there is no way to do this in your solution, I suppose? But with our '--mbuf-size' parameter, we can easily do that. Thanks for your hint, we realized our solution also has a little problem, w= hich not=20 consider the 'max_rx_bufsize' of rte_eth_dev_info, and we will fix that in = the next version patch.