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 4249EA0C47; Tue, 12 Oct 2021 11:43:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BFBF040E0F; Tue, 12 Oct 2021 11:42:59 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 0F1B44067C for ; Tue, 12 Oct 2021 11:42:57 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10134"; a="227379999" X-IronPort-AV: E=Sophos;i="5.85,367,1624345200"; d="scan'208";a="227379999" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2021 02:42:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,367,1624345200"; d="scan'208";a="441799899" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga003.jf.intel.com with ESMTP; 12 Oct 2021 02:42:37 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 12 Oct 2021 02:42:36 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) 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; Tue, 12 Oct 2021 02:42:36 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 12 Oct 2021 02:42:36 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.48) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 12 Oct 2021 02:42:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OXQ85DcA3Iu8OCynPMtp5N+miciXj3WW7Ec0xJ1qc47An1PCCAEA4IjBvlffijBnqXzl53t2LZj34c3+KGlTCGM6K/EjFC95SyqQfn0huWBcTzuI9vNveNbVySLjOlz04csOSfr/W3VaE4hC9oPRBLWKLyO3BHog5Vz59t8F6gmiiCYFt1Fxiug7e1omHhvwVx4BImGzc3C8fLy/Fxbl/F5pFZ2TMw3bR9m0676Hei2Zgd2fEaWfO84o4nCy7yYaBfnQALL/bcXgY5DC094t/Hp8YxzOdzZo1GmG+3Oq47A+oHSGKfUsgIVF91+kOuMGIQiknObKWC9MdELbc0tdEA== 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=myMGdhk7PP09u23nejjET2SDjH8bgZisDuJnJsfRPgM=; b=P9XPJwb+yodCPcYI4/aNbcOvQ8j/xO8ywnGlnzH1dHwKgC9Smpc6Poe5sir3fdUw9DT/C+ImnzxpCGuxKvXmH9drW/C9yI50jtiN71t22y8d7fE0mg4jo3aPxseGNzr/eHE7tEAqBRPqbnOQxIsgTVt6OPbsnUL2aDV2mJGroL3nUDloeCyhADqGj+hn8yzAIu00/1PnmqsYmbg/8dd+KaztpP9zNQIJx/3S186nEJb9ivQ4J5ObLK0LL+3MpyamwN3eucaG2JVj9T8DPOrJLmESqj1nxj20sqwgfltb2JewrLU6R5CEXJnRfeied743zt02XIppDlk+xS8XQoFzdg== 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=myMGdhk7PP09u23nejjET2SDjH8bgZisDuJnJsfRPgM=; b=AAjX6/E/rNYZBXQ83Zdfaa6V8MRVk3Mh9dBbMIZ5FpRUq+QLqJYB7vAz/mrgKks3IpVM5uxJMyiknY9A8vH6hDQJGEPgTyb4NGOaV34ZIXNkqVo3eLtToc6rJj9GfcTKwk8Vz3AtlykmDFZQ5GezyCqVipzJjf8Bi2O5BNiZvv4= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB2633.namprd11.prod.outlook.com (2603:10b6:5:c0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Tue, 12 Oct 2021 09:42:33 +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.4587.026; Tue, 12 Oct 2021 09:42:33 +0000 From: "Ananyev, Konstantin" To: "Yigit, Ferruh" , Jerin Jacob , "Li, Xiaoyun" , Chas Williams , "Min Hu (Connor)" , Hemant Agrawal , Sachin Saxena , "Zhang, Qi Z" , "Wang, Xiao W" , "Matan Azrad" , Viacheslav Ovsiienko , Harman Kalra , Maciej Czekaj , "Ray Kinsella" , "Iremonger, Bernard" , Kiran Kumar K , Nithin Dabilpuram , "Hunt, David" , "Mcnamara, John" , "Richardson, Bruce" , Igor Russkikh , Steven Webster , "Peters, Matt" , Somalapuram Amaranath , Rasesh Mody , Shahed Shaikh , Ajit Khaparde , "Somnath Kotur" , Sunil Kumar Kori , Satha Rao , Rahul Lakkireddy , "Wang, Haiyue" , Marcin Wojtas , Michal Krawczyk , "Shai Brandes" , Evgeny Schemeilin , "Igor Chauskin" , Gagandeep Singh , "Daley, John" , Hyong Youb Kim , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , Yisen Zhuang , Lijun Ou , "Xing, Beilei" , "Wu, Jingjing" , "Yang, Qiming" , Andrew Boyer , "Xu, Rosen" , Shijith Thotton , Srisivasubramanian Srinivasan , Zyta Szpak , Liron Himi , Heinrich Kuhn , Devendra Singh Rawat , Andrew Rybchenko , "Wiles, Keith" , Jiawen Wu , Jian Wang , Maxime Coquelin , "Xia, Chenbo" , "Chautru, Nicolas" , "Van Haaren, Harry" , "Dumitrescu, Cristian" , "Nicolau, Radu" , Akhil Goyal , "Kantecki, Tomasz" , "Doherty, Declan" , Pavan Nikhilesh , "Rybalchenko, Kirill" , "Singh, Jasvinder" , Thomas Monjalon CC: "dev@dpdk.org" , Huisong Li Thread-Topic: [PATCH v6 1/6] ethdev: fix max Rx packet length Thread-Index: AQHXvvtQJPiRzLchXkesf1V04vZ7PKvPHFEg Date: Tue, 12 Oct 2021 09:42:33 +0000 Message-ID: References: <20211001143624.3744505-1-ferruh.yigit@intel.com> <20211011235345.851742-1-ferruh.yigit@intel.com> In-Reply-To: <20211011235345.851742-1-ferruh.yigit@intel.com> 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: 9e99754c-df91-45d1-5cbd-08d98d649df0 x-ms-traffictypediagnostic: DM6PR11MB2633: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3173; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8diaxcxBqScoOlLrcuqJALOCXRFEu1q/onIIuPksRzyqZA6LUPTZIo0MRl2e3/AetmkxhFFJ1x3DCYIIjzjFCCrlG312s7fvUEZ19ktvtDRshSfoQdaJ+xFxsnIrjbs6o8LK+Fxp8KQpiB3dh17LvJSqN7+Pr+/kgH6gS7KJlI8nsgjOp5UIrEJxIEyKt2otzoOq1Suicg/C+tBBlaq54VR2n+421BGohA/ntFZimoAZVHUZgUK+/wd97jR2JwXew9kd4JD7SotUANQBv4sbPkQh8ZbjNYF2mdPYWBJcnQQy5cZIw6PBOzIYca0o4aXhqbXwBjwLw87dqLlXY/EenXcXPsXNutLFxDTcakjCO6pAfw7RQiIeP5I5CiS3j07BtIneQqXigqkG3aOJWgoBSRFZZFPpu+rDN5kjV0l5aelD6LMw55ec/fz+EgQBji8vclPjO/npqsRB7IoKKpCRNapbYqWBFB6sD+BZQq4XnENNQvPQTCgU76zBUyw+S3PwSF8AR8BZxPIjchoiABpovZ6N4I9a60f/CdFqGoO2RE5cOhx4gxLHA6iAXCSZsMl/rO82VjZYyZ7XbG4xXD+QdKub8/m/Xc0dShI2qESzJdrmq+FkYtwyi8/oc35WjOFuM20jHJ5OXS3CH+HIUUYN+CG/cnH+O4jFjFOhgy2sK6AeQJ1R3amv7hGo3Dgy4bFy9iicyodiYE4ogFgXsOND1i+TmFnTNBBS3OGiLU+zGTo= 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:(4636009)(366004)(33656002)(2906002)(83380400001)(86362001)(921005)(38100700002)(122000001)(71200400001)(76116006)(508600001)(4326008)(9686003)(6506007)(66946007)(7366002)(1191002)(7406005)(55236004)(186003)(26005)(8936002)(8676002)(110136005)(5660300002)(54906003)(52536014)(38070700005)(66446008)(66556008)(64756008)(55016002)(66476007)(316002)(7696005)(7416002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?OsSZUSK8918U7Uezpm0RsecpCDeQMozg4+ZPKodgH8waEyuOLIBXHsrHKL7w?= =?us-ascii?Q?eSCo9Qfc8jayVIYXwsqnS8P9rg/MedJGc9o2eZpj0PRRn1hjC2nwev0Ej8mB?= =?us-ascii?Q?PoR607p4dDlG+RbcPfAKRBbdB98c5av7dEeQSS9NTT8dY726kjtAtzD4iVHi?= =?us-ascii?Q?cmhiQh0gpgcqH/kK9NtSbkjzweSLYOV+SzQgVlLzaKMqcYxof7CiQFEs6ca3?= =?us-ascii?Q?UDHEyYQRmnHc/h5nBCmFhJ6bKRtcIJX4/R50jK9vom0SJtJXXxvkz34zNVuy?= =?us-ascii?Q?iQtnzfMJ38GbeSuLPElMQo+9UbikpRN92veyBgDut077Z3SosOhuIj3UxWoF?= =?us-ascii?Q?4EpUycKMGmiyWMnlGXiFORSEFouj2g0QNtsuAE5i4dfbFfe5SQXQYMx0dseA?= =?us-ascii?Q?sA8Xjj6z0tBaAMX4oc8PRlKW1imKQWH/rFMjpoaDlhBpyDbTJQdX8ujZ8sVL?= =?us-ascii?Q?zl42Muh4yYsBjEkucCIYpOZc/sXV08LUXIWRHp2qUERqIaEoeVtnd/MyFdgX?= =?us-ascii?Q?+wtqXLPqoUPSkqpQoDPgFLZc+RWLbUPbOAI5dddxbk0yTsrbmYl65I77KfHX?= =?us-ascii?Q?Ce3/CtObnKltFnvZkOlvfQTX9QplhG+TiCux69m3ydkNEKsE/RPH1nG1IEFD?= =?us-ascii?Q?Y+2kgvZfpD9xfS3ka3bfCdlCJJ7lhUBBtVLFPcSMYtUE5Z/KFK0itpLVX9ml?= =?us-ascii?Q?Av2P6UkTbH3ahVJsgAavMOtcyquDIPSMBm2MHoOY0/Ie9IARLdNsZAQVtE6X?= =?us-ascii?Q?v0JONXkBosWrnEbP4W4MLduaZG27iTFKelBhLWBim1gDXIuV6eooOyEHP6nB?= =?us-ascii?Q?/NlpHUUyLWy1FTHFCrpJiRv2/anxTEeuAF7/jkRsrPAkZVJVEEmJly+UEe4+?= =?us-ascii?Q?HKsH5htglT2SRBCc+eesNMeBX/NpAeQ08Kfni6TQgX3zmWzVJfrM+zl8Ww6o?= =?us-ascii?Q?+2nKxnTrJNeDnJQS4NJH/mZv4Nbi+0aemePTEdqpH1vwCksxGo/CmTuRwzX1?= =?us-ascii?Q?4K79zsFp9fxnJwQIrU5fCRl6qE+rkz5pt8mk9+XA2vjMpTzMkuhfOqEmeys7?= =?us-ascii?Q?rCiqo8SjERbI4FQA02j4WKa1umO7q9sU1EPuukCCAK5M+4t8TLn+sAskYYvL?= =?us-ascii?Q?yi8GF3Wl2PlK6AwFaf1uN1gNffYpy63N4aW9oLCfM52AR8J2DaglZGuWDOkl?= =?us-ascii?Q?c7AaNvWXhvgMh6Ew1XrHtge0Da93OmOxN+3hf7IRsiSYE2ED0rIh5RayVe6o?= =?us-ascii?Q?UfKcIy1eXtzm7gNuaJPOvQvquL3dIpaplAFlmdytcpPPM+/MwZOZMKIO33bx?= =?us-ascii?Q?/qBmwSOUKZNTFfBOuPxjm8T5?= 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: 9e99754c-df91-45d1-5cbd-08d98d649df0 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2021 09:42:33.2958 (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: HF14L5IJ4kNtUmSPiDQmO9L3hZ4WdUkZtIwDZqG4mjfjb+lajKqeylJtiQMEL7G4eN2Y7U58Aqr0SIjCMbtS50+gBF5373eak6LmGHMmooY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2633 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v6 1/6] ethdev: fix max Rx packet length 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" >=20 > There is a confusion on setting max Rx packet length, this patch aims to > clarify it. >=20 > 'rte_eth_dev_configure()' API accepts max Rx packet size via > 'uint32_t max_rx_pkt_len' field of the config struct 'struct > rte_eth_conf'. >=20 > Also 'rte_eth_dev_set_mtu()' API can be used to set the MTU, and result > stored into '(struct rte_eth_dev)->data->mtu'. >=20 > These two APIs are related but they work in a disconnected way, they > store the set values in different variables which makes hard to figure > out which one to use, also having two different method for a related > functionality is confusing for the users. >=20 > Other issues causing confusion is: > * maximum transmission unit (MTU) is payload of the Ethernet frame. And > 'max_rx_pkt_len' is the size of the Ethernet frame. Difference is > Ethernet frame overhead, and this overhead may be different from > device to device based on what device supports, like VLAN and QinQ. > * 'max_rx_pkt_len' is only valid when application requested jumbo frame, > which adds additional confusion and some APIs and PMDs already > discards this documented behavior. > * For the jumbo frame enabled case, 'max_rx_pkt_len' is an mandatory > field, this adds configuration complexity for application. >=20 > As solution, both APIs gets MTU as parameter, and both saves the result > in same variable '(struct rte_eth_dev)->data->mtu'. For this > 'max_rx_pkt_len' updated as 'mtu', and it is always valid independent > from jumbo frame. >=20 > For 'rte_eth_dev_configure()', 'dev->data->dev_conf.rxmode.mtu' is user > request and it should be used only within configure function and result > should be stored to '(struct rte_eth_dev)->data->mtu'. After that point > both application and PMD uses MTU from this variable. >=20 > When application doesn't provide an MTU during 'rte_eth_dev_configure()' > default 'RTE_ETHER_MTU' value is used. >=20 > Additional clarification done on scattered Rx configuration, in > relation to MTU and Rx buffer size. > MTU is used to configure the device for physical Rx/Tx size limitation, > Rx buffer is where to store Rx packets, many PMDs use mbuf data buffer > size as Rx buffer size. > PMDs compare MTU against Rx buffer size to decide enabling scattered Rx > or not. If scattered Rx is not supported by device, MTU bigger than Rx > buffer size should fail. >=20 > Signed-off-by: Ferruh Yigit > Acked-by: Ajit Khaparde > Acked-by: Somnath Kotur > Acked-by: Huisong Li > --- > Cc: Min Hu (Connor) >=20 > v2: > * Converted to explicit checks for zero/non-zero > * fixed hns3 checks > * fixed some sample app rxmode.mtu value > * fixed some sample app max-pkt-len argument and updated doc for it >=20 > v3: > * rebased >=20 > v4: > * fix typos in commit logs >=20 > v5: > * fix testpmd '--max-pkt-len=3D###' parameter for DTS jumbo frame test >=20 > v6: > * uint32_t type used in 'eth_dev_get_overhead_len()' helper function > --- Acked-by: Konstantin Ananyev > -- > 2.31.1