From: "Jiawen Wu" <jiawenwu@trustnetic.com>
To: "'Ferruh Yigit'" <ferruh.yigit@amd.com>, <dev@dpdk.org>
Cc: <stable@dpdk.org>
Subject: RE: [PATCH v2 01/10] net/ngbe: fix Rx buffer size in configure register
Date: Wed, 15 Feb 2023 18:09:06 +0800 [thread overview]
Message-ID: <074e01d94125$89b9f080$9d2dd180$@trustnetic.com> (raw)
In-Reply-To: <d2c532a6-d04c-c8fd-75b8-b14756c29e70@amd.com>
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 <jiawenwu@trustnetic.com>
> >>>>> ---
> >>>>> 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);
> >>>>
> >>>> 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 = RTE_ETH_DEV_TO_PCI(dev);
> >>> struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
> >>>
> >>> dev_info->min_rx_bufsize = 1024;
> >>>
> >>>
> >>>>> + else
> >>>>> + buf_size = ROUND_DOWN(buf_size, 0x1 << 10);
> >>>>> srrctl |= 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?
>
> We can drop 1/10 and you have sent a v3 for 2/10, right?
>
>
Yes.
next prev parent reply other threads:[~2023-02-15 10:09 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230118060039.3074016-1-jiawenwu@trustnetic.com>
2023-01-18 6:00 ` [PATCH 1/8] net/txgbe: " Jiawen Wu
2023-01-27 15:36 ` Ferruh Yigit
2023-02-01 2:34 ` Jiawen Wu
2023-02-01 10:40 ` Ferruh Yigit
2023-01-18 6:00 ` [PATCH 2/8] net/txgbe: fix default signal quality value for KX/KX4 Jiawen Wu
2023-01-18 6:00 ` [PATCH 3/8] net/txgbe: fix packet type to parse from offload flags Jiawen Wu
2023-01-27 15:36 ` Ferruh Yigit
2023-02-01 3:14 ` Jiawen Wu
2023-02-01 10:41 ` Ferruh Yigit
2023-01-18 6:00 ` [PATCH 4/8] net/ngbe: " Jiawen Wu
2023-01-27 15:37 ` Ferruh Yigit
2023-01-18 6:00 ` [PATCH 5/8] net/ngbe: add spinlock protection on YT PHY Jiawen Wu
[not found] ` <20230202092132.3271910-1-jiawenwu@trustnetic.com>
2023-02-02 9:21 ` [PATCH v2 01/10] net/ngbe: fix Rx buffer size in configure register Jiawen Wu
2023-02-08 10:28 ` Ferruh Yigit
2023-02-09 9:00 ` Jiawen Wu
2023-02-14 8:15 ` Jiawen Wu
2023-02-14 9:55 ` Ferruh Yigit
2023-02-15 9:35 ` Ferruh Yigit
2023-02-15 10:09 ` Jiawen Wu [this message]
2023-02-02 9:21 ` [PATCH v2 02/10] net/txgbe: " Jiawen Wu
2023-02-02 9:21 ` [PATCH v2 03/10] net/txgbe: fix default signal quality value for KX/KX4 Jiawen Wu
2023-02-02 9:21 ` [PATCH v2 04/10] net/txgbe: fix packet type to parse from offload flags Jiawen Wu
2023-02-02 9:21 ` [PATCH v2 05/10] net/ngbe: " Jiawen Wu
2023-02-02 9:21 ` [PATCH v2 06/10] net/ngbe: add spinlock protection on YT PHY Jiawen Wu
2023-02-02 9:21 ` [PATCH v2 09/10] net/txgbe: fix interrupt loss Jiawen Wu
2023-02-15 2:00 ` [PATCH v3] net/txgbe: fix Rx buffer size in configure register Jiawen Wu
2023-02-15 10:24 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='074e01d94125$89b9f080$9d2dd180$@trustnetic.com' \
--to=jiawenwu@trustnetic.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).