From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5B2081B5F6 for ; Wed, 27 Jun 2018 10:36:55 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2018 01:36:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,278,1526367600"; d="scan'208";a="52607023" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga008.jf.intel.com with ESMTP; 27 Jun 2018 01:36:53 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 27 Jun 2018 01:36:53 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 27 Jun 2018 01:36:52 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.51]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.70]) with mapi id 14.03.0319.002; Wed, 27 Jun 2018 16:34:15 +0800 From: "Zhang, Qi Z" To: Matan Azrad , Thomas Monjalon , "Burakov, Anatoly" CC: "Ananyev, Konstantin" , "dev@dpdk.org" , "Richardson, Bruce" , "Yigit, Ferruh" , "Shelton, Benjamin H" , "Vangati, Narender" Thread-Topic: [dpdk-dev] [PATCH v3 15/23] net/failsafe: enable port detach on secondary process Thread-Index: AQHUDfDuhR90a8s390i5oHSAOwMnbKRzxzPg Date: Wed, 27 Jun 2018 08:34:14 +0000 Message-ID: <039ED4275CED7440929022BC67E706115323F234@SHSMSX103.ccr.corp.intel.com> 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: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTczODNiNjctZGZkMi00NGE2LWI3ZDItMWVkMDA2NmY1NmUwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTG0xZmR6ZGdqNzJ0NmRSUERnd0ZkU09BZkw5NHpmbkZkbHp0TUkxYUFYclhmQUFud3dmXC95ak44TnNEQlpXbkMifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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:36:56 -0000 > -----Original Message----- > From: Matan Azrad [mailto:matan@mellanox.com] > Sent: Wednesday, June 27, 2018 4:29 PM > To: Zhang, Qi Z ; Thomas Monjalon > ; Burakov, Anatoly > Cc: Ananyev, Konstantin ; dev@dpdk.org; > Richardson, Bruce ; Yigit, Ferruh > ; Shelton, Benjamin H > ; Vangati, Narender > > Subject: RE: [dpdk-dev] [PATCH v3 15/23] net/failsafe: enable port detach= on > secondary process >=20 > Hi Qi >=20 > From: Qi Zhang > > Previously, detach port on secondary process will mess primary process > > and cause same device can't be attached again, by take advantage of > > rte_eth_release_port_private, we can support this with minor change. > > > > Signed-off-by: Qi Zhang >=20 > Failsafe doesn't support secondary process, I don't think we need this > adjustment for drivers which don't support secondary process. Sure, I can remove this, thanks for the information. Regards Qi >=20 > > --- > > drivers/net/failsafe/failsafe.c | 16 ++++++++++++++++ > > 1 file changed, 16 insertions(+) > > > > diff --git a/drivers/net/failsafe/failsafe.c > > b/drivers/net/failsafe/failsafe.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; > > > > 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); > > } > > > > -- > > 2.13.6