From: Ferruh Yigit <ferruh.yigit@xilinx.com> To: Peng Zhang <peng.zhang@corigine.com>, <dev@dpdk.org>, Niklas Soderlund <niklas.soderlund@corigine.com> Cc: <heinrich.kuhn@corigine.com>, <stable@dpdk.org>, Chaoyong He <chaoyong.he@corigine.com>, Louis Peens <louis.peens@corigine.com> Subject: Re: [PATCH v3] net/nfp: fix mtu settings Date: Wed, 20 Apr 2022 19:54:37 +0100 Message-ID: <e3fa8bd8-84a6-353c-9187-5daff0f7f333@xilinx.com> (raw) In-Reply-To: <20220330031751.119830-1-peng.zhang@corigine.com> On 3/30/2022 4:17 AM, Peng Zhang wrote: > 1.When the setting mtu is higher than flbufsz, the mtu doesn't work. > But it doesn't have any notice about this restrict. > 2.add the min_mtu and max_mtu in the nfp_net_infos_get() to avoid > the setting mtu isn't in the range > > This patch will add these restrict of nfp mtu. > +Niklas, as he is the maintainer of the PMD. Can you please prefer uppercase 'MTU' in title/commit log and error log? I assume scattered_rx is not supported by the device, which enables receiving packets bigger than mbuf data size. > Fixes: d4a27a3b092a ("nfp: add basic features") > Cc: stable@dpdk.org > > Signed-off-by: Peng Zhang <peng.zhang@corigine.com> > Signed-off-by: Chaoyong He <chaoyong.he@corigine.com> > Signed-off-by: Louis Peens <louis.peens@corigine.com> > --- > v3: > * git summary > > v2: > * add the min_mtu and max_mtu in the nfp_net_infos_get() > --- > > drivers/net/nfp/nfp_common.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c > index f8978e803a..4e48e33a63 100644 > --- a/drivers/net/nfp/nfp_common.c > +++ b/drivers/net/nfp/nfp_common.c > @@ -693,6 +693,8 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) > > hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); > > + dev_info->max_mtu = (uint16_t)hw->max_mtu; > + dev_info->min_mtu = RTE_ETHER_MIN_MTU; > dev_info->max_rx_queues = (uint16_t)hw->max_rx_queues; > dev_info->max_tx_queues = (uint16_t)hw->max_tx_queues; > dev_info->min_rx_bufsize = RTE_ETHER_MIN_MTU; > @@ -956,6 +958,13 @@ nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) > return -EBUSY; > } > > + /* the setting mtu is lower than flbufsz */ > + if (mtu > hw->flbufsz) { > + PMD_DRV_LOG(ERR, "the setting mtu must be lower than current mbufsize of %d", You may want to start log with uppercase as done in other logs, for consistency. Also may want to print the MTU value in the log. > + hw->flbufsz); > + return -ERANGE; > + } Should this be checked in 'nfb_eth_dev_configure()' too, where 'dev->data->mtu' can be set? > + > /* writing to configuration space */ > nn_cfg_writel(hw, NFP_NET_CFG_MTU, mtu); >
next prev parent reply other threads:[~2022-04-20 18:54 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <20220317143917.499138-1-peng.zhang@corigine.com> 2022-03-18 11:38 ` [PATCH v2] " Peng Zhang 2022-03-30 3:17 ` [PATCH v3] " Peng Zhang 2022-04-20 18:54 ` Ferruh Yigit [this message] 2022-04-21 0:55 ` Nole Zhang 2022-05-11 1:15 ` [PATCH v4] net/nfp: make sure MTU is never larger than mbufsize Peng Zhang 2022-05-19 7:08 ` Andrew Rybchenko
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=e3fa8bd8-84a6-353c-9187-5daff0f7f333@xilinx.com \ --to=ferruh.yigit@xilinx.com \ --cc=chaoyong.he@corigine.com \ --cc=dev@dpdk.org \ --cc=heinrich.kuhn@corigine.com \ --cc=louis.peens@corigine.com \ --cc=niklas.soderlund@corigine.com \ --cc=peng.zhang@corigine.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
patches for DPDK stable branches This inbox may be cloned and mirrored by anyone: git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \ stable@dpdk.org public-inbox-index stable Example config snippet for mirrors. Newsgroup available over NNTP: nntp://inbox.dpdk.org/inbox.dpdk.stable AGPL code for this site: git clone https://public-inbox.org/public-inbox.git