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 C46F1A0C43; Mon, 18 Oct 2021 19:34:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D10040142; Mon, 18 Oct 2021 19:34:11 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id D10CD40141 for ; Mon, 18 Oct 2021 19:34:09 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10141"; a="228193775" X-IronPort-AV: E=Sophos;i="5.85,382,1624345200"; d="scan'208";a="228193775" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2021 10:32:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,382,1624345200"; d="scan'208";a="462414157" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga002.jf.intel.com with ESMTP; 18 Oct 2021 10:32:10 -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; Mon, 18 Oct 2021 10:32:10 -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; Mon, 18 Oct 2021 10:32:10 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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; Mon, 18 Oct 2021 10:32:09 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.105) 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; Mon, 18 Oct 2021 10:32:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=asQmZY+V/ibj3ykt0uMx9CtveI5pNSCBiR6HtWY3Unpm0NN85s93cumpSJuEQi7Fh3mZcc7uxNtzENlKa0rv+pfspuqRsk0Q+1KKJS4oQS9KBHzX/ED82l3/i1arJF1GXyb4pRsmhVM1Yxpf6/kCXlyGjt+QdwtzT7ofl6PxKZ+GRh2RVyQ6PZObmO4VJj7qL9pnMMTsK3NaquIyzMfmwcej2rNTJBIVkS2RTfcG7Sy7avTTxRyba4soPcyWZeBrmUgLq9qpXB8KhPlON63LX6gPnxyYAW5YzrH12i3t3JbRIF5HE0lUf5LIx8xvX1ERIbVDw/0yTFSdclEvP6hMRg== 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=12ez4O2rcs5+KccHyxey+uaaBtYtHe1vbSf/IzrQYBs=; b=RNyvDcTLUxy7dGC6xTwjX5hDVBHzF18GiiT4aE6nJwYePq8BI6qG7Kr+Y5sMZCMFF7Ry4oF74F7Vwyymp7rCmXaqkD2BgKGXi6q1MdR0ADsDP4tUKt0ldQHtiUl1wqeLa8TMTpQR3MFiaT8/cxyj/GLH3t+Kifh1tf48pWDixrrdTk4l03pqVOfUEwjO5iBdBiKJSLBXUq/PsstuLRTJgax44HJZpIYMGrujCoiwSPvY2lcwTgn9g2wehA1KJz/Im9ZasHlDHud1UEAyh5QAKDWx74OygqH8DAa0qn89fRA1DAVEn+0XTLZ2RQ2iDnR0+wW+hnFAvpFwg5uwaaF+gg== 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=12ez4O2rcs5+KccHyxey+uaaBtYtHe1vbSf/IzrQYBs=; b=ctgMwLz631lPyiKjRNt/DcUVL1xiiH+o73TZt5a5RngNvNwgkXykr1vLuuHv8wShEZHuCZvITAD652OdnGX+iQZ5rgJPQSCJ1+IW25oQhAIG7rddPy2plqD4MzazphXosqWvB7I+7Qmn5c4QQkvVOMpsLm2tYwmTpi2OXfBxlxc= 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 PH0PR11MB4886.namprd11.prod.outlook.com (2603:10b6:510:33::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14; Mon, 18 Oct 2021 17:32:00 +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.018; Mon, 18 Oct 2021 17:32:00 +0000 Message-ID: <2224cd8c-2042-ae58-1628-8b92ef076ad1@intel.com> Date: Mon, 18 Oct 2021 18:31:41 +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> <20211018134854.1258938-1-ferruh.yigit@intel.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20211018134854.1258938-1-ferruh.yigit@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB6PR0301CA0064.eurprd03.prod.outlook.com (2603:10a6:4:54::32) 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 DB6PR0301CA0064.eurprd03.prod.outlook.com (2603:10a6:4:54::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15 via Frontend Transport; Mon, 18 Oct 2021 17:31:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4103424c-d30a-4b0b-8cd2-08d9925d30d9 X-MS-TrafficTypeDiagnostic: PH0PR11MB4886: 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:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ONsr6YdP2Lh6GisbtlH6sDHMQxmr77DhlSGM1izR0nonD5Vr7WrtW4zsyHdYwrMQTfjPpc/CJNd6W9p3V7S1zppgu1dV93o0eK7TdMvPmd6UgfXhiVquvYWHuhyZ9nbA6FZfY6kiiRN4cKdGVKdCpvQtqelcW9BytO38j+VayKHznFRG+OqI9b12eDC79U3xBCVFkB1zZX7aaGuHqxSFGcPpiiTRyWv9eOicGaiu77WUGdjJdKJFUJ7MF0x00DcdkAsJfmhmYtO4l9EVx4aTnMo95VVg6FxEGdHuiZVo/lyqaFa0tOqvliTXzVwLez37y72XQt249oiKnmxda1InTX9RS59Th4i4kF6a2y7TLPUfs7lV0g0BVW5oLUWBy6npesBIgQ9U8GN83qLC+iaJ3HUa6hS8apOfll9yg1AHYM4PyUX3KEoYNZ8c38+1KSVjjIAZMUSjKuTWGMf/5CPrPzH2e6Phy8YUp1+qtxo7yJqkUNlRkJN0HWvlMEvFJeJvDXtbuFKq8Ziqcg9TyYywOCs/ExcG1+ZUSj8OjSPWj8hrqrE/xmM4hn9GoJ06uF9561sM/vP07+1lRhrvZyOCdoEk46WZTpbKJNLOGN0XKgp+1SY6biMAyI0zNcfDpT41Z2ZeNkyfpsc8jSKZSim0b5wxDi+Bn3MloofeSGAMTXmwhBge61Dsl+ZrHfk73zX8MSv6Zhu6AlwShxaSJst15aJqyDs1xjgeV9Uo057rq1g= 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)(31696002)(956004)(66476007)(53546011)(508600001)(6486002)(66946007)(7416002)(2616005)(38100700002)(6666004)(1191002)(8676002)(44832011)(66556008)(5660300002)(921005)(186003)(4326008)(86362001)(316002)(7366002)(7406005)(16576012)(110136005)(82960400001)(36756003)(83380400001)(8936002)(26005)(2906002)(31686004)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Tis5R0tsWWZBNWxxa0ZpaTR2Y0JlR3BwbU9WNVd0NlY5MkRQTmhtUjg1MHkx?= =?utf-8?B?NVpqVnFwYXVyVnN2YXRJME80RVVpTG5Bc0ZXN0IwU1ZDTU1WYm1mVjFQZkxp?= =?utf-8?B?bkZ2R3RzQlQyS1pEalAwUDlpc2ZuNGxiQWpNL0tTMTR1dU5Mck9oSVAvamdB?= =?utf-8?B?M2NQTEpwRTh1MlA2R2svcnc4cUtKUGlYMEtmcnV4Z2ZheWsycjhQdjVCQVBY?= =?utf-8?B?d0dROWdFSjRXbzlpNXp4Zzc3VFZJSFdRWkJMSTdXYzFiQUd4NWNZUnEya3J4?= =?utf-8?B?S2QwQUFXK3dLSm9GZTd2TDhpMVJTYjVUZUFYcFI1YjBBbUcvam1YajlUV08w?= =?utf-8?B?d3QzWE5OaEF3SlcvSklpaUI4a0k5YjBDRi9WZFl1Q3h4eVhvc2VTc2I2U1Zx?= =?utf-8?B?ZkJIQitxQ0h6bWtSeDRtOVZ1QStOZWRzRWdxanJna3d0SGYzSHBKZkpvRnNh?= =?utf-8?B?S2grKzArZyt5Z0E1dnVWTGxBQ2tVUVVWcWZld1pFQTdDUVRxM2d2bzVkL0dV?= =?utf-8?B?WnVPcThOa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= =?utf-8?B?a0pnS1FCRjNCTE52RnVLSTIyRk9WL2N6dXZueVpzem1wYm5GV09zZXU3LzRr?= =?utf-8?B?SlhRUzBPa3BPRVBDU2x5a2gxTVYxMG1JdTdxb0I5RVRYNEt4ZWs3SU9QQTRa?= =?utf-8?B?d1luY1F0L3dkM0hpOTA4RzZvN1BKT1VNTlJYcGloRG9jV3oxUUU4S0MvOXV4?= =?utf-8?B?RmQ1cUhjZmovbHJJeHVIZHdQWi9WVGJoNXIyN3B1MzZSWk05dlBhNlRuNkZK?= =?utf-8?B?MHFWSWZqeDRzS0l5blA4N1h1ZExsazJVYVVFNzJvV3FFN1huMCtSUW5Kc0dp?= =?utf-8?Q?mhSVduEKiryWU9d5hcLVIF9WpLGdfvHcssqF/68?= X-MS-Exchange-CrossTenant-Network-Message-Id: 4103424c-d30a-4b0b-8cd2-08d9925d30d9 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2021 17:32:00.4149 (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: 9d/fHrKVZv9BHUd9qeX/igpr9LPYiHwG72po/NXGPkTPJRNzBgPXCehSQ1+HeMCs53Qdq9+Ni88hl65/h3JE2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4886 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v7 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/18/2021 2:48 PM, 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 > Acked-by: Andrew Rybchenko > Acked-by: Konstantin Ananyev > Acked-by: Rosen Xu > Acked-by: Hyong Youb Kim Series applied to dpdk-next-net/main, thanks.