From: Chaoyong He <chaoyong.he@corigine.com>
To: Harman Kalra <hkalra@marvell.com>, "dev@dpdk.org" <dev@dpdk.org>,
Thomas Monjalon <thomas@monjalon.net>,
Ferruh Yigit <ferruh.yigit@amd.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Ajit Khaparde <ajit.khaparde@broadcom.com>,
Somnath Kotur <somnath.kotur@broadcom.com>,
John Daley <johndale@cisco.com>,
Hyong Youb Kim <hyonkim@cisco.com>,
Yuying Zhang <Yuying.Zhang@intel.com>,
Beilei Xing <beilei.xing@intel.com>,
Qiming Yang <qiming.yang@intel.com>,
Qi Zhang <qi.z.zhang@intel.com>, Wenjun Wu <wenjun1.wu@intel.com>,
Dariusz Sosnowski <dsosnowski@nvidia.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
Ori Kam <orika@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>,
Matan Azrad <matan@nvidia.com>
Subject: RE: [PATCH v4 1/1] ethdev: parsing multiple representor devargs string
Date: Mon, 22 Jan 2024 01:13:31 +0000 [thread overview]
Message-ID: <SJ0PR13MB5545CDA0465C52305B6C1A6F9E752@SJ0PR13MB5545.namprd13.prod.outlook.com> (raw)
In-Reply-To: <20240121191908.156149-2-hkalra@marvell.com>
> -----Original Message-----
> From: Harman Kalra <hkalra@marvell.com>
> Sent: Monday, January 22, 2024 3:19 AM
> To: dev@dpdk.org; Thomas Monjalon <thomas@monjalon.net>; Ferruh Yigit
> <ferruh.yigit@amd.com>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>; Ajit Khaparde
> <ajit.khaparde@broadcom.com>; Somnath Kotur
> <somnath.kotur@broadcom.com>; John Daley <johndale@cisco.com>; Hyong
> Youb Kim <hyonkim@cisco.com>; Yuying Zhang <Yuying.Zhang@intel.com>;
> Beilei Xing <beilei.xing@intel.com>; Qiming Yang <qiming.yang@intel.com>; Qi
> Zhang <qi.z.zhang@intel.com>; Wenjun Wu <wenjun1.wu@intel.com>;
> Dariusz Sosnowski <dsosnowski@nvidia.com>; Viacheslav Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; Suanming Mou
> <suanmingm@nvidia.com>; Matan Azrad <matan@nvidia.com>; Chaoyong
> He <chaoyong.he@corigine.com>
> Cc: Harman Kalra <hkalra@marvell.com>
> Subject: [PATCH v4 1/1] ethdev: parsing multiple representor devargs string
>
> [You don't often get email from hkalra@marvell.com. Learn why this is
> important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Adding support for parsing multiple representor devargs strings passed to a
> PCI BDF. There may be scenario where port representors for various PFs or VFs
> under PFs are required and all these are representor ports shall be backed by
> single pci device. In such case port representors can be created using devargs
> string:
> <PCI BDF>,representor=[pf[0-1],pf2vf[1,2-3],[4-5]]
>
> Signed-off-by: Harman Kalra <hkalra@marvell.com>
> ---
> doc/guides/prog_guide/poll_mode_drv.rst | 4 +-
> .../prog_guide/switch_representation.rst | 1 +
> drivers/net/bnxt/bnxt_ethdev.c | 4 +-
> drivers/net/enic/enic_ethdev.c | 4 +-
> drivers/net/i40e/i40e_ethdev.c | 4 +-
> drivers/net/ice/ice_dcf_ethdev.c | 4 +-
> drivers/net/ixgbe/ixgbe_ethdev.c | 4 +-
> drivers/net/mlx5/linux/mlx5_os.c | 8 +-
> .../net/nfp/flower/nfp_flower_representor.c | 4 +-
> drivers/net/sfc/sfc_ethdev.c | 4 +-
> lib/ethdev/ethdev_driver.c | 108 +++++++++++++++---
> lib/ethdev/ethdev_driver.h | 9 +-
> 12 files changed, 122 insertions(+), 36 deletions(-)
>
> diff --git a/doc/guides/prog_guide/poll_mode_drv.rst
> b/doc/guides/prog_guide/poll_mode_drv.rst
> index c145a9066c..5008b41c60 100644
> --- a/doc/guides/prog_guide/poll_mode_drv.rst
> +++ b/doc/guides/prog_guide/poll_mode_drv.rst
> @@ -376,7 +376,7 @@ parameters to those ports.
>
> * ``representor`` for a device which supports the creation of representor ports
> this argument allows user to specify which switch ports to enable port
> - representors for. Multiple representors in one device argument is invalid::
> + representors for::
>
> -a DBDF,representor=vf0
> -a DBDF,representor=vf[0,4,6,9]
> @@ -389,6 +389,8 @@ parameters to those ports.
> -a DBDF,representor=pf1vf0
> -a DBDF,representor=pf[0-1]sf[0-127]
> -a DBDF,representor=pf1
> + -a DBDF,representor=[pf[0-1],pf2vf[0-2],pf3[3,5-8]]
> + (Multiple representors in one device argument can be represented as
> + a list)
>
> Note: PMDs are not required to support the standard device arguments and
> users should consult the relevant PMD documentation to see support
> devargs.
> diff --git a/doc/guides/prog_guide/switch_representation.rst
> b/doc/guides/prog_guide/switch_representation.rst
> index 6fd7b98bdc..46e0ca85a5 100644
> --- a/doc/guides/prog_guide/switch_representation.rst
> +++ b/doc/guides/prog_guide/switch_representation.rst
> @@ -77,6 +77,7 @@ thought as a software "patch panel" front-end for
> applications.
> -a pci:dbdf,representor=sf1
> -a pci:dbdf,representor=sf[0-1023]
> -a pci:dbdf,representor=sf[0,2-1023]
> + -a pci:dbdf,representor=[pf[0-1],pf2vf[0-2],pf3[3,5]]
>
> - As virtual devices, they may be more limited than their physical
> counterparts, for instance by exposing only a subset of device diff --git
> a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index
> acf7e6e46e..5d4f599044 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -6383,8 +6383,8 @@ static int bnxt_pci_probe(struct rte_pci_driver
> *pci_drv __rte_unused,
>
> if (pci_dev->device.devargs) {
> ret = rte_eth_devargs_parse(pci_dev->device.devargs->args,
> - ð_da);
> - if (ret)
> + ð_da, 1);
> + if (ret < 0)
> return ret;
> }
>
...
> a/drivers/net/nfp/flower/nfp_flower_representor.c
> b/drivers/net/nfp/flower/nfp_flower_representor.c
> index 5f7c1fa737..63fe37c8d7 100644
> --- a/drivers/net/nfp/flower/nfp_flower_representor.c
> +++ b/drivers/net/nfp/flower/nfp_flower_representor.c
> @@ -792,8 +792,8 @@ nfp_flower_repr_create(struct nfp_app_fw_flower
> *app_fw_flower)
>
> /* Now parse PCI device args passed for representor info */
> if (pci_dev->device.devargs != NULL) {
> - ret = rte_eth_devargs_parse(pci_dev->device.devargs->args,
> ð_da);
> - if (ret != 0) {
> + ret = rte_eth_devargs_parse(pci_dev->device.devargs->args,
> ð_da, 1);
> + if (ret < 0) {
> PMD_INIT_LOG(ERR, "devarg parse failed");
> return -EINVAL;
> }
Sorry, I don't quite understand why change 'ret != 0' to 'ret < 0'?
Compare return value with 0 or NULL is the specification for our PMD, we prefer not to change it if don't have a good reason.
Thanks.
> --
> 2.18.0
next prev parent reply other threads:[~2024-01-22 1:13 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-11 6:44 [PATCH 0/2] multiple representors in one device Harman Kalra
2024-01-11 6:44 ` [PATCH 1/2] ethdev: parsing multiple representor devargs string Harman Kalra
2024-01-12 7:25 ` Andrew Rybchenko
2024-01-12 9:37 ` [EXT] " Harman Kalra
2024-01-12 12:42 ` David Marchand
2024-01-15 16:01 ` [EXT] " Harman Kalra
2024-01-11 6:44 ` [PATCH 2/2] doc: multiple representors in one device Harman Kalra
2024-01-12 7:26 ` Andrew Rybchenko
2024-01-15 16:01 ` [EXT] " Harman Kalra
2024-01-15 15:57 ` [PATCH v2 0/1] " Harman Kalra
2024-01-15 15:57 ` [PATCH v2 1/1] ethdev: parsing multiple representor devargs string Harman Kalra
2024-01-16 9:55 ` [PATCH v3 0/1] multiple representors in one device Harman Kalra
2024-01-16 9:55 ` [PATCH v3 1/1] ethdev: parsing multiple representor devargs string Harman Kalra
2024-01-17 8:47 ` Andrew Rybchenko
2024-01-21 19:30 ` [EXT] " Harman Kalra
2024-01-21 19:19 ` [PATCH v4 0/1] multiple representors in one device Harman Kalra
2024-01-21 19:19 ` [PATCH v4 1/1] ethdev: parsing multiple representor devargs string Harman Kalra
2024-01-22 1:13 ` Chaoyong He [this message]
2024-01-22 9:07 ` Harman Kalra
2024-01-22 10:10 ` Chaoyong He
2024-01-25 5:28 ` Harman Kalra
2024-01-26 13:43 ` Ferruh Yigit
2024-01-29 18:20 ` [EXT] " Harman Kalra
2024-01-30 23:09 ` Ferruh Yigit
2024-02-01 10:10 ` Harman Kalra
2024-02-01 10:02 ` [PATCH v5 0/2] multiple representors in one device Harman Kalra
2024-02-01 10:02 ` [PATCH v5 1/2] ethdev: parsing multiple representor devargs string Harman Kalra
2024-02-01 10:02 ` [PATCH v5 2/2] test/devargs: add eth devargs parse cases Harman Kalra
2024-02-01 18:35 ` [PATCH v5 0/2] multiple representors in one device 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=SJ0PR13MB5545CDA0465C52305B6C1A6F9E752@SJ0PR13MB5545.namprd13.prod.outlook.com \
--to=chaoyong.he@corigine.com \
--cc=Yuying.Zhang@intel.com \
--cc=ajit.khaparde@broadcom.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=ferruh.yigit@amd.com \
--cc=hkalra@marvell.com \
--cc=hyonkim@cisco.com \
--cc=johndale@cisco.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=qi.z.zhang@intel.com \
--cc=qiming.yang@intel.com \
--cc=somnath.kotur@broadcom.com \
--cc=suanmingm@nvidia.com \
--cc=thomas@monjalon.net \
--cc=viacheslavo@nvidia.com \
--cc=wenjun1.wu@intel.com \
/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).