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 D498941CA4 for ; Wed, 15 Feb 2023 11:09:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C69F742FFE; Wed, 15 Feb 2023 11:09:28 +0100 (CET) Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) by mails.dpdk.org (Postfix) with ESMTP id E85FF40A8B; Wed, 15 Feb 2023 11:09:24 +0100 (CET) X-QQ-mid: Yeas49t1676455756t479t57924 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> <06ef01d9404c$83820a10$8a861e30$@trustnetic.com> <3053d862-ba1d-b064-1b59-f39cad9ab89a@amd.com> In-Reply-To: Subject: RE: [PATCH v2 01/10] net/ngbe: fix Rx buffer size in configure register Date: Wed, 15 Feb 2023 18:09:06 +0800 Message-ID: <074e01d94125$89b9f080$9d2dd180$@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+1AkW9BhkCExTCswI9ooAlAXacdpgB7lJC9gA3+K1YrhzLcVA= 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 Wednesday, February 15, 2023 5:36 PM, Ferruh Yigit wrote: > On 2/14/2023 9:55 AM, Ferruh Yigit wrote: > > On 2/14/2023 8:15 AM, Jiawen Wu wrote: > >> 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? > >>>> > >>> > >>> 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. > >>> > >>> [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); > >>> > >>> dev_info->min_rx_bufsize =3D 1024; > >>> > >>> > >>>>> + 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); > >>>> > >>>> > >>> > >> > >> Hi Ferruh, > >> > >> Is my proposal feasible or do I need to send v3 patch for it? > >> > >> > > > > Sorry Jiawen, I missed your response. > > > > Yes, you are right, 'dev_info->min_rx_bufsize' prevents user to set > > buffer size less than 1K, so change in V1 is good. > > > > There were some other changes too, instead of getting this patch = from > > v1, can you please send a new version with latest updates? >=20 > We can drop 1/10 and you have sent a v3 for 2/10, right? >=20 >=20 Yes.