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 6F4F5A0C43; Sat, 16 Oct 2021 02:24:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3732840041; Sat, 16 Oct 2021 02:24:54 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id A0C794003F for ; Sat, 16 Oct 2021 02:24:52 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10138"; a="214945569" X-IronPort-AV: E=Sophos;i="5.85,376,1624345200"; d="scan'208";a="214945569" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2021 17:24:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,376,1624345200"; d="scan'208";a="564613721" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by FMSMGA003.fm.intel.com with ESMTP; 15 Oct 2021 17:24:50 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 15 Oct 2021 17:24:48 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) 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; Fri, 15 Oct 2021 17:24:47 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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 via Frontend Transport; Fri, 15 Oct 2021 17:24:47 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.42) 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; Fri, 15 Oct 2021 17:24:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H9ly/YvxdbIvWUQGlzRrKrizRW/KGd++y/NOgBKK46fVj9mRQfLsoAO907MFQ++m9+oBLMQeialjX6/NuwUCiCB5cpA8BR/RiAjyxiH2yI5arka5yExNhl2J9gsTw3kGfTWkpWBxzz2uiuycjpe7GjpHVds7uidxwXEpf/9g9E1DwQDLlincTV9PWJ+PsGDfZWiuHo2U3GD53/llBDeRb9BY4/rKDzI7A8E9vQO5zBT3eCop9RHJOhdfakNsYVJwCoGLUKxdO4Ou39ePmQ7sMJzxuj42VdOopbovZwrBLR1fK6B2yKdqMy8fudkMnqLIH2Y5pOxOVEW4Z+5sTTdP1A== 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=sgnqfPJHilpWETPigBZJ6sstRlL7Hbhm1Zcw9w0ioYg=; b=UlIfwNu4LOntwqPoNY+SP3OUbN7ZG44cNtHBBKijMm7uczCV4RkNb3uV3/cW+4x9NullVsnDjzhAUOAYzlJLncbdcRg1D4QI2og+pmjzmaHsYahHT5dPxzbRK7phurnkDpxR7bo2VODJ1lYtvzMAYpbV6thMlimwrOJl614lCtXemHYioYlqsc1uBsK5yITCi/f0+ZdZju3db/FOmkN/0f26sHJfIt6fyK36RODjr18kQ8mzTgL29Z3I1YxCEVr14gfkix6nrdebHzNIeRgszm5Rglt2hhy8UsguI6JGlrteSI3JOffCxSFDRtiZsyveEjt0uCoLMwPB0yG9XqhRzw== 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=sgnqfPJHilpWETPigBZJ6sstRlL7Hbhm1Zcw9w0ioYg=; b=oMRtVrjTxIWQfwSG4yEg8O9zvYb+czo+yIeKaxE+dKMJVaB5NmuXh0pqi93gddtkhhgyMQ2VOMprXubOcrpnqxNTRt3zEthGhP/VtPrQvXP4HccKUOl7/hhh4FbYLa/kr1g16zkP/XFqM5hrMAiq5+FhuoYg/0efGUSq9sMYldQ= Authentication-Results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB5031.namprd11.prod.outlook.com (2603:10b6:510:33::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Sat, 16 Oct 2021 00:24:42 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%5]) with mapi id 15.20.4608.017; Sat, 16 Oct 2021 00:24:41 +0000 Message-ID: Date: Sat, 16 Oct 2021 01:24:23 +0100 Content-Language: en-US To: Jerin Jacob , Xiaoyun Li , "Chas Williams" , "Min Hu (Connor)" , "Hemant Agrawal" , Sachin Saxena , Qi Zhang , Xiao Wang , "Matan Azrad" , Viacheslav Ovsiienko , Harman Kalra , Maciej Czekaj , "Ray Kinsella" , Bernard Iremonger , Konstantin Ananyev , Kiran Kumar K , Nithin Dabilpuram , David Hunt , John McNamara , Bruce Richardson , Igor Russkikh , Steven Webster , "Matt Peters" , Somalapuram Amaranath , Rasesh Mody , Shahed Shaikh , Ajit Khaparde , "Somnath Kotur" , Sunil Kumar Kori , Satha Rao , Rahul Lakkireddy , Haiyue Wang , "Marcin Wojtas" , Michal Krawczyk , Shai Brandes , Evgeny Schemeilin , "Igor Chauskin" , Gagandeep Singh , John Daley , Hyong Youb Kim , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , Yisen Zhuang , Lijun Ou , Beilei Xing , Jingjing Wu , Qiming Yang , Andrew Boyer , Rosen Xu , Shijith Thotton , Srisivasubramanian Srinivasan , Zyta Szpak , Liron Himi , Heinrich Kuhn , Devendra Singh Rawat , Andrew Rybchenko , Keith Wiles , Jiawen Wu , Jian Wang , Maxime Coquelin , Chenbo Xia , Nicolas Chautru , Harry van Haaren , Cristian Dumitrescu , Radu Nicolau , Akhil Goyal , Tomasz Kantecki , Declan Doherty , Pavan Nikhilesh , Kirill Rybalchenko , Jasvinder Singh , Thomas Monjalon CC: , Huisong Li References: <20211001143624.3744505-1-ferruh.yigit@intel.com> <20211011235345.851742-1-ferruh.yigit@intel.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20211011235345.851742-1-ferruh.yigit@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB6P191CA0003.EURP191.PROD.OUTLOOK.COM (2603:10a6:6:28::13) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by DB6P191CA0003.EURP191.PROD.OUTLOOK.COM (2603:10a6:6:28::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25 via Frontend Transport; Sat, 16 Oct 2021 00:24:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8a8812b9-ca28-4105-4d74-08d9903b5874 X-MS-TrafficTypeDiagnostic: PH0PR11MB5031: 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:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mPyKBrGZkyCHMNt549cl8VZai33l+hoyeXfeGmunYE2yxKvNsj7qNZm5RYokILJZy1VaWYna+V7XleL0VmLADhY0gH8mUcVquJfnZPO3RRQ0+jf3JAOCzujDdonW90GLQAa/Y6JPMswVQqhxUmRQqvYf6GfrRzZuQ17GNxU9xTJ/Qm1Y2ut6efwQPR4WxwnS7vIFK1CLfn5h0KiAUT28v0WL8tmfB6ICDjRkX4mF2QOlgJE7j8nmGMXiO0eOA2Hrw+ROK99tnlNMgkI3bfkSk6iVsUVSnSHd0XE8GPWDN0iCm9dE5gf46mLTkvPCK1y2gsCfm/vzyWtqOC+K0q6R8nvKDF0Qx4J6a5Mvbi5xkXPx5lnJtgfPLh4lx4NJ4hBl8o4EeNXGJInkjobQ2veJC258xJt+7ux34XCUfMjB+AGNW0i6hBbF4B6e01V5HBJh+lqsXFUGxFvsOCkGreWbhmi1OrYTWp4w/Ykyr8zP8Jqyiy3Bbzy1GgNootnzUgscCYDJFwK84uO5ildiZ6nJ/IaUiLjeWl8kosIw7j4pLGBtdqYw6GqNOCIyBBekGqzkucjLKRE2nLW0i4quiNFZV+l8rlZ4DCFeRrxohDBl32lgU2TpA4vCWsu4mEuTb5EKUqbeoqkVHUV6ISaUkaNHvy97ot9JC4j6YFodvb4E7N1QIDxe3SleTcpw3Olu5EpVShO0AMhTdHe84AXAUPo3J27xqORT7uzqu15XVS1VF04= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(110136005)(186003)(4326008)(316002)(66946007)(66556008)(83380400001)(66476007)(1191002)(5660300002)(2906002)(31686004)(7416002)(7366002)(86362001)(7406005)(26005)(36756003)(8936002)(6486002)(31696002)(8676002)(44832011)(38100700002)(16576012)(53546011)(6666004)(82960400001)(508600001)(921005)(2616005)(956004)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?V051RS9PQlgrVG8xOTJtYVpOS2tCYzJza1pueVgyREhSRnppWkk0YjRpS1pL?= =?utf-8?B?emQ4eVVtOW9FSXJMcnRBamxJc3UxWWZSKzkzdnhsd0lSdHlEQmhTcGwzeGgv?= =?utf-8?B?TjdWZExjNDdZOTJCSVpNWkxWbmw3TDhpbHhPby9MMkRySXZFWUNUcmNReGlp?= =?utf-8?B?aFdOU2dDbHVIZ2dSai9CYXZKYklrUDg1TDlGQkI3U0lVMWhJdDdBQzRHTVR2?= =?utf-8?B?U3VjMlMyLzd3YVE2dWt4QnJBQmdPa1I2dktDYWhBYWZsSXNvdElKVjN2YUlR?= =?utf-8?B?RHU2TVdrckk5K0k0dExUaTVKR284dkVBQWRZRGN1QzFJOEhuS2FIc0h1R3dF?= =?utf-8?B?VUxvVmI1VVcyZVlINGEzVDBDOUZGU0tUUVNoSUxvVmFiUFI5T3pTcGRMK1dy?= =?utf-8?B?N2Z0a1o4ZWRRVWRDczBZNEp2WHBGRDNLaTErWjhQOEFFMVl4bVU2aVR1Yk9y?= =?utf-8?B?K3JKZEpWcVdwTmdtMHlHQS96ZEY4TlVJNHpPOURyT0FwZm1NLzNhcG5EbGFV?= =?utf-8?B?NWJCYUdsTWtmK1B6UDZwSjlVZDU1bmlCaVRqWUdLbU8zeDExTUJJMFlWZ0FS?= =?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WFsWGhlUzFp?= =?utf-8?B?dVczZ2RMWjU2VjN4eFdYS1AzQi9lU3VqUXZmRXZVTE1XK1N5WEl0OXkybHVM?= =?utf-8?B?NmlHWno1NHZBY01LRFF5ajYzUUNVVS82ZDkyTmhQTFRuemRoRzRibFo0ajk2?= =?utf-8?B?U3F3Nmk2aURjazNjZ1M5S3VxcTJNOEtTdjNKZDl0cVk0aVNsbzZmY0hRSzlG?= =?utf-8?B?dmN2L1h1QWV6Y3o1ejZyVTJLbHdWdTdaMzhPWmxDUDc0bmpyMzlXeE1GOVNO?= =?utf-8?Q?iRdnFHJfurpzI1blFftdGpqNejcTjePe4HLZTU1?= X-MS-Exchange-CrossTenant-Network-Message-Id: 8a8812b9-ca28-4105-4d74-08d9903b5874 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2021 00:24:41.7704 (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: yvZfvMJ5Wx6RlHWeKWX5gOG4BgytlYLWKbXIBOjrV3DVFUAVaENDuoPebgyPmbi0WdUBKgq65DM6meYe2+gJIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5031 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" On 10/12/2021 12:53 AM, Ferruh Yigit wrote: > There is a confusion on setting max Rx packet length, this patch aims to > clarify it. > > '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'. > > Also 'rte_eth_dev_set_mtu()' API can be used to set the MTU, and result > stored into '(struct rte_eth_dev)->data->mtu'. > > 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. > > 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. > > 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. > > 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. > > When application doesn't provide an MTU during 'rte_eth_dev_configure()' > default 'RTE_ETHER_MTU' value is used. > > 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. > > Signed-off-by: Ferruh Yigit > Acked-by: Ajit Khaparde > Acked-by: Somnath Kotur > Acked-by: Huisong Li Series applied to dpdk-next-net/main, thanks.