From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by dpdk.org (Postfix) with ESMTP id 6904B3979 for ; Tue, 10 Nov 2015 03:15:22 +0100 (CET) Received: by pabfh17 with SMTP id fh17so218211672pab.0 for ; Mon, 09 Nov 2015 18:15:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bigswitch_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=nSzu+VLnXY+bLroGR+kZ7qZczjU3l/ynFfWJ10u2ZYQ=; b=lzmaO1IUa6bSMmMBk8/brPhUuRl6rQvrO3m2gkXnJClkpqi5ocxNkotD+CCmStEWHH 6MRsczZbrQjLzN+3773mRVG0aIEGbtB24naph0hrQF4JNAoc8FV0azqWuvmBzrWtKXzN KnKv5ePWOe6AKm3rDwojPsDdhfYeHu3vhc15BXGw+BvFQXEWFb29A6dgAPGoQ8maSpyb dO6qkzVQChyc/sPOCXW/g362VTqKu2N8KwKz4NoCs7w4HTRWH7OEUfJcqTDi31WuGJh7 KR4YNi4OZU0I9v/BDTIoxuVqOZVP3L/rfzHgZeqWWijcEGZQEwq6H92+0+eNUOdyUd6H x3Eg== 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; bh=nSzu+VLnXY+bLroGR+kZ7qZczjU3l/ynFfWJ10u2ZYQ=; b=I8xckDp11fh/ykNqSbgHBNBaqVq121T4PTL1kczQEmlbWQTfzByQTTJNArRaKQsdCh ZeJo7OCXBNU62DzvXTOaya4rZLL+rnflNh3cWXwdTR8Zd8LDe3UkgnMFxG8s3Q8QkMH/ z2Zo/N7D7nPtjbA6Zqf6fPGDrvhit+679bAfmo2fUx/pCIGJD58r7LvoDhayw0ifi51G hCeFXfZRvn6VCLObsLrbwND0SoIMh2pfkmOOUVBXj6kdbt2Z0t7n5alAm4Lkw/MWjnu/ tzInxHnlRqyFATmQRl0KwuoM++iObE/5gDhmlPVjh1KD8Gu3YGNRGP5exE+EzKi2wTqX bKcQ== X-Gm-Message-State: ALoCoQlfUHvJmo3VWAlhBpMxa027NE1Eod2/Vl/XDXhQbQ4xzDEykReaVoSH8wKJiOfjokHUeu2e X-Received: by 10.66.199.5 with SMTP id jg5mr1830567pac.72.1447121721568; Mon, 09 Nov 2015 18:15:21 -0800 (PST) Received: from rlane-work.eng.bigswitch.com (c-67-188-28-208.hsd1.ca.comcast.net. [67.188.28.208]) by smtp.gmail.com with ESMTPSA id f3sm706479pas.36.2015.11.09.18.15.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Nov 2015 18:15:21 -0800 (PST) From: Rich Lane X-Google-Original-From: Rich Lane To: dev@dpdk.org Date: Mon, 9 Nov 2015 18:15:13 -0800 Message-Id: <1447121713-12095-1-git-send-email-rlane@bigswitch.com> X-Mailer: git-send-email 1.9.1 Cc: changchun.ouyang@intel.com Subject: [dpdk-dev] [PATCH] vhost: make destroy callback on VHOST_USER_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: Tue, 10 Nov 2015 02:15:22 -0000 QEMU sends this message first when shutting down. There was previously no way for the dataplane to know that the virtio_net instance had become unusable and it would segfault when trying to do RX/TX. Signed-off-by: Rich Lane --- 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 14278de..39a6a5e 100644 --- a/lib/librte_vhost/virtio-net.c +++ b/lib/librte_vhost/virtio-net.c @@ -436,6 +436,9 @@ reset_owner(struct vhost_device_ctx ctx) if (dev == NULL) return -1; + if (dev->flags & VIRTIO_DEV_RUNNING) + notify_ops->destroy_device(dev); + device_fh = dev->device_fh; cleanup_device(dev); init_device(dev); -- 1.9.1