From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40059.outbound.protection.outlook.com [40.107.4.59]) by dpdk.org (Postfix) with ESMTP id 7C2CB1BE8D for ; Wed, 27 Jun 2018 10:28:57 +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=sURDgmSH2yOtUgy6zuD5oU1lul9/ruaA7X/KWa/XKYw=; b=yGRxE/oozGKBqVfIn1QOUYnDaOZ9rE+YCDZ95GbVkaTDevlJv84dJeVHrrlVGlgXy2wqyxgl5WIpuEWjRsXADM7ZQBYI9yEAy0GnuSMQRbukI+TBfkXFkPW7diI/kuHppwhZsEIJiXDlOECeC9JB87uEmBp7DY/NVtcr06YcbMc= Received: from VI1PR0501MB2608.eurprd05.prod.outlook.com (10.168.137.20) by VI1PR0501MB2670.eurprd05.prod.outlook.com (10.172.13.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.23; Wed, 27 Jun 2018 08:28:54 +0000 Received: from VI1PR0501MB2608.eurprd05.prod.outlook.com ([fe80::9dd0:9bdb:fd59:b615]) by VI1PR0501MB2608.eurprd05.prod.outlook.com ([fe80::9dd0:9bdb:fd59:b615%7]) with mapi id 15.20.0884.024; Wed, 27 Jun 2018 08:28:54 +0000 From: Matan Azrad To: Qi Zhang , Thomas Monjalon , "anatoly.burakov@intel.com" CC: "konstantin.ananyev@intel.com" , "dev@dpdk.org" , "bruce.richardson@intel.com" , "ferruh.yigit@intel.com" , "benjamin.h.shelton@intel.com" , "narender.vangati@intel.com" Thread-Topic: [dpdk-dev] [PATCH v3 15/23] net/failsafe: enable port detach on secondary process Thread-Index: AQHUDFTveQjLj4ilZU2XiCvQOniSeKRzyJMA Date: Wed, 27 Jun 2018 08:28:54 +0000 Message-ID: References: <20180607123849.14439-1-qi.z.zhang@intel.com> <20180625071745.16810-1-qi.z.zhang@intel.com> <20180625071745.16810-16-qi.z.zhang@intel.com> In-Reply-To: <20180625071745.16810-16-qi.z.zhang@intel.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0501MB2670; 7:SG3Ns4OJNztbb6J1WBNvhhSxWJHBiRZO9nnT4McicGns5wlFh/0ND5ND56drv4j/W3/beKbSQ9cDD/V/+/5k0uC9/14kY4ydWBrA0x0P8DhZLdJUN8hQx4XdxwjS3LHLNM3BWQ0HyArbzeZjSmeNytvZNAU951YGm9HRiU2IBItEZ0EIzcmdM8xmWyClWwMkePfoW0SMdDiGn+GTTsV6Om91FJ+miGH2KQcx6laipPp2y6dY0KbJ/gxTJYa7FvrS x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: d9331efa-89e7-4754-b393-08d5dc080547 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2670; x-ms-traffictypediagnostic: VI1PR0501MB2670: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:VI1PR0501MB2670; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2670; x-forefront-prvs: 0716E70AB6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(136003)(366004)(39860400002)(189003)(199004)(2501003)(5250100002)(74316002)(14454004)(4326008)(110136005)(8936002)(81166006)(81156014)(316002)(54906003)(229853002)(5024004)(11346002)(476003)(97736004)(14444005)(3846002)(86362001)(6116002)(486006)(256004)(2906002)(106356001)(446003)(68736007)(26005)(2900100001)(6246003)(186003)(105586002)(6346003)(76176011)(33656002)(7696005)(53936002)(55016002)(9686003)(66066001)(478600001)(25786009)(305945005)(99286004)(5660300001)(6436002)(102836004)(6506007)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2670; H:VI1PR0501MB2608.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-microsoft-antispam-message-info: +QuPEQiAFOU0vhaQLjyfWLWoRx+/Wks6CpErvx8cEWVUBEbdn9fAbVTqqCcrj1fKFQzKa6jZaK5RCHTJ3Z3rVtWFWSvNBKLUqygXU2z1m8YzFcTPyIelYWbWwyR9L0aj2MyvGAEoLi+vYVrdX7r7u3wMQoSYTNNKdXJ2z7qSiXlyLaPjBLLJmlivQZTOtxWlAhH2m1NgmCcmijNCkIG+9EGdL4KUyjAvC8PE6tnGb02BCGPUEcSJ3NemtLSl72vN5fR6Xhp/eImgrhLOiGdMQeeGKCX6mPWmkw2GaPtpe0cUS9msgH3GYofgCcHmkIWjtGAKeY2oEE0nETe8X4ZirrLULwVZTC06Y57I28oIIVg= 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: d9331efa-89e7-4754-b393-08d5dc080547 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jun 2018 08:28:54.8602 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2670 Subject: Re: [dpdk-dev] [PATCH v3 15/23] net/failsafe: enable port detach on secondary process 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: Wed, 27 Jun 2018 08:28:58 -0000 Hi Qi From: Qi Zhang > Previously, detach port on secondary process will mess primary process an= d > cause same device can't be attached again, by take advantage of > rte_eth_release_port_private, we can support this with minor change. >=20 > Signed-off-by: Qi Zhang Failsafe doesn't support secondary process, I don't think we need this adjustment for drivers which don't support secon= dary process. =20 > --- > drivers/net/failsafe/failsafe.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) >=20 > diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/fails= afe.c index > eafbb75df..c5e8651f6 100644 > --- a/drivers/net/failsafe/failsafe.c > +++ b/drivers/net/failsafe/failsafe.c > @@ -328,6 +328,7 @@ rte_pmd_failsafe_probe(struct rte_vdev_device *vdev) > } > /* TODO: request info from primary to set up Rx and Tx */ > eth_dev->dev_ops =3D &failsafe_ops; > + eth_dev->device =3D &vdev->device; > rte_eth_dev_probing_finish(eth_dev); > return 0; > } > @@ -338,10 +339,25 @@ rte_pmd_failsafe_probe(struct rte_vdev_device > *vdev) static int rte_pmd_failsafe_remove(struct rte_vdev_device *vdev)= { > + struct rte_eth_dev *eth_dev; > const char *name; >=20 > name =3D rte_vdev_device_name(vdev); > INFO("Uninitializing " FAILSAFE_DRIVER_NAME " for %s", name); > + > + eth_dev =3D rte_eth_dev_allocated(name); > + if (!eth_dev) > + return -ENODEV; > + if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) { > + /* detach device on local pprocess only */ > + if (strlen(rte_vdev_device_args(vdev)) =3D=3D 0) > + return rte_eth_dev_release_port_private(eth_dev); > + /** > + * else this is a private device for current process > + * so continue with normal detach scenario. > + */ > + } > + > return fs_rte_eth_free(name); > } >=20 > -- > 2.13.6