From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92133C433E0 for ; Thu, 6 Aug 2020 02:45:23 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 3736620823 for ; Thu, 6 Aug 2020 02:45:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3736620823 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 87B7D1C043; Thu, 6 Aug 2020 04:45:22 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D109C1C036 for ; Thu, 6 Aug 2020 04:45:20 +0200 (CEST) IronPort-SDR: z+XcTTsXYrWexnKI3id514qGI3XQLSHIN+w7uvv5EVCpTmX3PfEJPm+DQYbcaTzumL3LrR1lbp pzzHlJH/VtpA== X-IronPort-AV: E=McAfee;i="6000,8403,9704"; a="150453747" X-IronPort-AV: E=Sophos;i="5.75,440,1589266800"; d="scan'208";a="150453747" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2020 19:45:19 -0700 IronPort-SDR: Ve3Q8WIX2x3KZjG5purzFB3WFw6Y1LVflpIUmRkaiajH3vp62hOUFyG6Zd8XoshsKy7gLEpEhF ZBrwhukkuFsg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,440,1589266800"; d="scan'208";a="467686723" Received: from npg-dpdk-virtio-xiachenbo-nw.sh.intel.com ([10.67.119.123]) by orsmga005.jf.intel.com with ESMTP; 05 Aug 2020 19:45:18 -0700 From: Chenbo Xia To: dev@dpdk.org Cc: maxime.coquelin@redhat.com, zhihong.wang@intel.com, amorenoz@redhat.com Date: Thu, 6 Aug 2020 11:34:55 +0000 Message-Id: <20200806113455.82766-1-chenbo.xia@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v1] 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 definiton 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..1b520ead7 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), -- 2.17.1