From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id DAC88A0096 for ; Tue, 9 Apr 2019 15:36:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D8C995681; Tue, 9 Apr 2019 15:36:34 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 23A4B532C for ; Tue, 9 Apr 2019 15:36:33 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190409133631euoutp02975f6d03c77ad352478040eaf0ac78ff~T0dDMaQJb1663216632euoutp02Q for ; Tue, 9 Apr 2019 13:36:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190409133631euoutp02975f6d03c77ad352478040eaf0ac78ff~T0dDMaQJb1663216632euoutp02Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1554816991; bh=pV+Focy83CjRXegCVXQAcX5ttsLVN08QlzdcsI6R4PM=; h=From:To:Cc:Subject:Date:References:From; b=a6LLOmHagawfkYcQz9bVTJq0V6W51wAeg/epXsz8wy9hHValAcDCO01m9FyEWvJ3g 2Ijn8+QCADI8rcxsfJa662903AsxiXXUJKtfLWQ8i3f6Wu6S+d2lnBMRRh398Jjun2 R12AsR07Wosnc7KGs0tIV1csp0agKCuWlOoY16VM= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190409133630eucas1p2f3acaedf1fabaa396c59429f4f474bb6~T0dCv1VqA0632906329eucas1p2n; Tue, 9 Apr 2019 13:36:30 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id EF.E8.04325.EDF9CAC5; Tue, 9 Apr 2019 14:36:30 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190409133629eucas1p2ecfe7c4771bb6add694596cf75cf3e70~T0dCEkBC30629506295eucas1p2u; Tue, 9 Apr 2019 13:36:29 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190409133629eusmtrp1820cd198061fb66bc8a628e02c8f2d6e~T0dCECYo41615316153eusmtrp1c; Tue, 9 Apr 2019 13:36:29 +0000 (GMT) X-AuditID: cbfec7f5-b8fff700000010e5-34-5cac9fde6163 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 45.24.04140.DDF9CAC5; Tue, 9 Apr 2019 14:36:29 +0100 (BST) Received: from imaximets.rnd.samsung.ru (unknown [106.109.129.180]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190409133629eusmtip24402ba5a9e7efd267f797b30012f2b3c~T0dBe4lal0891308913eusmtip24; Tue, 9 Apr 2019 13:36:29 +0000 (GMT) From: Ilya Maximets To: dev@dpdk.org, Maxime Coquelin Cc: Tiwei Bie , Jens Freimann , Dariusz Stojaczyk , David Marchand , Ilya Maximets , stable@dpdk.org Date: Tue, 9 Apr 2019 16:36:22 +0300 Message-Id: <20190409133622.14729-1-i.maximets@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrAIsWRmVeSWpSXmKPExsWy7djP87r35q+JMVg3TdRi2f5WFovtK7rY LN592s5kcaX9J7vFuTVLWSyOde5hsfjX8YfdYmvDfyYHDo9fC5ayeize85LJ4/2+q2wefVtW MQawRHHZpKTmZJalFunbJXBlXJn9hangOEfFgx/PGBsY57B3MXJySAiYSOzd/ICti5GLQ0hg BaPE1pNdjBDOF0aJU7O6waqEBD4zSjze5Q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APMERp4FjAyrGEVSS4tz03OLjfSKE3OLS/PS 9ZLzczcxAgNx27GfW3Ywdr0LPsQowMGoxMMbMH1NjBBrYllxZe4hRgkOZiURXs54oBBvSmJl VWpRfnxRaU5q8SFGU6DlE5mlRJPzgVGSVxJvaGpobmFpaG5sbmxmoSTOe96gMkpIID2xJDU7 NbUgtQimj4mDU6qB0atJw1S0heW7bNzXTXP+dHw2kjt167q3heieReYcHqryrm8fHS1WPPl+ TbrqrDkmH/x/m0odMXQvZyr8euTQmSPCmZuvv6u9HFiutjXvyqpP9h0b3U1mSh603LAwTmXf ktDZBo26DscaTCduevTS5KlZmXHAjenrihM/vzprsbdra/GMjrMv/yqxFGckGmoxFxUnAgCS HvFUWgIAAA== X-CMS-MailID: 20190409133629eucas1p2ecfe7c4771bb6add694596cf75cf3e70 X-Msg-Generator: CA Content-Type: text/plain; charset="UTF-8" X-RootMTR: 20190409133629eucas1p2ecfe7c4771bb6add694596cf75cf3e70 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190409133629eucas1p2ecfe7c4771bb6add694596cf75cf3e70 References: Subject: [dpdk-dev] [PATCH] vhost: fix passing destroyed device to destroy callback 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190409133622.jFDJYEbBceqCgkxBMYzZV6tHGHg1lfyaP8Zd9LddU_s@z> Application should be able to obtain information like 'ifname' from the 'vid' passed to 'destroy_connection' callback. Currently, all the API calls with passed 'vid' fails with 'device not found'. Fixes: efba12a78ddf ("vhost: add user callbacks for socket open/close") Cc: stable@dpdk.org Signed-off-by: Ilya Maximets --- lib/librte_vhost/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index 3da9de62c..43f091d10 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -297,11 +297,12 @@ vhost_user_read_cb(int connfd, void *dat, int *remove) if (ret < 0) { close(connfd); *remove = 1; - vhost_destroy_device(conn->vid); if (vsocket->notify_ops->destroy_connection) vsocket->notify_ops->destroy_connection(conn->vid); + vhost_destroy_device(conn->vid); + pthread_mutex_lock(&vsocket->conn_mutex); TAILQ_REMOVE(&vsocket->conn_list, conn, next); pthread_mutex_unlock(&vsocket->conn_mutex); -- 2.17.1