From patchwork Mon Aug 10 13:18:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chenbo Xia X-Patchwork-Id: 75328 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BA63FA04C1; Mon, 10 Aug 2020 06:29:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 20FF72A5D; Mon, 10 Aug 2020 06:29:04 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 55BCB25D9 for ; Mon, 10 Aug 2020 06:29:02 +0200 (CEST) IronPort-SDR: FgpnfTvMQ4V9VvKOrtgTDXBeU1UX6PrdRv8Cd4bEc7urSXCUmsR5ICQbXun3a0QUSAtWhMc83l m9/1GZUERi4w== X-IronPort-AV: E=McAfee;i="6000,8403,9708"; a="154607624" X-IronPort-AV: E=Sophos;i="5.75,456,1589266800"; d="scan'208";a="154607624" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2020 21:29:00 -0700 IronPort-SDR: W3Mv9/n+1Bncd4EW6RrvVUjG68DRcRcNqWIvSTuRwqU9fZgnE7KmeQ5YaOC8d0d8gLaVh8ZxSv gABGqOU2FnLg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,456,1589266800"; d="scan'208";a="494667026" Received: from npg-dpdk-virtio-xiachenbo-nw.sh.intel.com ([10.67.119.123]) by fmsmga005.fm.intel.com with ESMTP; 09 Aug 2020 21:28:58 -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:18:02 +0000 Message-Id: <20200810131802.63619-1-chenbo.xia@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200810131105.17006-1-chenbo.xia@intel.com> References: <20200810131105.17006-1-chenbo.xia@intel.com> Subject: [dpdk-dev] [PATCH v3] 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 Reviewed-by: Maxime Coquelin --- 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..501218e19 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_DEVICE_STATUS_RESET), !!(dev->status & VIRTIO_DEVICE_STATUS_ACK), !!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER), !!(dev->status & VIRTIO_DEVICE_STATUS_FEATURES_OK),