From: "Jiang, YuX" <yux.jiang@intel.com>
To: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Thomas Monjalon <thomas@monjalon.net>,
"Yigit, Ferruh" <ferruh.yigit@intel.com>,
"Ajit Khaparde" <ajit.khaparde@broadcom.com>,
Huisong Li <lihuisong@huawei.com>,
"Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
"Xu, Rosen" <rosen.xu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Subject: Re: [dpdk-dev] [PATCH] ethdev: forbid MTU set before device configure
Date: Fri, 29 Oct 2021 05:58:16 +0000 [thread overview]
Message-ID: <SJ0PR11MB5150908EC26C1778EA9DC336FE879@SJ0PR11MB5150.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20211022101828.649441-1-andrew.rybchenko@oktetlabs.ru>
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Andrew Rybchenko
> Sent: Friday, October 22, 2021 6:18 PM
> To: Thomas Monjalon <thomas@monjalon.net>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; Ajit Khaparde <ajit.khaparde@broadcom.com>;
> Huisong Li <lihuisong@huawei.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Xu, Rosen <rosen.xu@intel.com>
> Cc: dev@dpdk.org; Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
> Subject: [dpdk-dev] [PATCH] ethdev: forbid MTU set before device
> configure
>
> From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
>
> rte_eth_dev_configure() always sets MTU to either dev_conf.rxmode.mtu
> or RTE_ETHER_MTU if application doesn't provide the value.
> So, there is no point to allow rte_eth_dev_set_mtu() before since set value
> will be overwritten on configure anyway.
>
> Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length")
>
> Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
> lib/ethdev/rte_ethdev.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index
> 4ea5a657e0..0d7dd68dc1 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -3728,6 +3728,13 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t
> mtu)
> return ret;
> }
>
> + if (dev->data->dev_configured == 0) {
> + RTE_ETHDEV_LOG(ERR,
> + "Port %u must be configured before MTU set\n",
> + port_id);
> + return -EINVAL;
> + }
> +
> ret = (*dev->dev_ops->mtu_set)(dev, mtu);
> if (ret == 0)
> dev->data->mtu = mtu;
> --
> 2.30.2
Hi Ivan,
We meet an issue based on this patch when test dpdk21.11-rc1.
BugID: https://bugs.dpdk.org/show_bug.cgi?id=864, could you pls have a look?
next prev parent reply other threads:[~2021-10-29 5:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-22 10:18 Andrew Rybchenko
2021-10-22 13:21 ` Ferruh Yigit
2021-10-22 13:27 ` Ferruh Yigit
2021-10-29 5:58 ` Jiang, YuX [this message]
2021-10-29 6:19 ` Andrew Rybchenko
2021-10-29 9:22 ` Ferruh Yigit
2021-11-01 9:39 ` Jiang, YuX
2021-11-01 9:42 ` 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=SJ0PR11MB5150908EC26C1778EA9DC336FE879@SJ0PR11MB5150.namprd11.prod.outlook.com \
--to=yux.jiang@intel.com \
--cc=ajit.khaparde@broadcom.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=ivan.ilchenko@oktetlabs.ru \
--cc=konstantin.ananyev@intel.com \
--cc=lihuisong@huawei.com \
--cc=rosen.xu@intel.com \
--cc=thomas@monjalon.net \
/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).