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 3B4EC41C93 for ; Tue, 14 Feb 2023 09:16:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3301342D36; Tue, 14 Feb 2023 09:16:04 +0100 (CET) Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) by mails.dpdk.org (Postfix) with ESMTP id C3FF040E2D; Tue, 14 Feb 2023 09:15:58 +0100 (CET) X-QQ-mid: Yeas48t1676362545t963t24251 Received: from 7082A6556EBF4E69829842272A565F7C (jiawenwu@trustnetic.com [183.129.236.74]) X-QQ-SSF: 00400000000000F0FL9000000000000 From: =?utf-8?b?Smlhd2VuIFd1?= To: "'Ferruh Yigit'" , Cc: References: <20230118060039.3074016-1-jiawenwu@trustnetic.com> <20230202092132.3271910-1-jiawenwu@trustnetic.com> <20230202092132.3271910-2-jiawenwu@trustnetic.com> <057601d93c64$ebb69d30$c323d790$@trustnetic.com> In-Reply-To: <057601d93c64$ebb69d30$c323d790$@trustnetic.com> Subject: RE: [PATCH v2 01/10] net/ngbe: fix Rx buffer size in configure register Date: Tue, 14 Feb 2023 16:15:35 +0800 Message-ID: <06ef01d9404c$83820a10$8a861e30$@trustnetic.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-Language: zh-cn Thread-Index: AQIBtVZXYxbb1ShePjndn/GGR7Jz2QIPMp+1AkW9BhkCExTCswI9ooAlrjgASrA= X-QQ-SENDSIZE: 520 Feedback-ID: Yeas: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 On Thursday, February 9, 2023 5:00 PM, Jiawen Wu wrote: > On Wednesday, February 8, 2023 6:28 PM, Ferruh Yigit wrote: > > On 2/2/2023 9:21 AM, Jiawen Wu wrote: > > > 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 =3D = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mb_pool) - > > > RTE_PKTMBUF_HEADROOM); > > > - buf_size =3D ROUND_DOWN(buf_size, 0x1 << 10); > > > + if (buf_size < 1024) > > > + buf_size =3D ROUND_UP(buf_size, 0x1 << 10); > > > > Back to original problem statement in previous version, can't this > > cause HW to receive packets exceeding the buffer size? > > > > If HW accepts buffer size in multiple of 1K, does this mean any = buffer > > size less than 1K is an error condition for this HW? > > >=20 > After rechecking the code, the minimum buffer size is limited to 1K by = the > txgbe/ngbe [1]. > I think v1 patch for txgbe is enough. >=20 > [1] > static int > txgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info = *dev_info) { > struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > struct txgbe_hw *hw =3D TXGBE_DEV_HW(dev); >=20 > dev_info->min_rx_bufsize =3D 1024; >=20 >=20 > > > + else > > > + buf_size =3D ROUND_DOWN(buf_size, 0x1 << 10); > > > srrctl |=3D NGBE_RXCFG_PKTLEN(buf_size); > > > > > > wr32(hw, NGBE_RXCFG(rxq->reg_idx), srrctl); > > > > >=20 Hi Ferruh, Is my proposal feasible or do I need to send v3 patch for it?