From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 61B6A9E7 for ; Wed, 15 Feb 2017 08:22:42 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2017 23:22:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,165,1484035200"; d="scan'208";a="1094942074" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 14 Feb 2017 23:22:30 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 14 Feb 2017 23:22:30 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 14 Feb 2017 23:22:29 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0248.002; Wed, 15 Feb 2017 15:22:28 +0800 From: "Tan, Jianfeng" To: Yuanhan Liu CC: "Yao, Lei A" , dpdk stable Thread-Topic: patch 'net/vhost: fix unix socket not removed as closing' has been queued to stable release 16.11.1 Thread-Index: AQHSh1RRP5NESEdkQEGJZdlZ3eDXwqFpp9cA Date: Wed, 15 Feb 2017 07:22:27 +0000 Message-ID: References: <1487140012-13314-1-git-send-email-yuanhan.liu@linux.intel.com> <1487140012-13314-39-git-send-email-yuanhan.liu@linux.intel.com> In-Reply-To: <1487140012-13314-39-git-send-email-yuanhan.liu@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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-stable] patch 'net/vhost: fix unix socket not removed as closing' has been queued to stable release 16.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 07:22:43 -0000 Will below commit be back ported? aed0b12930b3 ("net/vhost: fix socket file deleted on stop") If yes, I agree. Thanks, Jianfeng > -----Original Message----- > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > Sent: Wednesday, February 15, 2017 2:27 PM > To: Tan, Jianfeng > Cc: Yuanhan Liu; Yao, Lei A; dpdk stable > Subject: patch 'net/vhost: fix unix socket not removed as closing' has be= en > queued to stable release 16.11.1 >=20 > Hi, >=20 > FYI, your patch has been queued to stable release 16.11.1 >=20 > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable > yet. It will be pushed if I get no objections before 02/18/17. > So please shout if anyone has objections. >=20 > Thanks. >=20 > --yliu >=20 > --- > From 67c33ab2c2798925c8e96f29434011d9a8ea25bc Mon Sep 17 00:00:00 > 2001 > From: Jianfeng Tan > Date: Tue, 24 Jan 2017 08:37:38 +0000 > Subject: [PATCH] net/vhost: fix unix socket not removed as closing >=20 > [ upstream commit 954820dc7d9eeef76274adcc55d5b9ca4f425ec2 ] >=20 > The commit aed0b12930b3 ("net/vhost: fix socket file deleted on stop") > moves rte_vhost_driver_register and rte_vhost_driver_unregister from > dev_start() and dev_stop() into driver's probe() and remove(). >=20 > Apps, like testpmd, using vhost pmd in server mode, usually calls > dev_stop() and dev_close() as quitting, instead of driver-specific > remove(). Then those unix socket files have no chance to get removed. >=20 > Semantically, device-specific things should be put into device-specific > APIs. Fix this issue by moving rte_vhost_driver_unregister, plus other > structure free into dev_close(). >=20 > Fixes: aed0b12930b3 ("net/vhost: fix socket file deleted on stop") >=20 > Reported-by: Lei Yao > Signed-off-by: Jianfeng Tan > Acked-by: Yuanhan Liu > --- > drivers/net/vhost/rte_eth_vhost.c | 48 +++++++++++++++++++++++------- > --------- > 1 file changed, 28 insertions(+), 20 deletions(-) >=20 > diff --git a/drivers/net/vhost/rte_eth_vhost.c > b/drivers/net/vhost/rte_eth_vhost.c > index e715c31..328dde0 100644 > --- a/drivers/net/vhost/rte_eth_vhost.c > +++ b/drivers/net/vhost/rte_eth_vhost.c > @@ -783,6 +783,32 @@ eth_dev_stop(struct rte_eth_dev *dev > __rte_unused) > { > } >=20 > +static void > +eth_dev_close(struct rte_eth_dev *dev) > +{ > + struct pmd_internal *internal; > + struct internal_list *list; > + > + internal =3D dev->data->dev_private; > + if (!internal) > + return; > + > + rte_vhost_driver_unregister(internal->iface_name); > + > + list =3D find_internal_resource(internal->iface_name); > + if (!list) > + return; > + > + pthread_mutex_lock(&internal_list_lock); > + TAILQ_REMOVE(&internal_list, list, next); > + pthread_mutex_unlock(&internal_list_lock); > + rte_free(list); > + > + free(internal->dev_name); > + free(internal->iface_name); > + rte_free(internal); > +} > + > static int > eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, > uint16_t nb_rx_desc __rte_unused, > @@ -951,6 +977,7 @@ rte_eth_vhost_feature_get(void) > static const struct eth_dev_ops ops =3D { > .dev_start =3D eth_dev_start, > .dev_stop =3D eth_dev_stop, > + .dev_close =3D eth_dev_close, > .dev_configure =3D eth_dev_configure, > .dev_infos_get =3D eth_dev_info, > .rx_queue_setup =3D eth_rx_queue_setup, > @@ -1178,8 +1205,6 @@ static int > rte_pmd_vhost_remove(const char *name) > { > struct rte_eth_dev *eth_dev =3D NULL; > - struct pmd_internal *internal; > - struct internal_list *list; > unsigned int i; >=20 > RTE_LOG(INFO, PMD, "Un-Initializing pmd_vhost for %s\n", name); > @@ -1189,22 +1214,9 @@ rte_pmd_vhost_remove(const char *name) > if (eth_dev =3D=3D NULL) > return -ENODEV; >=20 > - internal =3D eth_dev->data->dev_private; > - if (internal =3D=3D NULL) > - return -ENODEV; > - > - list =3D find_internal_resource(internal->iface_name); > - if (list =3D=3D NULL) > - return -ENODEV; > - > - pthread_mutex_lock(&internal_list_lock); > - TAILQ_REMOVE(&internal_list, list, next); > - pthread_mutex_unlock(&internal_list_lock); > - rte_free(list); > - > eth_dev_stop(eth_dev); >=20 > - rte_vhost_driver_unregister(internal->iface_name); > + eth_dev_close(eth_dev); >=20 > if (rte_atomic16_sub_return(&nb_started_ports, 1) =3D=3D 0) > vhost_driver_session_stop(); > @@ -1212,9 +1224,6 @@ rte_pmd_vhost_remove(const char *name) > rte_free(vring_states[eth_dev->data->port_id]); > vring_states[eth_dev->data->port_id] =3D NULL; >=20 > - free(internal->dev_name); > - free(internal->iface_name); > - > for (i =3D 0; i < eth_dev->data->nb_rx_queues; i++) > rte_free(eth_dev->data->rx_queues[i]); > for (i =3D 0; i < eth_dev->data->nb_tx_queues; i++) > @@ -1222,7 +1231,6 @@ rte_pmd_vhost_remove(const char *name) >=20 > rte_free(eth_dev->data->mac_addrs); > rte_free(eth_dev->data); > - rte_free(internal); >=20 > rte_eth_dev_release_port(eth_dev); >=20 > -- > 1.9.0