DPDK patches and discussions
 help / color / mirror / Atom feed
From: Adrian Moreno <amorenoz@redhat.com>
To: Chenbo Xia <chenbo.xia@intel.com>, dev@dpdk.org
Cc: maxime.coquelin@redhat.com, zhihong.wang@intel.com
Subject: Re: [dpdk-dev] [PATCH v1] vhost: add device reset status
Date: Thu, 6 Aug 2020 13:58:43 +0200
Message-ID: <d24eff70-2b7c-fa5f-c84f-e46b25d6fb63@redhat.com> (raw)
In-Reply-To: <20200806113455.82766-1-chenbo.xia@intel.com>



On 8/6/20 1:34 PM, Chenbo Xia wrote:
> 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 <chenbo.xia@intel.com>
> ---
>  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 & 0) will always be 0, right?
how about (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),
> 

-- 
Adrián Moreno


  reply	other threads:[~2020-08-06 11:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-06 11:34 Chenbo Xia
2020-08-06 11:58 ` Adrian Moreno [this message]
2020-08-07  7:42   ` Xia, Chenbo
2020-08-10 13:11 ` [dpdk-dev] [PATCH v2] " Chenbo Xia
2020-08-10 13:18   ` [dpdk-dev] [PATCH v3] " Chenbo Xia
2020-09-18  9:38     ` Maxime Coquelin
2020-09-18 12:28     ` Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d24eff70-2b7c-fa5f-c84f-e46b25d6fb63@redhat.com \
    --to=amorenoz@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git