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 B3C2C43006; Tue, 8 Aug 2023 06:05:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4515A43247; Tue, 8 Aug 2023 06:05:25 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id B806E40A87 for ; Tue, 8 Aug 2023 06:05:23 +0200 (CEST) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RKfhB6JRDzrSNZ; Tue, 8 Aug 2023 12:04:10 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 8 Aug 2023 12:05:20 +0800 From: Huisong Li To: CC: , , , , Subject: [RFC] ethdev: introduce maximum Rx buffer size Date: Tue, 8 Aug 2023 12:02:34 +0800 Message-ID: <20230808040234.12947-1-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected 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 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. 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. Signed-off-by: Huisong Li --- lib/ethdev/rte_ethdev.c | 1 + lib/ethdev/rte_ethdev.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 0840d2b594..6d1b92e607 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -3689,6 +3689,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..1f0ab9c5d8 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -1779,8 +1779,8 @@ struct rte_eth_dev_info { struct rte_eth_switch_info switch_info; /** Supported error handling mode. */ enum rte_eth_err_handle_mode err_handle_mode; - - uint64_t reserved_64s[2]; /**< Reserved for future fields */ + uint32_t max_rx_bufsize; /**< Maximum size of Rx buffer. */ + uint32_t reserved_32s[3]; /**< Reserved for future fields */ void *reserved_ptrs[2]; /**< Reserved for future fields */ }; -- 2.33.0