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 5035E41C9A for ; Wed, 15 Feb 2023 03:05:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3DBAF42FD8; Wed, 15 Feb 2023 03:05:24 +0100 (CET) Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) by mails.dpdk.org (Postfix) with ESMTP id 1838F40ED6; Wed, 15 Feb 2023 03:05:20 +0100 (CET) X-QQ-mid: bizesmtp62t1676426717tcmex7cp Received: from wxdbg.localdomain.com ( [183.129.236.74]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 15 Feb 2023 10:05:08 +0800 (CST) X-QQ-SSF: 01400000000000H0Z000000A0000000 X-QQ-FEAT: F/bMMTsg4iY/rAWRscgdrLYXvqm+/RqdI9aLYFYwGXmT9T9tF6P9HNRIir1OL DaOtLHGlFcXTxBF8sQS6PV1jOZftNkRk9h72VCbdBXM8j6UiISJ0Ue1uNcaiUMKjm7xS2Wk k3uswiCjJzrUHN4FNJ0PLOuyWJ+y63w4CjNkMa56fUKce/v8Bj/mmd5wz7YDVGw49d/sZdP tle7qy4W8//wuky0Oc1CP2Ph0HrFe54MCWKXwehHH9gQu7r05wOmg41ZCTq3wauIBABhmj6 GIVG0Z4Jg4bAnPWsZYw5Hfdbvwhx0kzSahpZlTmdP+Dtr7o1GuLKwV5IuqbPYcb7bPdNlFB duTHB9SbwvrZFbOv22ZJANx6RjYYKphJmYLLZylK3v1aGmbt3Y= X-QQ-GoodBg: 2 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH v3] net/txgbe: fix Rx buffer size in configure register Date: Wed, 15 Feb 2023 10:00:56 +0800 Message-Id: <20230215020056.3511976-1-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230118060039.3074016-1-jiawenwu@trustnetic.com> References: <20230118060039.3074016-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 round up buffer size to 1K, to configure the register, hardware will receive packets exceeding the buffer size in LRO mode. It will cause a segment fault in the receive function. Fixes: be797cbf4582 ("net/txgbe: add Rx and Tx init") Cc: stable@dpdk.org Signed-off-by: Jiawen Wu --- drivers/net/txgbe/txgbe_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c index ac1bba08a3..ae70ca3beb 100644 --- a/drivers/net/txgbe/txgbe_rxtx.c +++ b/drivers/net/txgbe/txgbe_rxtx.c @@ -4382,7 +4382,7 @@ txgbe_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_UP(buf_size, 0x1 << 10); + buf_size = ROUND_DOWN(buf_size, 0x1 << 10); srrctl |= TXGBE_RXCFG_PKTLEN(buf_size); wr32(hw, TXGBE_RXCFG(rxq->reg_idx), srrctl); -- 2.27.0