From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 11864A04C1; Mon, 10 Aug 2020 06:22:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 222DF2986; Mon, 10 Aug 2020 06:22:07 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 2529F288C for ; Mon, 10 Aug 2020 06:22:05 +0200 (CEST) IronPort-SDR: YTK2bYXK89R9VBYG+pZ3o0OAsP/+n6DitjlI2bjSDDEpJa2jqzL8YSgVDrAqT1KBz+Jfnjyt5t 8xeVYdMX+yLg== X-IronPort-AV: E=McAfee;i="6000,8403,9708"; a="150911309" X-IronPort-AV: E=Sophos;i="5.75,456,1589266800"; d="scan'208";a="150911309" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2020 21:22:03 -0700 IronPort-SDR: xTF1DX7zmG2cuiZDW3Ag64UrXcwsXqcME0NcyaOTffCXsMe5Z6VI09orXrB8wRN9fV2B//YoVv 77ST2xgFurvQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,456,1589266800"; d="scan'208";a="468902987" Received: from npg-dpdk-virtio-xiachenbo-nw.sh.intel.com ([10.67.119.123]) by orsmga005.jf.intel.com with ESMTP; 09 Aug 2020 21:22:03 -0700 From: Chenbo Xia To: dev@dpdk.org Cc: maxime.coquelin@redhat.com, zhihong.wang@intel.com, amorenoz@redhat.com Date: Mon, 10 Aug 2020 13:11:05 +0000 Message-Id: <20200810131105.17006-1-chenbo.xia@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806113455.82766-1-chenbo.xia@intel.com> References: <20200806113455.82766-1-chenbo.xia@intel.com> Subject: [dpdk-dev] [PATCH v2] vhost: add device reset status 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" vhost lib now does not have definition of reset status. This patch adds the reset status definition and changes related log. Signed-off-by: Chenbo Xia --- lib/librte_vhost/vhost.h | 1 + lib/librte_vhost/vhost_user.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index 632f66d53..73a1ed889 100644 --- a/lib/librte_vhost/vhost.h +++ b/lib/librte_vhost/vhost.h @@ -239,6 +239,7 @@ struct vhost_virtqueue { } __rte_cache_aligned; /* Virtio device status as per Virtio specification */ +#define VIRTIO_DEVICE_STATUS_RESET 0x00 #define VIRTIO_DEVICE_STATUS_ACK 0x01 #define VIRTIO_DEVICE_STATUS_DRIVER 0x02 #define VIRTIO_DEVICE_STATUS_DRIVER_OK 0x04 diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index c3c924fae..ede8813ea 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -2531,6 +2531,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg, } VHOST_LOG_CONFIG(INFO, "New device status(0x%08x):\n" + "\t-RESET: %u\n" "\t-ACKNOWLEDGE: %u\n" "\t-DRIVER: %u\n" "\t-FEATURES_OK: %u\n" @@ -2538,6 +2539,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg, "\t-DEVICE_NEED_RESET: %u\n" "\t-FAILED: %u\n", dev->status, + (dev->status == VIRTIO_CONFIG_STATUS_RESET), !!(dev->status & VIRTIO_DEVICE_STATUS_ACK), !!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER), !!(dev->status & VIRTIO_DEVICE_STATUS_FEATURES_OK), -- 2.17.1