From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 8AE811B557 for ; Thu, 21 Jun 2018 14:40:01 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jun 2018 05:39:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,251,1526367600"; d="scan'208";a="209975067" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 21 Jun 2018 05:39:57 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 21 Jun 2018 05:39:56 -0700 Received: from fmsmsx117.amr.corp.intel.com ([169.254.3.220]) by fmsmsx158.amr.corp.intel.com ([169.254.15.52]) with mapi id 14.03.0319.002; Thu, 21 Jun 2018 05:39:56 -0700 From: "Wiles, Keith" To: "Zhang, Qi Z" CC: Thomas Monjalon , "Burakov, Anatoly" , "Ananyev, Konstantin" , "dev@dpdk.org" , "Richardson, Bruce" , "Yigit, Ferruh" , "Shelton, Benjamin H" , "Vangati, Narender" Thread-Topic: [dpdk-dev] [PATCH v2 20/22] net/tap: enable port detach on secondary process Thread-Index: AQHUCQVw57RFdBnrMkqS1/aCFZ6+9KRrHTeA Date: Thu, 21 Jun 2018 12:39:55 +0000 Message-ID: References: <20180607123849.14439-1-qi.z.zhang@intel.com> <20180621020059.1198-1-qi.z.zhang@intel.com> <20180621020059.1198-21-qi.z.zhang@intel.com> In-Reply-To: <20180621020059.1198-21-qi.z.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.181.68] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 20/22] net/tap: 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: Thu, 21 Jun 2018 12:40:03 -0000 > On Jun 20, 2018, at 9:00 PM, Qi Zhang wrote: >=20 > 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. >=20 > Signed-off-by: Qi Zhang > --- > drivers/net/tap/rte_eth_tap.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.= c > index df396bfde..bb5f20b01 100644 > --- a/drivers/net/tap/rte_eth_tap.c > +++ b/drivers/net/tap/rte_eth_tap.c > @@ -1759,6 +1759,7 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev) > } > /* TODO: request info from primary to set up Rx and Tx */ > eth_dev->dev_ops =3D &ops; > + eth_dev->device =3D &dev->device; > rte_eth_dev_probing_finish(eth_dev); > return 0; > } > @@ -1827,12 +1828,24 @@ rte_pmd_tap_remove(struct rte_vdev_device *dev) > { > struct rte_eth_dev *eth_dev =3D NULL; > struct pmd_internals *internals; > + const char *name; > int i; >=20 > + name =3D rte_vdev_device_name(dev); > /* find the ethdev entry */ > - eth_dev =3D rte_eth_dev_allocated(rte_vdev_device_name(dev)); > + eth_dev =3D rte_eth_dev_allocated(name); > if (!eth_dev) > - return 0; > + return -ENODEV; > + > + if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) { > + /* detach device on local pprocess only */ > + if (strlen(rte_vdev_device_args(dev)) =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 > + */ > + } Acked-by: Keith Wiles for this patch of the tap PMD. >=20 > internals =3D eth_dev->data->dev_private; >=20 > --=20 > 2.13.6 >=20 Regards, Keith