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 2990AA0C4D; Wed, 13 Oct 2021 09:08:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B5C7D40150; Wed, 13 Oct 2021 09:08:32 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 4C2B840142 for ; Wed, 13 Oct 2021 09:08:30 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10135"; a="208166417" X-IronPort-AV: E=Sophos;i="5.85,369,1624345200"; d="scan'208";a="208166417" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2021 00:08:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,369,1624345200"; d="scan'208";a="526892512" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga008.fm.intel.com with ESMTP; 13 Oct 2021 00:08:29 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) 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; Wed, 13 Oct 2021 00:08:28 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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; Wed, 13 Oct 2021 00:08:28 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.104) 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; Wed, 13 Oct 2021 00:08:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MbZQhs+fR2JKFxgRGtE2Gb2iySPedbaeIrOGKBE5svwua/BokEw8Efk9YY3ewgvAXgJX87/tqeMVzk2FIgTGIMAOchHu2iex3uQVNZAftqns9zA8njEOsZqEYcJv9l4Lo1sVdcgyBysfrj7g1Vi9WYentMhqEYF6PRXNE4tQkuGOd+6CBnUQVP2oLlb6WNQi+CA17vxCP/5PnqrYtQhQ1dLLngX/zCPgnAaRoyhe74Tj0N8YGkSSggLpQaXjB1GreQkM0w5ncXLtfEi+/zu5eX4uKAonMRLST6AGBhCxwbhfZmUfuBlxD1QNgRWqvpxO/9cc90OlwvtszesHkVj33w== 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=SJhhfLgoH+Fpd88WHV1WJgVKorCBzFhtwGEYODT5IHU=; b=Ysjo8H3f+JHBf48QdleoW++StogNuBJZYhy3laTqQUFQLhlK748NfT1sdDiABZFfSNKR00eQIf8iVKDie9wcZlZDDbX/ncYg8tq6Q7+b4YwQp4GuCn276j6eZlgKarK+IEL3vtOo3EqMFIBHWySJlhzaWI0MgKNSxFbytpxtau4/r7UIhBy+IfAe+0cSZnnVl+ysPgZ5IpkUtiBuxz0FvF7kku3WBQ6jzZYOkmHiwY56evSRqisZOTsMJZmd/1Na4ytBwu4Krkp3pedDzXLfx/6FZ0dpfyK2Uz9lUhQ0Z6Bby/F18MeVQvGooAJQuky8n//YekJDQkbO0clT8WRuJg== 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=SJhhfLgoH+Fpd88WHV1WJgVKorCBzFhtwGEYODT5IHU=; b=hGi4W89hkM/ZufZ8vs8vHp5iZWZeoCmI+0Ne0+mZkD/0pKmxVvoWFyWzCZknql9ikVhukIKrrSEC2xhPcfvsE7myaHPk1PWwJjWRwrZqeXBiMEPaaZLyHuCaKfyxd8K535GMulLhqiWjGciB6LVGWQ8/QpXseaZsVmIroQKECSI= Received: from BYAPR11MB2901.namprd11.prod.outlook.com (2603:10b6:a03:91::23) by BYAPR11MB3398.namprd11.prod.outlook.com (2603:10b6:a03:19::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25; Wed, 13 Oct 2021 07:08:10 +0000 Received: from BYAPR11MB2901.namprd11.prod.outlook.com ([fe80::3c86:a313:dd9f:7b77]) by BYAPR11MB2901.namprd11.prod.outlook.com ([fe80::3c86:a313:dd9f:7b77%6]) with mapi id 15.20.4587.026; Wed, 13 Oct 2021 07:08:10 +0000 From: "Xu, Rosen" 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" , "Ananyev, Konstantin" , 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 , "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: AQHXvvtQptpMMC/op0KCqif/4aRBkavQg/Jw Date: Wed, 13 Oct 2021 07:08:10 +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-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.200.16 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmY3NTA2MTMtMjlmZS00ZWZkLWJmMTQtOTBlNzAyOTY0ODI4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiY1wveEMzdE00enpmTWhPdTRUK0VPa0lIbTJjZ1JWOHdrNU15WXQzbnd2Rys3dXpIY1wvOGdJd0UrQkJcLzhtS01jUSJ9 x-ctpclassification: CTP_NT 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: 6b21c057-e086-441e-085f-08d98e18374b x-ms-traffictypediagnostic: BYAPR11MB3398: 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: CzvdfPfLuZyLq+xtsZvRlfnGusV2kSV3NmHEl82ptg9TURSGq1OgsFrXuscQ89Gm/140WAFiO9+3uHGGZHVXQO1rGwf6weQESc9w3NUTTkGPX1akxz0DtAr9xMaSAEsQEmt8t/1WnltRCoKHVoXNcovgUkcCZ2RMfUQErj7PwZiVClAK7SjVehvpYvXX47O1hWD0EIhVCVxbvghNR4riHfQGI47d+6tHW4mPQcN5qOr+czwE8SyPyPJhIcic6eBXy+Xk1X2CRIY0qA19znXKoMsavpskXvmi0Sr5flDWhVMl130vUvEZUU4lbJBVvbQA1wXlied7zbfQBCgPen+f491aFgmd1nmUOwLgVJa/bDvea4f3RjEPS1xjIBJaRfBwue8hquMQbRKXlWJfK3cfwjGaai/PeSxCqurO1tkX5v4N7JDDyA64dCqcEi6KbFCFvAd0vmJXWY6DYOrds/HKQsotNxYyCB8xgqnEUH8WlA6iHymSDGhjMXTInNBzgvYmAjpeOC+T524zexPAfgZYXxtuGhy6d5nfO5fkFe1To8QUw7UMw0DHiNImppMyUJA5kF1R1uNl5v2DaN9QJjWNXJVkqaEe8rIcolkhmp6vtpzkV1DK1uIsk58pwXyWL2V3ossW8yNJAUYILFORcdS9E3Ut3Vzh24rxxleOzmWdcFWrF5ypz+aDGK2RPGG4lyg8v4JGQ41ki47T6Gt9dsDbwPlRfjoTIb/T7A91t0j5g44= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB2901.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(186003)(82960400001)(7406005)(7696005)(7416002)(66556008)(2906002)(66446008)(71200400001)(66946007)(6506007)(8936002)(66476007)(7366002)(53546011)(76116006)(26005)(9686003)(4326008)(122000001)(55016002)(86362001)(64756008)(5660300002)(33656002)(8676002)(921005)(316002)(52536014)(1191002)(38070700005)(38100700002)(508600001)(110136005)(54906003)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?k/lfLQFZtBnyJwWifrAQjtaIqZf/SR0e/CWJ8FmA7sSaqvsmzkZmzvcW4KhR?= =?us-ascii?Q?ZZ8OZRgzCIHf1Dbn5mGXTp1ruB7TdpfrOpai9f6Lrod1mvLa6DqNMOf+Yw2D?= =?us-ascii?Q?ZO9WGDXaTC5CYwAHj2RbHRdLGt7RBjZf/11/8peKkdxFPCgHjbJ4KlCc7gUW?= =?us-ascii?Q?q+vpinSLilsFBCpId0/JOQcemrYlHJhP91XPPs4zPCKfGVknPoEj2fdXA/0E?= =?us-ascii?Q?Ajbb+iSre0FYgAbdE6Cso/r6+K63kHJqpRoDPFuiWd55M3DtJTLPvZjSg3L6?= =?us-ascii?Q?M7kXcX9Nw6SYnDAL8qLw7FkeuiNfDhF5JhD/X7YAZkitAC4V9nawDzi9Y3vC?= =?us-ascii?Q?XOaRRweNSGn4iOV/+mn33wCfxB3k4bt1pn5i3xT53qArfZp6t5Gt3Uly0WZ+?= =?us-ascii?Q?Mka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QwhMxo0ttzzkmb9moeoy?= =?us-ascii?Q?HC0ocki3r8UTCzohl1OHFYlv?= 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: BYAPR11MB2901.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b21c057-e086-441e-085f-08d98e18374b X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Oct 2021 07:08:10.3941 (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: If1O2ZQoc90Lc1BDRUlZuPaxzNACkI6qx5XzJS9xw21LH8JYPO1bcHfaip+JLWXb/WnHql3DqvMvMG7aIc/jFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3398 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" Hi, > -----Original Message----- > From: Yigit, Ferruh > Sent: Tuesday, October 12, 2021 7:54 > To: 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 ; > Ananyev, Konstantin ; 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: Yigit, Ferruh ; dev@dpdk.org; Huisong Li > > Subject: [PATCH v6 1/6] ethdev: fix max Rx packet length >=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: Rosen Xu