From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 8091C1BE8D for ; Wed, 27 Jun 2018 10:24:31 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0103F40201CF; Wed, 27 Jun 2018 08:24:31 +0000 (UTC) Received: from [10.36.112.39] (ovpn-112-39.ams2.redhat.com [10.36.112.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A75F91117656; Wed, 27 Jun 2018 08:24:28 +0000 (UTC) To: Qi Zhang , thomas@monjalon.net, 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 References: <20180607123849.14439-1-qi.z.zhang@intel.com> <20180627071740.19870-1-qi.z.zhang@intel.com> <20180627071740.19870-24-qi.z.zhang@intel.com> From: Maxime Coquelin Message-ID: Date: Wed, 27 Jun 2018 10:24:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180627071740.19870-24-qi.z.zhang@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 27 Jun 2018 08:24:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 27 Jun 2018 08:24:31 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH v5 23/24] net/vhost: 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:24:31 -0000 On 06/27/2018 09:17 AM, Qi Zhang wrote: > 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 > --- > drivers/net/vhost/rte_eth_vhost.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c > index ba9d768a0..f773711b4 100644 > --- a/drivers/net/vhost/rte_eth_vhost.c > +++ b/drivers/net/vhost/rte_eth_vhost.c > @@ -1353,6 +1353,7 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev) > } > /* TODO: request info from primary to set up Rx and Tx */ > eth_dev->dev_ops = &ops; > + eth_dev->device = &dev->device; > rte_eth_dev_probing_finish(eth_dev); > return 0; > } > @@ -1435,6 +1436,16 @@ rte_pmd_vhost_remove(struct rte_vdev_device *dev) > if (eth_dev == NULL) > return -ENODEV; > > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { > + /* detach device on local pprocess only */ > + if (strlen(rte_vdev_device_args(dev)) == 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 > + */ > + } > + IMHO, the driver shouldn't have to manage primary/secondary process stuff. It does not look like the right place to me. > eth_dev_close(eth_dev); > > rte_free(vring_states[eth_dev->data->port_id]); >