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 D9559A0C4C; Sat, 28 Aug 2021 15:22:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 662D040150; Sat, 28 Aug 2021 15:22:44 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (unknown [40.107.95.54]) by mails.dpdk.org (Postfix) with ESMTP id 491FF40143 for ; Sat, 28 Aug 2021 15:22:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nqbh8n8OkykwY7u0cYRDyWwlueRx5K15WVEueBR19WM9VQ599gPnM4Huw1tBtTxkhX0yTPQTCrmNTTcosrBomA5L/UOVAssdMLIx34/Q1n14WW+Ys8Einy+p4QOokLEayeKLqeVszKN2E8mYQieQkFhu54MM3jbkbo6TtSWOkQUbHA7ucGgVeASB5gvuravGEA8fc9yxpzuov1EcsubzDG19nISkOxPZsayviSyPvMKtun/l50CfzCodYUm/uEulEZOlFya6dmnrv75tqmafCQvoyCA8QNwM9uIh3cmU8ds97iDkwyNjbIy7CF2PFkMshrCKlD9vYzDGzI2D5Cre+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-SenderADCheck; bh=YGGsqH2+IRcbi37gxlLyXyD/YgUuSLRIlpXJyIiervo=; b=Wt+SRE5F16raYiLblOixp+iCoSiUzTCKWiw/4r2laIyzu2IIAGachDPq6qOdcG/lLLhIUd+uU7BXI3GwyXzP2v/9a2N67SbuhBaRj/x5wYS8QdyzArnLDIMLGnq6ZD+bXZgubrk0cLxjdscLKN0hlRhIQLFYRcOg5zTaQ/sKjOZDqnnVzFjOdN1dDUjC1Bb3IaI8Gie5zwZaAPhGr6jvHYZPeazgKR4FcPJLvSWHhMieLH9EEVNPPJ4g2MRUYlXQs11RXooWp4fQ2uYdMzG1MwfXJfDO7uw0u/K3i/CfTFiFIw4a0oi6aGbgPJw7qfeg5vK2ZgHkj/WSUSWZ1suopQ== 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=YGGsqH2+IRcbi37gxlLyXyD/YgUuSLRIlpXJyIiervo=; b=O2IiQCppQOWjptGx12CGesXOCJWsJTjO1ue4iJzMaJ2fzdduy0C+Nb967eZd0XR6dXHoYD3H8IoOBToTsHgRlh/nJYrsDF6/Uho9VMU+AJ4XHL7517Ib7yr7IQmVwECDh23z+EsNdo9qFl+/zH10oGfdD8Y6DWsV6qNTQsqg/S9XFh5npsr+vPujG7W1+v3AyD0mvci5CZZxtwJmtujm/BfeHXiOQFats5C6aPeh7zzt5yV5reIch9FDZ/FMjhXqtPjOrSgovPD7l6ItbzHDNoOB9tW2FAtoRY9Pw/QGkdxXda83W/C/YfytG3QrVi0WNAJEGszB2EjVZNLONiSDyg== Received: from DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) by DM4PR12MB5101.namprd12.prod.outlook.com (2603:10b6:5:390::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.20; Sat, 28 Aug 2021 13:22:40 +0000 Received: from DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::20f5:dbdd:64b1:617b]) by DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::20f5:dbdd:64b1:617b%9]) with mapi id 15.20.4415.023; Sat, 28 Aug 2021 13:22:40 +0000 From: "Xueming(Steven) Li" To: Viacheslav Galaktionov CC: Andrew Rybchenko , Ajit Khaparde , Somnath Kotur , John Daley , Hyong Youb Kim , Beilei Xing , Qiming Yang , Qi Zhang , Haiyue Wang , Matan Azrad , Shahaf Shuler , Slava Ovsiienko , NBU-Contact-Thomas Monjalon , Ferruh Yigit , "dev@dpdk.org" Thread-Topic: [PATCH v2] ethdev: fix representor port ID search by name Thread-Index: AQHXlDllfmkq6KXETEOza9FJTMyvfquHH0aQgAAJkQCAAc2K0A== Date: Sat, 28 Aug 2021 13:22:40 +0000 Message-ID: References: <20210712161747.958019-1-andrew.rybchenko@oktetlabs.ru> <20210818140004.2812575-1-andrew.rybchenko@oktetlabs.ru> <9f94fd99973050392ba5c37f9dbacec0@oktetlabs.ru> In-Reply-To: <9f94fd99973050392ba5c37f9dbacec0@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: ac93f551-e678-4679-3e4e-08d96a26e961 x-ms-traffictypediagnostic: DM4PR12MB5101: 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:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NB2wetRgOh6JEBMD+evfVSgVdBNVOBQ5XBEdWD0hno/y9S7KeA39r4vzzGBCFx8IVuHer4PE+x7841Q7vHdkSOBxApggerkc8iTG6socURxchyjEaRaqI3CXfkvk9S6/QerA9Yy7t3QKGWxjrg5k7692MY8XFgHwQDe8dcz567xEu/h3kxvI000XjSgXieG7fN7NA2Vd3lISGab4a4EbpI10DvOOcB1KVOyyd/W47bYSByRj9odV+BZEBXq6RkYjtEAIZsVVxz3nn+ZPWRsdlUEmpNYM6eKuXpTuliXgaIsxmDGpRDKPoRgU6n2LO3Erqd4fE67EW8sRB1aDFno3g3YjbR+qVFhWgPHqz8pEFarOCNI1OBw4CZMSlKF3W1Mf5qFLNwFzPhuFgz87SpyLwP0OtGIG1AQI1TueuvFBQovh5FeqFWZjye1E7xYGkd+dW2Lwm12iOY1vUImOwKCaNGe3ft+pfh8MF+C1zkDMCHgP57WnK8KY6KvdGEMzUvI06wyr9tmsf2HL4PRREqBJMybJRKXu+RTU9oDXK+e7WCtTMpB6bRTxu7YBlTMeExT+IFJxQC6xyMAMjCIccm5HrWuvA4Uj2dmJZhG5Mr0Xc7XjUNtJB4E2cR9SJBaL5Ku7s7ACOMDbtkOq6YuA0F7c7nCDt/EK9Hhfg2B3xFGaxLAiUobX+/VnpwkUPlnh+OiTvqH3V4582b2TBmQUCGijQw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5373.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(366004)(376002)(136003)(396003)(346002)(478600001)(4326008)(7416002)(83380400001)(186003)(9686003)(66946007)(53546011)(26005)(71200400001)(7696005)(38070700005)(33656002)(122000001)(54906003)(86362001)(52536014)(316002)(6506007)(66446008)(76116006)(66556008)(8676002)(66476007)(55016002)(8936002)(2906002)(64756008)(38100700002)(5660300002)(6916009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?S+vVCfKMZnMDg2xY+Y9a6JZRBosbpkDJ3rP6gYil9iXDkcHz7QH7FkmrP0xk?= =?us-ascii?Q?Xv3R6MYkXmpzkmZPPeq4EOBUn14W/jvPYAoLa3BUuEyOfTJ88hr0Ix4/S3Qf?= =?us-ascii?Q?c/I4tSw7R/uwu9fsKuwElsR0W3k5UWR2950RXYHZa1RGQFVoZoCni1H56af7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prTSeEe9Qms4UqqdkTANme?= =?us-ascii?Q?nXIoGcgpfWxRx3grWXk+VPlQMANet9v+RMVVidcsM3HPqTkBbyYgV2VFQTup?= =?us-ascii?Q?+SxhdLvFKL2frFTLl+wjkMtWQvE09lR7VH2mYXwWgvmWJPt8XNuFYOOcTkBv?= =?us-ascii?Q?4FGd35Fr6SU7xUJ4vwmrR5iHJTke8tt1YHdH9bNY/xiygDa6Ie5diDwAu/z/?= =?us-ascii?Q?5Ao3AlfXll+tkLSvoxTbP0IlqDAwdvhynLL+4sJNCGSLTWVe5IkES3SYLBU4?= =?us-ascii?Q?EvH9ugTyHx7fzkuac9mgGBwj?= 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: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac93f551-e678-4679-3e4e-08d96a26e961 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Aug 2021 13:22:40.4868 (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: A6NLFF5rt3B8rG0W5cFYb0vwOnBQfLuPagi2nWDFccY6tulSGbXpdW73B8YH/LiTaccPJZq8KN1LJViTAzwPnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5101 Subject: Re: [dpdk-dev] [PATCH v2] 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" > -----Original Message----- > From: Viacheslav Galaktionov > Sent: Friday, August 27, 2021 5:48 PM > To: Xueming(Steven) Li > Cc: Andrew Rybchenko ; Ajit Khaparde ; Somnath Kotur > ; John Daley ; Hyong Youb= Kim ; Beilei Xing > ; Qiming Yang ; Qi Zhang ; Haiyue Wang > ; Matan Azrad ; Shahaf Shuler ; Slava Ovsiienko > ; NBU-Contact-Thomas Monjalon ; Ferruh Yigit ; > dev@dpdk.org > Subject: Re: [PATCH v2] ethdev: fix representor port ID search by name >=20 > On 2021-08-27 12:18, Xueming(Steven) Li wrote: > >> -----Original Message----- > >> From: Andrew Rybchenko > >> Sent: Wednesday, August 18, 2021 10:00 PM > >> To: Ajit Khaparde ; Somnath Kotur > >> ; John Daley ; Hyong > >> Youb Kim ; Beilei Xing ; > >> Qiming Yang ; Qi Zhang ; > >> Haiyue Wang ; Matan Azrad ; > >> Shahaf Shuler ; Slava Ovsiienko > >> ; NBU-Contact-Thomas Monjalon > >> ; Ferruh Yigit > >> Cc: dev@dpdk.org; Viacheslav Galaktionov > >> ; Xueming(Steven) Li > >> > >> Subject: [PATCH v2] ethdev: fix representor port ID search by name > >> > >> From: Viacheslav Galaktionov > >> > >> Getting a list of representors from a representor does not make sense. > >> Instead, a parent device should be used. > >> > >> To this end, extend the rte_eth_dev_data structure to include the > >> port ID of the parent device for representors. > >> > >> Signed-off-by: Viacheslav Galaktionov > >> > >> Signed-off-by: Andrew Rybchenko > >> --- >=20 > [snip] >=20 > >> b/drivers/net/mlx5/windows/mlx5_os.c > >> index 7e1df1c751..0c5a02bfcb 100644 > >> --- a/drivers/net/mlx5/windows/mlx5_os.c > >> +++ b/drivers/net/mlx5/windows/mlx5_os.c > >> @@ -543,6 +543,23 @@ 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) { > >> + struct mlx5_priv *opriv =3D > >> + rte_eth_devices[port_id].data->dev_private; > >> + if (opriv && > >> + opriv->master && > >> + opriv->domain_id =3D=3D priv->domain_id && > >> + opriv->sh =3D=3D priv->sh) { > >> + eth_dev->data->parent_port_id =3D > >> + rte_eth_devices[port_id].data->port_id; > > > > Could this value different than port_id? >=20 > Oh, yes, that's an oversight. Thank you! >=20 > >> + break; > >> + } > >> + } > >> + if (port_id >=3D RTE_MAX_ETHPORTS) { > >> + DRV_LOG(ERR, "no master device for representor"); > >> + err =3D ENODEV; > >> + goto error; > > > > Here shouldn't be an error. >=20 > What do you mean? Is it normal not to have a master device for a represen= tor? As discussed before, representor could exists w/o master device, special ca= se. >=20 > > Parent port ID default to 0, it could be wrong if multiple PF probed, > > let's default to current port ID. >=20 > What is the "current" port ID here? Do you mean the representor's port ID= ? Representor port ID. > If you are talking about the value of the port_id variable, then I suppos= e it could be set to RTE_MAX_ETHPORTS explicitly if a master > device isn't found. >=20 > [snip]