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 1561AA034F; Mon, 11 Oct 2021 09:56:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C0E8410E5; Mon, 11 Oct 2021 09:56:12 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2078.outbound.protection.outlook.com [40.107.244.78]) by mails.dpdk.org (Postfix) with ESMTP id C2695410DA for ; Mon, 11 Oct 2021 09:56:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QSoxjvtyjWGnPDmWqAeOoCs7/Nc8mFQBCZ0KgdfSJDa4VzGiDpOkH/PdMgDnSamfwsZ/fUKdDOFeX+Ee9uMdhX2JyQVhFwhalaOw7FBEZvpUDctfWL5vBLzcoGX16KIuGSy0L7Ezd9ZvYziPGItq7/VLmmUHrBTlIARLirLRHb3VAfdD3v4S4Brhgc1mRBk6k4WEQJtn9ofFsC/CM1nnpzrA+hrpsl661gm6E/eWobCI9NmppxQpWAMgnFO5ZtaikfsVGDvwcnYwClJCJUfHTWgSOBt+u4kG0g86djLkVdDRjrJTy8IeGcX/WPrDfy+mzIQDxRMBXmtQF/hjkx+A+Q== 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=MQ7ahckbQKrM+hnv3cA/eYf/WxvKyXBCJ/+OYTmnkJY=; b=gE1oyiH7Wd3yuXvoZuVSTqymfRBINof1HEA2RbnSYyEI06n8aiZmRnIuE1ahp2KhaUwQ0DK5Dczr4eO0Fz3L+DhMQsQp8at9BBSIgN6/lFBFX84iuKezJsY0h1jRgMfdHuwrQ329y1FfxMBPpKWejtocpn7u3OR7qSIcEJH1GiHqCXoUX9ybQCwAlCwEAP1Fk5DhGdglLoqSjtQ6L2OEaR4HyzjrcQFpaw11+9rwAD9MVfIAiu8xU9RYmBzIfj2iIQRww5VKxskIXa9fJEimJbtn5cntMSgjCrjGhu5hfzViFtnBCLsdSwbNMKRy+RO99qnmHqwkrqbDXuNnB95euQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MQ7ahckbQKrM+hnv3cA/eYf/WxvKyXBCJ/+OYTmnkJY=; b=q+nYt3aZKo4uOATadGlNbW46sFMfqTfx/aYhZJBD99dGEw7J2CSzoIAdn5+xwhm/+4qqX2dxkJme+vz/q/9bNMaRRZJXRjAc6DDKtUfOmHmf/GYdyi9VSvJhX61ATkTHzD2h6qPd7r00M6TLRRjPnom/MByRbCNpsXQ3m9NrTFtyLj7mn43x7lzkj0tv4aTrxcLRP/pbkmy5C1ErWPnM/cowJiwBEq437LzvGqAGZ9EpQrah93kSfi9QmKiHSohc5We8w+/15RGEY/cTouDUniUTsHxJhvlH+0cL11+MPn2YhgkV8kRjLvjG7jO690kzzeUiMHDD3orGwBWhtEhCkg== Received: from DM6PR12MB3753.namprd12.prod.outlook.com (2603:10b6:5:1c7::18) by DM5PR1201MB0267.namprd12.prod.outlook.com (2603:10b6:4:55::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Mon, 11 Oct 2021 07:56:09 +0000 Received: from DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::e550:35a2:96e5:657f]) by DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::e550:35a2:96e5:657f%4]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 07:56:08 +0000 From: Slava Ovsiienko To: Andrew Rybchenko , Ajit Khaparde , Somnath Kotur , John Daley , Hyong Youb Kim , Beilei Xing , Qiming Yang , Qi Zhang , Haiyue Wang , Matan Azrad , NBU-Contact-Thomas Monjalon , Ferruh Yigit CC: "dev@dpdk.org" , Viacheslav Galaktionov , "Xueming(Steven) Li" Thread-Topic: [PATCH v6] ethdev: fix representor port ID search by name Thread-Index: AQHXvCa8l+oN/kH7qEqEdRY1+o2ptqvNcVXQ Date: Mon, 11 Oct 2021 07:56:08 +0000 Message-ID: References: <20210712161747.958019-1-andrew.rybchenko@oktetlabs.ru> <20211008092714.2381365-1-andrew.rybchenko@oktetlabs.ru> In-Reply-To: <20211008092714.2381365-1-andrew.rybchenko@oktetlabs.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a5c5d143-b68e-4e71-1e34-08d98c8c9602 x-ms-traffictypediagnostic: DM5PR1201MB0267: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IWWIe5AqhCUvJKVXcaxpY+FCrAbv5Oi+NCDfB7VSgl0UMV5vKunqCTpnWBzx8qTd9IHCPhlOz//OU0LXhz6ffgY4qxfKTdT0nTrje5XKo8kdigOaZZbPXBVJ/5vbXDrkg/DgTpE0XwosXRo4w0sHhNp9ABBU72rDt9wE8I6n6Wpw3a5PKHOth0TeHGOut0rlF4+3Qvq0zItu8JPuU2X8qxidt7yFIYum6Gr5P6KWiApOuULbjZy8bzQu6XznSUEKq9nRaQ/kwQqUA6WFNYh5lCInl57+F6ksJ6X4xdOVV/8MEEO0Rd5w5rXE0AovFVqhgaxieBzmpd45F6BgG4ZotKGIbRdxEBjCDY4Zw7I8xXJvVmGaZ4DI+vZ4Gjq4UWhgbGF3z8uZyDe3Goxj4GD1H5tx6I9bAVS4eE0LeD4in2mqi5NXwisu/j6m3QnIV6VUbUhqRrQ7Q0IiIfJg3THi+DvagS9CFreo/PHJEoQGYTw39iJsb8/ed1RtV+IohjQkaXyvVwTbd+xVTQFSgI3TWZ4SU0aet69PbjPycTTpGe27wwVAFWQRE+EiTQiLtsSNiWHSM+3YmLAbpIlGcLBIwqdouR1oV13gIoqukxGoislIjypRo/1fI5K82dJggmBYC5g5wL/yvsPFGwTpWFxrxM58P+T35of3oCH7NwHoxPaWf7E3Ebv5rP6C8VKdMRVhcob2OxgiCm7uS5/7B5wKdbE74Xwf+kYMeG49k8X1vbc= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB3753.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(186003)(53546011)(8676002)(33656002)(6506007)(7696005)(8936002)(71200400001)(83380400001)(26005)(122000001)(38100700002)(86362001)(66556008)(38070700005)(7416002)(76116006)(921005)(64756008)(66446008)(66476007)(5660300002)(52536014)(66946007)(316002)(110136005)(54906003)(9686003)(107886003)(55016002)(4326008)(508600001)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?f3kFBWXt49v9Ntr8oKryDXHN+UKaQq1ld4MqYFLUVahiKXx6ltGzx2ZR2Ry4?= =?us-ascii?Q?Ft+xEGESBF0rODWVBUYGDG2i35PEnWVb8BIIG4FwrKOBR0VjXIRpfgE6kP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gtpKNckUkSn+7BIEhiOW3Idu3fih1qoVzgwACHd?= =?us-ascii?Q?0NJamzrg+OK5XSxJbwdFfJ15yT/GzKFOG2UYgr3zm9dr86n5RukA9B675UoX?= =?us-ascii?Q?yBxBKUJaSRkp7ZCpgSKBir3w5Gy9S/Q4ZlhFyStGArh1TpxonZgaFm8pPNKF?= =?us-ascii?Q?JZcl9LuIg0I/ckbltg3v41iUiwQvqxr3B5tKRZfXEnVrXVDmNtxfvtZubQjB?= =?us-ascii?Q?utNz7BnJQBvhp6RpmNKDcJPtjzEmzzWgcEJ2NdtVZcZiGHFeCUBOMo8OjA7B?= =?us-ascii?Q?5/QfZzWDq2LLg6VgynDo4tw1HVP7Rok2MKgjblv1cEjQpqz1xqcMMHPuoCjK?= =?us-ascii?Q?LCc=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3753.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a5c5d143-b68e-4e71-1e34-08d98c8c9602 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2021 07:56:08.8687 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: OPqH8LlJnxA3hcrzqlsHEe8S3xdIvn0x7zpCxAjuRi/dHyvaqG9iXcnq1mMTfxQgdpaE9QCofsIOalwW9RDZDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0267 Subject: Re: [dpdk-dev] [PATCH v6] ethdev: fix representor port ID search by name 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 Sender: "dev" Hi, > -----Original Message----- > From: Andrew Rybchenko > Sent: Friday, October 8, 2021 12:27 > To: Ajit Khaparde ; Somnath Kotur > ; John Daley ; Hyong > Youb Kim ; Beilei Xing ; Qiming > Yang ; Qi Zhang ; Haiyue > Wang ; Matan Azrad ; Slava > Ovsiienko ; NBU-Contact-Thomas Monjalon > ; Ferruh Yigit > Cc: dev@dpdk.org; Viacheslav Galaktionov > ; Xueming(Steven) Li > > Subject: [PATCH v6] ethdev: fix representor port ID search by name >=20 > From: Viacheslav Galaktionov >=20 > The patch is required for all PMDs which do not provide representors info= on > the representor itself. >=20 > The function, rte_eth_representor_id_get(), is used in > eth_representor_cmp() which is required in ethdev class iterator to searc= h > ethdev port ID by name (representor case). Before the patch the function = is > called on the representor itself and tries to get representors info to ma= tch. >=20 > Search of port ID by name is used after hotplug to find out port ID of th= e just > plugged device. >=20 > Getting a list of representors from a representor does not make sense. > Instead, a backer device should be used. >=20 > To this end, extend the rte_eth_dev_data structure to include the port ID= of > the backing device for representors. >=20 > Signed-off-by: Viacheslav Galaktionov > Signed-off-by: Andrew Rybchenko > Acked-by: Haiyue Wang > Acked-by: Beilei Xing > Reviewed-by: Xueming Li ...snip .. =20 > a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c > index 3746057673..612340b3b6 100644 > --- a/drivers/net/mlx5/linux/mlx5_os.c > +++ b/drivers/net/mlx5/linux/mlx5_os.c > @@ -1677,6 +1677,19 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, > if (priv->representor) { > eth_dev->data->dev_flags |=3D RTE_ETH_DEV_REPRESENTOR; > eth_dev->data->representor_id =3D priv->representor_id; > + MLX5_ETH_FOREACH_DEV(port_id, &priv->pci_dev->device) { I would use dpdk_dev here instead of PCI. mlx5 supports SF representors, Aux bus based, so PCI device might be irrele= vant. ..snip .. > b/drivers/net/mlx5/windows/mlx5_os.c > index 26fa927039..a9c244c7dc 100644 > --- a/drivers/net/mlx5/windows/mlx5_os.c > +++ b/drivers/net/mlx5/windows/mlx5_os.c > @@ -543,6 +543,19 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, > if (priv->representor) { > eth_dev->data->dev_flags |=3D RTE_ETH_DEV_REPRESENTOR; > eth_dev->data->representor_id =3D priv->representor_id; > + MLX5_ETH_FOREACH_DEV(port_id, &priv->pci_dev->device) { =20 The same comment about &priv->pci_dev->device Beside this: Acked-by: Viacheslav Ovsiienko