From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40053.outbound.protection.outlook.com [40.107.4.53]) by dpdk.org (Postfix) with ESMTP id F2D245681 for ; Tue, 10 Jul 2018 12:16:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6QgnKfSTaXPN0aVtfc3Tsf2mF5RuRj0lXJarlvzO6QM=; b=LPhoua+V2WGSmmHMboSJgRKiA5PqKyIIBhGTOyb44o/2KmqZKmkmJJwCzilPAVZhU+12HaTGXQa6yC/+oMnpSBR1tcy6jyOss8A0avmMCqW25XSuL1SCZVjfkBkp2q98MPlyuR9Q9stL/4FZnGRY3qhHeQ/26eHmsO7yW/uOeJs= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4284.eurprd05.prod.outlook.com (52.134.108.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.21; Tue, 10 Jul 2018 10:16:03 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::d9c6:913c:c361:f7b7]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::d9c6:913c:c361:f7b7%6]) with mapi id 15.20.0930.022; Tue, 10 Jul 2018 10:16:03 +0000 From: Shahaf Shuler To: Adrien Mazarguil CC: "dev@dpdk.org" Thread-Topic: [PATCH v4 09/10] net/mlx5: add parameter for port representors Thread-Index: AQHUFDyZ2IKBe6YD0kukdLKGlR6zcaSGzo+ggAFsLYCAAAqtMA== Date: Tue, 10 Jul 2018 10:16:03 +0000 Message-ID: References: <20180704172322.22571-1-adrien.mazarguil@6wind.com> <20180705083934.5535-1-adrien.mazarguil@6wind.com> <20180705083934.5535-10-adrien.mazarguil@6wind.com> <20180710093723.GI5211@6wind.com> In-Reply-To: <20180710093723.GI5211@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB4284; 7:wyPvGzN2cz8QXrGdJ/Xvq2kXyNMHQ0tVCIJHQSTKRTGYM54LWBT0Ztve7p2zVWj18ww+6OcJZKygB9Gd77v6sRag9DDeVher0QooWes7SNwcb3ugZOuyuO9rluzb8ajLTY3HKrxj7L0yiIVE8T29F7kM1eiI2G3dzUeCEK6C8C4DY2YsqLYJWlmVCe9n5AYi2yV8KKJE+rAWFMk+i+o95zVMzZAjSj3f4ZhSpCzfc8FkM1mGYsNARNR6pUhUc1Bl x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 619e0923-4319-4cfc-91dc-08d5e64e24a4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4284; x-ms-traffictypediagnostic: DB7PR05MB4284: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB4284; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4284; x-forefront-prvs: 0729050452 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(376002)(346002)(39860400002)(396003)(199004)(189003)(14454004)(26005)(5250100002)(8936002)(186003)(6506007)(2900100001)(6916009)(81166006)(81156014)(97736004)(55016002)(93886005)(102836004)(478600001)(486006)(229853002)(105586002)(476003)(106356001)(66066001)(76176011)(7736002)(446003)(33656002)(8676002)(6246003)(6436002)(2906002)(9686003)(53936002)(6116002)(74316002)(68736007)(4326008)(3846002)(316002)(256004)(5660300001)(25786009)(305945005)(86362001)(7696005)(99286004)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4284; H:DB7PR05MB4426.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 0vaE0VBrcgrakJCqOWUTMIY/c8ZW8FAntCcsvW3Df2ZJtJRIglyeE/WmL9CvpALS//WT1kuSeld/AyvZoZV36Yc/uhOmYiqtFFsmk4JEPenPrFQ9N98K24E4DIjjL80x0ux40ADhamhpf5a+bfeiLHXZTrNznzCYF/i2/99vh+W48auAa3/sgA06KKii5ikUb5C8aeDoXMKhKSHv0Sfo4t3pzxYjCDLKvO5HtPQq3CEpqbhqcwnVPQ7GFfqPpNFIiJSgsYY8iVPpbc4/fKvQjjMamZugs+FlPzYDqBpIAG3pUqL2zhxxhwrZfhM6CEX+SkzQgCN3PTz2lZQ3PNx8uAMdds/3fS+kYN/8m/x9jec= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 619e0923-4319-4cfc-91dc-08d5e64e24a4 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jul 2018 10:16:03.8525 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4284 Subject: Re: [dpdk-dev] [PATCH v4 09/10] net/mlx5: add parameter for port representors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2018 10:16:05 -0000 Tuesday, July 10, 2018 12:37 PM, Adrien Mazarguil: > Subject: Re: [PATCH v4 09/10] net/mlx5: add parameter for port > representors >=20 > On Mon, Jul 09, 2018 at 11:57:37AM +0000, Shahaf Shuler wrote: > > Thursday, July 5, 2018 11:46 AM, Adrien Mazarguil: > > > Subject: [PATCH v4 09/10] net/mlx5: add parameter for port > > > representors > > > > > > Prior to this patch, all port representors detected on a given > > > device were probed and Ethernet devices instantiated for each of them= . > > > > > > This patch adds support for the standard "representor" parameter, > > > which implies that port representors are not probed by default > > > anymore, except for the list provided through device arguments. > > > > > > (Patch based on prior work from Yuanhan Liu) > > > > > > Signed-off-by: Adrien Mazarguil > > > Reviewed-by: Xueming Li > > > -- > > > v3 changes: > > > > > > - Adapted representor detection to the reworked mlx5_dev_spawn(). > > > > @@ -672,7 +679,9 @@ mlx5_uar_init_secondary(struct rte_eth_dev > *dev) > > > * > > > * @return > > > * A valid Ethernet device object on success, NULL otherwise and > rte_errno > > > - * is set. > > > + * is set. The following error is defined: > > > + * > > > + * EBUSY: device is not supposed to be spawned. > > > */ > > > static struct rte_eth_dev * > > > mlx5_dev_spawn(struct rte_device *dpdk_dev, @@ -723,6 +732,26 @@ > > > mlx5_dev_spawn(struct rte_device *dpdk_dev, > > > int own_domain_id =3D 0; > > > unsigned int i; > > > > > > + /* Determine if this port representor is supposed to be spawned. */ > > > + if (switch_info->representor && dpdk_dev->devargs) { > > > + struct rte_eth_devargs eth_da; > > > + > > > + err =3D rte_eth_devargs_parse(dpdk_dev->devargs->args, > > > ð_da); > > > + if (err) { > > > + rte_errno =3D -err; > > > + DRV_LOG(ERR, "failed to process device arguments: > > > %s", > > > + strerror(rte_errno)); > > > + return NULL; > > > + } > > > + for (i =3D 0; i < eth_da.nb_representor_ports; ++i) > > > + if (eth_da.representor_ports[i] =3D=3D > > > + (uint16_t)switch_info->port_name) > > > + break; > > > + if (i =3D=3D eth_da.nb_representor_ports) { > > > + rte_errno =3D EBUSY; > > > > Why EBUSY is the correct errno? Will another attempts to probe the devi= ce > can be successful? >=20 > That's the definition of EAGAIN :) >=20 > I thought EBUSY in the sense of "don't disturb" would be appropriate. Thi= s > value was also chosen because it is not likely to be returned by any > intermediate function calls. I've defined EBUSY along with the return val= ue of > this function for clarity (see above). Any suggestion? How about ENODEV ? >=20 > -- > Adrien Mazarguil > 6WIND