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 17CCD41BAB for ; Thu, 2 Feb 2023 10:25:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0EF3B42D40; Thu, 2 Feb 2023 10:25:45 +0100 (CET) Received: from smtpbgau2.qq.com (smtpbgau2.qq.com [54.206.34.216]) by mails.dpdk.org (Postfix) with ESMTP id E64A542D53; Thu, 2 Feb 2023 10:25:41 +0100 (CET) X-QQ-mid: bizesmtp85t1675329938tqc1pwi2 Received: from wxdbg.localdomain.com ( [183.129.236.74]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 02 Feb 2023 17:25:36 +0800 (CST) X-QQ-SSF: 01400000002000H0Y000B00A0000000 X-QQ-FEAT: PCNBVolVbio1Y+o2b1ynF1owbThVMrDF4dNi5HmlX0FpCuJyVo3a7Lp8MQsr9 /08GX6eOCymvmRCCpt5DtcLgQvp4sMxVuSpbAoZoVsn0mZYpZ1iT1hwTzTxXN7Ccyl4iQ7K 3exYj95it6z9I+gzWSmMyEKAFriWwRcp/Wm9etpC+r0ueXDo/ZXRFs8m4Cc/P5xtsE59JZC D0c73cQ5gtw1PZDzt1tY81v6EssuFBqF3topvxUEZiqzoNjKcjERroFB8ddhRT4vGHpzA9q eu/gQY13LjZUMEYM+foYnKSd+Q8/Ahg9Zn0ciUHZcCCM0NhA5kfOlTul3XGAs0osOQtnR+B cN0RKuzRF63X+O+/A1zHNEdHEhS3DVUH4xW8SMMcbUegnbS6zqlAqtzzKHnTxwUN0eDgh7b aYsWePzaXZA= X-QQ-GoodBg: 2 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH v2 01/10] net/ngbe: fix Rx buffer size in configure register Date: Thu, 2 Feb 2023 17:21:23 +0800 Message-Id: <20230202092132.3271910-2-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230202092132.3271910-1-jiawenwu@trustnetic.com> References: <20230118060039.3074016-1-jiawenwu@trustnetic.com> <20230202092132.3271910-1-jiawenwu@trustnetic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybglogicsvr:qybglogicsvr5 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org When buffer size is less than 1K, round down makes it 0, which is an error value. Fixes: 62fc35e63d0e ("net/ngbe: support Rx queue start/stop") Cc: stable@dpdk.org Signed-off-by: Jiawen Wu --- drivers/net/ngbe/ngbe_rxtx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ngbe/ngbe_rxtx.c b/drivers/net/ngbe/ngbe_rxtx.c index 9fd24fa444..9a646cb6a7 100644 --- a/drivers/net/ngbe/ngbe_rxtx.c +++ b/drivers/net/ngbe/ngbe_rxtx.c @@ -2944,7 +2944,10 @@ ngbe_dev_rx_init(struct rte_eth_dev *dev) */ buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mb_pool) - RTE_PKTMBUF_HEADROOM); - buf_size = ROUND_DOWN(buf_size, 0x1 << 10); + if (buf_size < 1024) + buf_size = ROUND_UP(buf_size, 0x1 << 10); + else + buf_size = ROUND_DOWN(buf_size, 0x1 << 10); srrctl |= NGBE_RXCFG_PKTLEN(buf_size); wr32(hw, NGBE_RXCFG(rxq->reg_idx), srrctl); -- 2.27.0