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 23F0042409 for ; Wed, 18 Jan 2023 07:04:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0389342D36; Wed, 18 Jan 2023 07:04:15 +0100 (CET) Received: from smtpbguseast1.qq.com (smtpbguseast1.qq.com [54.204.34.129]) by mails.dpdk.org (Postfix) with ESMTP id 7153D410EE; Wed, 18 Jan 2023 07:04:10 +0100 (CET) X-QQ-mid: bizesmtp69t1674021847trwiuu1l Received: from wxdbg.localdomain.com ( [183.129.236.74]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 18 Jan 2023 14:04:06 +0800 (CST) X-QQ-SSF: 01400000000000H0X000B00A0000000 X-QQ-FEAT: ChPCFoAbo1rnppeSQR2aV34zcDRHYtJd+OmOJvWfMi8N12X7kISyG9hWHh7YP wiCF+pNrnDByaTNYAVYcdG8sQ9oqiie1i0oPg04xbsROeImHsAZh/pbNMW+/5CagP/9W1JT xDkzK2TmD84XV3qKYtBnD7Hbqzt0oNJ7q45wWRigfUIFw5xwAe6XP89vgcHbu3A0MO0JryO 8mNoTSSpqZvhdUAlXhlBRuit1+MXN0H25PChwNuUkCorjN7XuYnBi1J8PisgRIM2vEzBCyW UsSl1PE8CWLDJkD63HBu/huCKA+rLZRPw9MOa8L0mdiac83kX6qZ1KB7aKqKn7F8N7e9daa +s8gQZlbdE8twI5bRbAgtjihfgdsTJ4zS5Cec6cnYl/1ScJtgRXne1S5HKTXTwKQyGyCtmj X-QQ-GoodBg: 2 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH 1/8] net/txgbe: fix Rx buffer size in configure register Date: Wed, 18 Jan 2023 14:00:32 +0800 Message-Id: <20230118060039.3074016-2-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