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 5D01543921; Mon, 22 Jan 2024 02:13:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DBECB402C9; Mon, 22 Jan 2024 02:13:35 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2103.outbound.protection.outlook.com [40.107.96.103]) by mails.dpdk.org (Postfix) with ESMTP id 397C740291 for ; Mon, 22 Jan 2024 02:13:34 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lAaaN5fCKEevAZ1gYA2n7vWxXF4vSoGOrbTi5EwvHmYdI54QHoMfbcq97gvc+x8tY8W7sWywWaDSvrwFhu+u/E+EiqtEB3cT14r1YyjXn8AZRCqXeetYrmVssreB5afXB+Fr2/XjX6gWo160IcPU2TszaC6Dr0DquuTQdSQO2595dZDtH4rkyu0k2uZPLoaozvFwj6joaIWTfcxNJjK+eZ2cuOzdBC1Z2hcfuCAMSkPQ+/3/bQCxAdj6q8KqO9kXDu3bNkpZvjE0uj8FdqXZZTmjdAg54FmE/Dn/clxZAJ4Qnkf2F+UHx+X6zBR71VmH6isJzhz0gFsuaqFPLb+7oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gTr6d82HaHOeOp1h2HZUZKj0lfzL7kot/LG5W8vG3pg=; b=Bv197o6u4oYEeoef4hDuiTNwzd+dD0xU4+N1U0bsMi2i+gqAnDIRJOn4N3cyHlo8UmDUs5U/qeVtdtnNk0fA2hZlhg4edqmIHEB82hm/xXAw4rHod6Gojd+UqoMS3l7EJ2Ll+JMsERWC3NaRxyLzyofcLk6B5320XwgxZKqye7TKenC7AaYl0eiP89RF2n14SjNacftw26QTv04l99l7czQ2jWi/OB7fqz4gOR4mDXQv4+yXSUGIG7y07Vps2yxIhOXqA8ppawo3YYn4wVdyUB/iFaV3qRDP4I6hYQJezzO/kYMsItKbI2YrjN2wHIB+UsQazvIfNIb1OQXXvEV09Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gTr6d82HaHOeOp1h2HZUZKj0lfzL7kot/LG5W8vG3pg=; b=AeyUvQTC/aR8a6QPMvvdzsP58TVKkAMKdoJb+kXZQhrG8z33tB9YuNXWpl++pZCGkQnF4PQE0NKS5Sa6m+XYFyE39rXawCa0v8ZUsl2yu6cXXDsfbN+kB3mdBBhl6CZx02mwI85ny/7/tqbtr9/xgnlEBZ8tyWXQDUeYRlekls0= Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by BN0PR13MB4728.namprd13.prod.outlook.com (2603:10b6:408:123::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.32; Mon, 22 Jan 2024 01:13:31 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::8e02:f738:570a:f8aa]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::8e02:f738:570a:f8aa%7]) with mapi id 15.20.7202.031; Mon, 22 Jan 2024 01:13:31 +0000 From: Chaoyong He To: Harman Kalra , "dev@dpdk.org" , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Ajit Khaparde , Somnath Kotur , John Daley , Hyong Youb Kim , Yuying Zhang , Beilei Xing , Qiming Yang , Qi Zhang , Wenjun Wu , Dariusz Sosnowski , Viacheslav Ovsiienko , Ori Kam , Suanming Mou , Matan Azrad Subject: RE: [PATCH v4 1/1] ethdev: parsing multiple representor devargs string Thread-Topic: [PATCH v4 1/1] ethdev: parsing multiple representor devargs string Thread-Index: AQHaTJ7DLsYJJ7RLuUOMADEyzs82ZrDlBaIQ Date: Mon, 22 Jan 2024 01:13:31 +0000 Message-ID: References: <20240111064432.193119-1-hkalra@marvell.com> <20240121191908.156149-1-hkalra@marvell.com> <20240121191908.156149-2-hkalra@marvell.com> In-Reply-To: <20240121191908.156149-2-hkalra@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR13MB5545:EE_|BN0PR13MB4728:EE_ x-ms-office365-filtering-correlation-id: b730f58b-f9ee-4bc4-5392-08dc1ae758f2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cDlRBkGeFRBtRAsY38EHqM0zWOX/6L4uDiBeiFhk+ZMM9LDVWq7OjGtch+F+nWboKPuUPxGDRzCDStkFaPFLXpBi4YqE5Oj0k/Kq1NAzuMXhVInKuyAERgstwD+ZXKxOjo6HCho3UHFJuTQttrSgYPbLkyq0FOLyNdc14ZNh1aiueaxQPu4pR43SRODH1XUQLF0rEOISiifEvINhop57lzUDPLFcLUul4PkX87BmWopWvoA0IRu7g85Ntig5J9riB8Q1LUk7dNoBKxY2fEH9ycYHpvZtfZSQ22mv2SQiQnSMLqzmc/VkqwJTxF6U7NNVc+ELYG/70pEr38sB8H3eZQwlqN35Rrt0UNzZNi1JME4gSik3e4HdyJNgHAw2toA7uQ9KzK2Yw5Zb31880drx2Pru4emMUki1cRY/zMAJD71o30K8taH7IV+HYmRRZOtp2m38Vm9ZYBttQFdFNSMsPa4oGSx+u6QkQCKda/dv8sqditphfVn9AHTTMA6T1q3LPMyEgzMu4u0dLKfL9j11vLJ4gU1+WNo3fAMiyhxdjLZZP/qhOGot4/bwJqSLs76DxH7YydfILns1vvDqc9097Wo510HUQYcfvw9w71KvKTYgKzANGXlaQaJ+TR5FcbyK9lKVDM3tUZBcnkHXJEVBq0vMXlvyFxGmauxSiD4FCpfMFbfATZE7znkZgjUafCJM3ZnfdbhUbsTN/7F920chgw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(396003)(39830400003)(366004)(376002)(136003)(230922051799003)(230173577357003)(230473577357003)(230273577357003)(230373577357003)(64100799003)(451199024)(1800799012)(186009)(55016003)(7696005)(6506007)(71200400001)(53546011)(9686003)(122000001)(86362001)(921011)(33656002)(38070700009)(41300700001)(52536014)(44832011)(83380400001)(5660300002)(7416002)(2906002)(38100700002)(66446008)(8676002)(8936002)(966005)(66556008)(110136005)(66476007)(64756008)(76116006)(66946007)(316002)(478600001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?fN19wPHgHWrAAHCUgB0z0ay4GDmapV+gwudOfFtkc/pSRnuM4hJ+jggHMVla?= =?us-ascii?Q?vS45sWRNC5QY5dKRGHsko5jcis9oXdWKph96M0v5K0g0V2Qsny2PAA1FUwJI?= =?us-ascii?Q?ubf9XkeGgTfdJuM9nYBgfCcMrD5mqwRZ0eZNNgcYI0mWortFGmSkf8JN2dSx?= =?us-ascii?Q?nO3SvNEZtSSQSnTRRiP/T17cwCAidwcLWcuHbPmHTMVVdzIFn5x2hj+3LAyD?= =?us-ascii?Q?8d2O/+F+8mH6FXWrhCBJlB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-ascii?Q?48x6LE+pCkrKVVcqkydUdi/nOeXyylGgFTxojiYfF9L/zcvDjIsilrXm8gCa?= =?us-ascii?Q?2CRtPujByq7ov2DiC359Pdg+GlHXh08lnpv9AvX/C5n160sp3R9d88d6ZZnn?= =?us-ascii?Q?eh9xbv1pcCDdK92eHUbSpRxuMZyjvA2KzPwYfPII/4vF5LZtPDjqYFMKdU3N?= =?us-ascii?Q?qaD+ykseQNA4Gn9BneTp4DgNQP3GnzhsDIIvQEMjDIS4nbH9tchTX7YFyogQ?= =?us-ascii?Q?w3R0IMUZZ1ctj70WnJYr7Xiqk9kbcjUCV1pijYIs3tG6esuZQ9LZ5XUeGDlX?= =?us-ascii?Q?U9fwsbH/QTleJO+np0bXLTBdJHfKvb5F64yjWuKNipcXv30fFzf/cwuh7uCh?= =?us-ascii?Q?fo/v8iS44h2+Jd+JgA/CsJsg7hcCQpmGJjhfAMY22F0Bthdv/xzK4R/SQGPM?= =?us-ascii?Q?9GQ0fOti4/u5Jzy4w3c=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b730f58b-f9ee-4bc4-5392-08dc1ae758f2 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jan 2024 01:13:31.1773 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8MXzrsPNNtCX9GM0Ys7PfOJF5Hl2cPQxDFcZsULfK9K34vLnT2gkojs8UPPiR3e01/lvsg4mpOoQf0pWaitsRRQcGWu6HGkzhTcGcNtik7I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR13MB4728 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Harman Kalra > Sent: Monday, January 22, 2024 3:19 AM > To: dev@dpdk.org; Thomas Monjalon ; Ferruh Yigit > ; Andrew Rybchenko > ; Ajit Khaparde > ; Somnath Kotur > ; John Daley ; Hyong > Youb Kim ; Yuying Zhang ; > Beilei Xing ; Qiming Yang ;= Qi > Zhang ; Wenjun Wu ; > Dariusz Sosnowski ; Viacheslav Ovsiienko > ; Ori Kam ; Suanming Mou > ; Matan Azrad ; Chaoyong > He > Cc: Harman Kalra > Subject: [PATCH v4 1/1] ethdev: parsing multiple representor devargs stri= ng >=20 > [You don't often get email from hkalra@marvell.com. Learn why this is > important at https://aka.ms/LearnAboutSenderIdentification ] >=20 > 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 backe= d by > single pci device. In such case port representors can be created using de= vargs > string: > ,representor=3D[pf[0-1],pf2vf[1,2-3],[4-5]] >=20 > Signed-off-by: Harman Kalra > --- > 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(-) >=20 > 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. >=20 > * ``representor`` for a device which supports the creation of represento= r ports > this argument allows user to specify which switch ports to enable port > - representors for. Multiple representors in one device argument is inva= lid:: > + representors for:: >=20 > -a DBDF,representor=3Dvf0 > -a DBDF,representor=3Dvf[0,4,6,9] > @@ -389,6 +389,8 @@ parameters to those ports. > -a DBDF,representor=3Dpf1vf0 > -a DBDF,representor=3Dpf[0-1]sf[0-127] > -a DBDF,representor=3Dpf1 > + -a DBDF,representor=3D[pf[0-1],pf2vf[0-2],pf3[3,5-8]] > + (Multiple representors in one device argument can be represented as > + a list) >=20 > 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=3Dsf1 > -a pci:dbdf,representor=3Dsf[0-1023] > -a pci:dbdf,representor=3Dsf[0,2-1023] > + -a pci:dbdf,representor=3D[pf[0-1],pf2vf[0-2],pf3[3,5]] >=20 > - 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, >=20 > if (pci_dev->device.devargs) { > ret =3D rte_eth_devargs_parse(pci_dev->device.devargs->ar= gs, > - ð_da); > - if (ret) > + ð_da, 1); > + if (ret < 0) > return ret; > } >=20 ... > 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) >=20 > /* Now parse PCI device args passed for representor info */ > if (pci_dev->device.devargs !=3D NULL) { > - ret =3D rte_eth_devargs_parse(pci_dev->device.devargs->ar= gs, > ð_da); > - if (ret !=3D 0) { > + ret =3D rte_eth_devargs_parse(pci_dev->device.devargs->ar= gs, > ð_da, 1); > + if (ret < 0) { > PMD_INIT_LOG(ERR, "devarg parse failed"); > return -EINVAL; > } Sorry, I don't quite understand why change 'ret !=3D 0' to 'ret < 0'? Compare return value with 0 or NULL is the specification for our PMD, we pr= efer not to change it if don't have a good reason. Thanks. > -- > 2.18.0