From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wiles, Keith" Subject: Re: [PATCH v2 20/22] net/tap: enable port detach on secondary process 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Thomas Monjalon , "Burakov, Anatoly" , "Ananyev, Konstantin" , "dev@dpdk.org" , "Richardson, Bruce" , "Yigit, Ferruh" , "Shelton, Benjamin H" , "Vangati, Narender" To: "Zhang, Qi Z" 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) In-Reply-To: <20180621020059.1198-21-qi.z.zhang@intel.com> Content-Language: en-US Content-ID: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > 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