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 BBC43A0096 for ; Wed, 10 Apr 2019 09:24:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 54BE758C6; Wed, 10 Apr 2019 09:24:57 +0200 (CEST) Received: from mail-vs1-f66.google.com (mail-vs1-f66.google.com [209.85.217.66]) by dpdk.org (Postfix) with ESMTP id 7B22558FE for ; Wed, 10 Apr 2019 09:24:55 +0200 (CEST) Received: by mail-vs1-f66.google.com with SMTP id o10so753144vsp.12 for ; Wed, 10 Apr 2019 00:24:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h5BmA4zjHK5PlJg/obCYJjNy4HoPlFKyZm16/5aG2xw=; b=Fr2FT66lw5CfDGNMbUn0gu9wh/BGpe6Ddl7Dw+3O7LDCYpFt0pBdRoLH5OT0ekzdBa iSiXItc7ixrKFdaHTynbkB/u0yaU/uaXGTguEiv4u+I+dh/DzJ6SO166c4k71KSyxY54 PEuI8tOXFI7V29SxXE27XIcZgrqcTsB/1JO8mgVfoNzJZBNoH1VHgO3d7OlTFEgdrGBX s2UEyBU5hI97/Pb66SLzYh/f1hETh99GXD1FEs6EEt/Ac3saL/qH7iMn+dWHsOM33fCM vsy/S/EgCibGwZAE5wMrj6JOS1vVWw0fh87ANzwD3EBDCFAGd5TP6VvMbSgZFMKVQalb i1Kw== X-Gm-Message-State: APjAAAXY9s5y0qvI2xt6qhz7smL3rpEenkRh+x9WSCoPw/LHEZkRVJFz mgXGYINy1On+Xv+Lt7Jz467h/lkFuzqIQpCJ9ACG+A== X-Google-Smtp-Source: APXvYqz7Pns6yNxou+ji4+lHvfmIa5Es2PEZvxk/8zkPgiusGNOBLVPnLaM4J8+4A7pb4vQ7zRIlXwNYt50H88l7/Dg= X-Received: by 2002:a67:f607:: with SMTP id k7mr20461902vso.137.1554881094793; Wed, 10 Apr 2019 00:24:54 -0700 (PDT) MIME-Version: 1.0 References: <20190409133622.14729-1-i.maximets@samsung.com> In-Reply-To: <20190409133622.14729-1-i.maximets@samsung.com> From: David Marchand Date: Wed, 10 Apr 2019 09:24:43 +0200 Message-ID: To: Ilya Maximets , Maxime Coquelin , Tiwei Bie Cc: dev , Jens Freimann , Dariusz Stojaczyk , dpdk stable Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [PATCH] vhost: fix passing destroyed device to destroy callback 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Tue, Apr 9, 2019 at 3:36 PM Ilya Maximets wrote: > 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 > > Reviewed-by: David Marchand For vhost maintainers, looking at vhost_user_add_connection, aren't we leaking a vid on errors ? either when new_connection notifier returns an error, or after calling destroy_connection. -- David Marchand