From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by dpdk.org (Postfix) with ESMTP id 47DCD8D99 for ; Fri, 16 Oct 2015 11:09:30 +0200 (CEST) Received: by wicll6 with SMTP id ll6so679441wic.1 for ; Fri, 16 Oct 2015 02:09:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QF1MhjpoKvL6F5uHB4cifzdCOGM6FgBtStyH8NIeBnY=; b=XzuLX7DzKzmTRSLJwx5n44wA2YflyWu3bKD2ojyu+qw/CwN8gMkeiOksh+plH6NRfd oD1dOg5VwBigihw/fimNRdyDLNlJI8Hb47QpjtXbBglA7SBriAs2BloXJwjU1VaBQ5i3 1Lnt3VuXZzqLJT6KIuEZ9iF1KBk9YxuWYj2PfBMcWLA3cDvTjXykUEsqtjdM7rTqSZYn 3SklzU49ICTlw7An+oWs5tJV2zipgCmW5JCn1HE66lQ4iNL3tdaIJk3Lmjd9F/dLckfw Q/LwZKJoecuJRk2lXb8G7MXQPdxMOMk8FNlN/awxkfIiq2G6gqzqMJaWo1uG09+PmHk/ asYQ== X-Gm-Message-State: ALoCoQlkUw3APzYunu/CF0D9tvW6JVCeM5RLot3ZZQqSTuZd223bnRFO2pMrdvh0Cm2ZySSjPT9U X-Received: by 10.194.57.242 with SMTP id l18mr15326556wjq.34.1444986570192; Fri, 16 Oct 2015 02:09:30 -0700 (PDT) Received: from localhost.localdomain (ows-185-21-195-233.eu-west-1.compute.outscale.com. [185.21.195.233]) by smtp.gmail.com with ESMTPSA id ft2sm2409818wic.24.2015.10.16.02.09.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Oct 2015 02:09:29 -0700 (PDT) From: Jerome Jutteau To: dev@dpdk.org Date: Fri, 16 Oct 2015 11:08:48 +0200 Message-Id: <1444986530-20893-2-git-send-email-jerome.jutteau@outscale.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1444986530-20893-1-git-send-email-jerome.jutteau@outscale.com> References: <1444986530-20893-1-git-send-email-jerome.jutteau@outscale.com> Cc: changchun.ouyang@intel.com Subject: [dpdk-dev] [PATCH 1/3] vhost: avoid device identifier to be reset to 0 in reset_owner X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2015 09:09:30 -0000 virtio-net clean and init device after a VHOST_USER_RESET_OWNER. This reset device identifier to 0 and break ll_root listing logic. This patch keep the old device identifier and re-write it on the cleaned device. Signed-off-by: Jerome Jutteau --- lib/librte_vhost/virtio-net.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c index d0f1764..955a29d 100644 --- a/lib/librte_vhost/virtio-net.c +++ b/lib/librte_vhost/virtio-net.c @@ -399,11 +399,14 @@ static int reset_owner(struct vhost_device_ctx ctx) { struct virtio_net_config_ll *ll_dev; + uint64_t device_fh; ll_dev = get_config_ll_entry(ctx); + device_fh = ll_dev->dev.device_fh; cleanup_device(&ll_dev->dev); init_device(&ll_dev->dev); + ll_dev->dev.device_fh = device_fh; return 0; } -- jerome