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 BD10942662; Thu, 28 Sep 2023 17:56:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F46440273; Thu, 28 Sep 2023 17:56:58 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2063.outbound.protection.outlook.com [40.107.102.63]) by mails.dpdk.org (Postfix) with ESMTP id 9C7544021E for ; Thu, 28 Sep 2023 17:56:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=epsSNnBYsE8RXBz5RsAMIvGBmIk2OdbyH7boJYIa5aXV0R17qRzF8cceBR1C+IGXWmLyXgSl53DSbK+1P7+2sIotQk/beCyyXDilXRCUJ1A5Qv3mHK+oHWxQbOghhERlsH1Y9rTUcvkQB09TknaHMXyxdGGayY8FVPmpOVjT2SQ/n7ODE0bvzK7hNPyEjRqV8MeDaWHH+j3s/Qw8fq75YlLKoOiUJ3JxYs9jX0ZTQtgtJiGGby55jI9RjrRFyWB0fGzFoHswmV/xZIiRk1ziDwc7ZwCrG1EHhUSKXi0rwyJg7PnDG0IZ47CDKfmGyg5nOk3SspzHUtGpIjooIu1YKQ== 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=FQ12gthUoNn1NPjFhOBs4uBdCX3vn75WXW9RH8LJnpE=; b=RZJUXGuu3IdYjKvY2R4VsH8h+3BmDl36+kyLjdlQKLZzuipgejmgUsH6h5VSNWbAwHi+Q0kw4uIcdB5LBa5u3fp7rXqC9eJyR04ELwvQfnIJVEHl0OM+KdUrCz8jmRyxJ5lwC1IkzcixO2qhUyjKPekr25w9N1eun2GW6YuAgLUD01inercS5xlErzTEfhlRxFmjyoGZes35gFhndklH3yb+tL60SkyF9tTaAJHepPsom2bkQf4iFD0PqvhRpfeY/EYxubC7NjjkM9I+Z0njqc3aMMfAhXy2HnyCReLPziMBiYdemjjHFCw+vr53D/nbnmYoJBZCKyuGrEQwPCHcnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FQ12gthUoNn1NPjFhOBs4uBdCX3vn75WXW9RH8LJnpE=; b=LDgJxOXezux7eQ99MKkQJxkUr6LiefmixLbRHoKyIwKhaxI7Pw8XcFl3kyZFAjuunA33jZzhKnkUpsTR1ZzuJSAY792SJ517x4GifNx/mBy+gUtXLtTQWF/S21aqFTlsWLm8ZR2hjlHNgk+NSkIc1e/70UXvfL/pIaVJaGYP9lg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by DS0PR12MB7512.namprd12.prod.outlook.com (2603:10b6:8:13a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.21; Thu, 28 Sep 2023 15:56:54 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::102f:c69b:d3e5:7fe8]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::102f:c69b:d3e5:7fe8%4]) with mapi id 15.20.6838.024; Thu, 28 Sep 2023 15:56:53 +0000 Message-ID: Date: Thu, 28 Sep 2023 16:56:46 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/3] ethdev: introduce maximum Rx buffer size Content-Language: en-US To: Huisong Li , dev@dpdk.org Cc: thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru, liuyonglong@huawei.com References: <20230808040234.12947-1-lihuisong@huawei.com> <20230815111034.22887-1-lihuisong@huawei.com> <20230815111034.22887-2-lihuisong@huawei.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPt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kguFw/tXmA17nx+c2uR5jx8wb4j68umG2X++0dSta5eHAVhmtXvrqPW6Ku 3FQ= In-Reply-To: <20230815111034.22887-2-lihuisong@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0597.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:295::14) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DS0PR12MB7512:EE_ X-MS-Office365-Filtering-Correlation-Id: e5956938-d681-462c-dd76-08dbc03b88b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Kj6HJV0XjeZ9qWvn7gytVJujeLoSiTnfahwK5bt9t77x/xlK8oZ1lY+blVOnHZbCjCZBRjfAGu50kcMMsF0uBbl3Arih7X6+rCG6diyIkFmlkhqXD1kbRne3xTxrAFynM1s0n0yeGNuETRtSa00PDHriHI2mcEc6YL1lk+9AmfM6i17D8YdFTY1EkjnOwq/6rQYMygawFXLFE1GurpEemH3MyhrqQ22po+uP871qun4RFXLAlHxDFfbvXi6nG8Ah9gNxvVCzM6otWuhiQXJiGynINSaDjmQE5R42uCbXb4XKVGpI0+93sTwjyFH4oV/QML62P8ZHQaJ//v7rQXQwWgLDrUGlHxelzZL/nBeYy6N7hl6Z9RCiS/nr7c4+zukeM8XvOQ3rzk96G9F/2mmsVf7m3tN6dKnvM6DN6L13deM4zTT0+nMMNDwA4tLoxV9+QCw8ZsM0fonl8zbVHqYcfKFtHZCYCfNgJyLrwqtbWmUQk5XxaPzf0Kf0OkUKVW+HDLuM+27h0eAmudcCNvneZl7vifzOOMAxh9bBYT4I3P5Tfq4c9gBwFSYW0Fks1M6gWGfhjryqz1l19ssIjN1EL6+bjkbF2mAeAN6grT3CZaEF1a4ZOFVKA2L18+gERchkmKD+f6oMIXz6sdj2dWRsDQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(376002)(136003)(396003)(346002)(39860400002)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(316002)(478600001)(66476007)(66946007)(66556008)(2906002)(41300700001)(4326008)(5660300002)(8676002)(8936002)(31686004)(44832011)(6666004)(6512007)(53546011)(6486002)(6506007)(2616005)(83380400001)(26005)(38100700002)(31696002)(86362001)(36756003)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aXEwTVg0cWNwTE9DL2JGd2JXaXpqaG1RemEzSXZxTlo3WmR5NWxXYnFNaTNF?= =?utf-8?B?aFRuTFpWdUd3QlJwSkhDcGJodWdab0tubFpMb2VWVkQ5THRaS29QUXY0bkdP?= =?utf-8?B?ZXltL2FjbEZNTUY5cXNBT25MRmV1T0hQQ2ZaeXlRSytQN1o2QmorMlA2bkZC?= =?utf-8?B?LzdXZXBGNDNSSjB1UWVzblZ1RVBjTnRyazJIMXFXckdaR0JPdEJ2ZDN4V1BK?= =?utf-8?B?ejNqNDlMWFhTWXRkYm4xTUF5R05reEVJK3BBT2tGOWYyM0hhZm9wVHlPSDdH?= =?utf-8?B?NUFTbjhRUFVKaUZFUFRQdTVMQ0cwOGpTY0xxbHk1Zlc0MXM4R0dvR1lXNkZE?= =?utf-8?B?RUFaV1VSL3dPT3pKY0FSenAya1hIZ1pFcTF0S3V4WGZTVE5uUzBYamJ0Ukc4?= =?utf-8?B?ODJvejRzS2dNZjhBaU1tTnYwbEZNUVlLNlB2dm5wcG5UZmZ3Zk5HWXVsak9h?= =?utf-8?B?bkZJZS83dTRwNkc3M0dJTUl3bzQ4VDZCeFY5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jRkNIT05GTkdiYjBWVVhUSElEK1Fm?= =?utf-8?B?aUkwd3ZNZ3R6MHB5Y3hvRm1nTjE5c0VBZXEwOGlMNkc3bHJjMVJIZEJ4R2xn?= =?utf-8?B?bERPdThCTWswRm0zMjU4cnBDT0p4Qy9PclI3VXZCaTFIM1NEUkxXRXhJMlQr?= =?utf-8?B?SUNhWHM4amd4ZFFtdlltTmpieWdFZWlqcGNjSlkzdjRHdkd6MTNLTGNTZkxO?= =?utf-8?B?UjRSZWJWNTE2SzVVWmpQbVNqR2pUb2xHZ0U2Y3dzR2VOTkVDNm1kWFR3aWxP?= =?utf-8?B?cWIza3FrV1N1NVVSUGxmZjVtNzdKRmFmRHE4NHptTzJ4NzdOZW4zSFJseTQ3?= =?utf-8?B?YjJXZXpmQjIxT1J3ZmNBTURhZ0pRd01tczhFempaTHhRaTQranN0MXdLWUJ4?= =?utf-8?B?VHF3QUlVOGdFenlLVlg3L0Y4dS9Dc2JUaUJYUWRkOWlSWEswL3gvdUJmL1Ur?= =?utf-8?B?c0wwbFdyOFZTcWFXUDNxRnZZN2NJZjBhdFA2Z3MrYXN6WUJyc3RaQVBRcnJE?= =?utf-8?B?OHhwQVdqM2llcjh0WU1iL21kNy92N2xXNFg1UFM3am5Hb0NDc05qMnYxZFA1?= =?utf-8?B?c0lNa1BWQnNwMlJTZFNpRVFIQWRtaVVCUm00WSs2eUt0d0ZXQW9DWWxFKzRo?= =?utf-8?B?RDAvV2wvQ2VvNmdYRnh2TUNrdFBzWUVrdU04WFhxakx2dHdjdnBpYUZ2Rklw?= =?utf-8?Q?m6qqrRXoGW95YvK38ydBjzrEk?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5956938-d681-462c-dd76-08dbc03b88b3 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 15:56:53.5181 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1IWmkY3MHlHhy1h+vfE6WYGdFBqeXgjWkP12e0XVrYT8Go7Ct1/mURPY3T4WHuEI X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7512 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 8/15/2023 12:10 PM, Huisong Li wrote: > The Rx buffer size stands for the size hardware supported to receive > packets in one mbuf. The "min_rx_bufsize" is the minimum buffer hardware > supported in Rx. Hi Huisong, I guess I understand the intention, but above description is not accurate, ethdev Rx buffer sizes are not per mbuf. Device internal Rx buffer can be bigger and received packet can be represented by multiple descriptors. Each descriptor maps to an mbuf. Like device can support 8K packets, this is informed with 'max_rx_pktlen', and if you provide 1K mbufs, device can receives a 8K buffer and chains 8 mbufs to represent packet. > Actually, some engines also have the maximum buffer > specification, like, hns3. For these engines, the available data size > of one mbuf in Rx also depends on the maximum buffer hardware supported. > So introduce maximum Rx buffer size in struct rte_eth_dev_info to report > user to avoid memory waste. And driver should accept it and just pass > maximum buffer hardware supported to hardware if application specifies > the Rx buffer size is greater than the maximum buffer. > If I understand correctly, you want to notify user about per descriptor max buffer size, and I can see that is 4K for hns3. Which means even if device can receive larger packets, each descriptor/mbuf can't have more than 4K. So user allocating pktmbuf pool with mbuf bigger than 4K is wasting memory, and you are trying to prevent it, is this understanding correct? No objection device sharing this information, but we should make it clear what it is to not confuse users, please check below comments. > Signed-off-by: Huisong Li > --- > lib/ethdev/rte_ethdev.c | 7 +++++++ > lib/ethdev/rte_ethdev.h | 6 ++++++ > 2 files changed, 13 insertions(+) > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index 0840d2b594..9985bd3049 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -2068,6 +2068,7 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, > struct rte_eth_dev *dev; > struct rte_eth_dev_info dev_info; > struct rte_eth_rxconf local_conf; > + uint32_t vld_bufsize; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > @@ -2105,6 +2106,11 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, > return ret; > > mbp_buf_size = rte_pktmbuf_data_room_size(mp); > + vld_bufsize = mbp_buf_size - RTE_PKTMBUF_HEADROOM; > + if (vld_bufsize > dev_info.max_rx_bufsize) > + RTE_ETHDEV_LOG(WARNING, > + "Ethdev port_id=%u Rx buffer size (%u) is greater than the maximum buffer size (%u) driver supported.\n", > + port_id, vld_bufsize, dev_info.max_rx_bufsize); > I am not sure about this check in the ethdev level, application already getting this value, intention is optimization but a warning message can be confusing to the user, even if we keep the log, at least log level shouldn't be warning, nothing wrong to warn, maybe info or debug level, and I think message should be updated, this is not about Rx buffer size but max size per mbuf. What do you think to move this log to testpmd, it can be also a sample how to use this new field in application level? > } else if (rx_conf != NULL && rx_conf->rx_nseg > 0) { > const struct rte_eth_rxseg_split *rx_seg; > uint16_t n_seg; > @@ -3689,6 +3695,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) > dev_info->min_mtu = RTE_ETHER_MIN_LEN - RTE_ETHER_HDR_LEN - > RTE_ETHER_CRC_LEN; > dev_info->max_mtu = UINT16_MAX; > + dev_info->max_rx_bufsize = UINT32_MAX; > > if (*dev->dev_ops->dev_infos_get == NULL) > return -ENOTSUP; > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index 04a2564f22..9fdf2c75ee 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -1724,6 +1724,12 @@ struct rte_eth_dev_info { > uint16_t max_mtu; /**< Maximum MTU allowed */ > const uint32_t *dev_flags; /**< Device flags */ > uint32_t min_rx_bufsize; /**< Minimum size of Rx buffer. */ > + /** > + * Maximum size of Rx buffer. Driver should accept it and just pass > + * this value to HW if application specifies the Rx buffer size is > + * greater than this value. > + */ Above comment can be simplified, as something like: " Maximum buffer size supported per Rx descriptor by HW. The value is not enforced, information only to application to optimize mbuf size. " > + uint32_t max_rx_bufsize; > What about renaming variable, to something like: "max_desc_bufsize" /**< Maximum buffer size per Rx descriptor. */ > uint32_t max_rx_pktlen; /**< Maximum configurable length of Rx pkt. */ > /** Maximum configurable size of LRO aggregated packet. */ > uint32_t max_lro_pkt_size;