All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Antonios Motakis <a.motakis@virtualopensystems.com>
Cc: snabb-devel@googlegroups.com, qemu-devel@nongnu.org,
	n.nikolaev@virtualopensystems.com,
	Nicholas Bellinger <nab@linux-iscsi.org>,
	lukego@gmail.com, Paolo Bonzini <pbonzini@redhat.com>,
	tech@virtualopensystems.com
Subject: Re: [Qemu-devel] [PATCH v9 13/20] Add mandatory_features to vhost_dev
Date: Tue, 4 Mar 2014 20:38:48 +0200	[thread overview]
Message-ID: <20140304183848.GB21171@redhat.com> (raw)
In-Reply-To: <1393957383-16685-14-git-send-email-a.motakis@virtualopensystems.com>

On Tue, Mar 04, 2014 at 07:22:56PM +0100, Antonios Motakis wrote:
> This will be used in a following patch to ensure that a vhost-user
> client reconnecting to QEMU supports the features that were exposed
> by the first client that initiated the virtio-net session.
> 
> Signed-off-by: Antonios Motakis <a.motakis@virtualopensystems.com>
> Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>

Why isn't checking features, or backend_features field sufficient?


> ---
>  hw/net/vhost_net.c        | 10 ++++++++++
>  include/hw/virtio/vhost.h |  1 +
>  include/net/vhost_net.h   |  2 ++
>  3 files changed, 13 insertions(+)
> 
> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> index 0fb4fa5..38e1e8a 100644
> --- a/hw/net/vhost_net.c
> +++ b/hw/net/vhost_net.c
> @@ -80,6 +80,11 @@ void vhost_net_ack_features(struct vhost_net *net, unsigned features)
>      }
>  }
>  
> +unsigned long long vhost_net_features(VHostNetState *net)
> +{
> +    return net->dev.features;
> +}
> +
>  static int vhost_net_get_fd(NetClientState *backend)
>  {
>      switch (backend->info->type) {
> @@ -112,6 +117,7 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options)
>  
>      net->dev.nvqs = 2;
>      net->dev.vqs = net->vqs;
> +    net->dev.mandatory_features = options->mandatory_features;
>  
>      r = vhost_dev_init(&net->dev, options->opaque,
>                         options->force);
> @@ -347,6 +353,10 @@ unsigned vhost_net_get_features(struct vhost_net *net, unsigned features)
>  void vhost_net_ack_features(struct vhost_net *net, unsigned features)
>  {
>  }
> +unsigned long long vhost_net_features(struct vhost_net *net)
> +{
> +    return 0;
> +}
>  
>  bool vhost_net_virtqueue_pending(VHostNetState *net, int idx)
>  {
> diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h
> index 97641b6..0068d40 100644
> --- a/include/hw/virtio/vhost.h
> +++ b/include/hw/virtio/vhost.h
> @@ -41,6 +41,7 @@ struct vhost_dev {
>      unsigned long long features;
>      unsigned long long acked_features;
>      unsigned long long backend_features;
> +    unsigned long long mandatory_features;
>      bool started;
>      bool log_enabled;
>      vhost_log_chunk_t *log;
> diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h
> index 2067ee2..b39bb45 100644
> --- a/include/net/vhost_net.h
> +++ b/include/net/vhost_net.h
> @@ -10,6 +10,7 @@ typedef struct VhostNetOptions {
>      NetClientState *net_backend;
>      void *opaque;
>      bool force;
> +    unsigned long long mandatory_features;
>  } VhostNetOptions;
>  
>  struct vhost_net *vhost_net_init(VhostNetOptions *options);
> @@ -22,6 +23,7 @@ void vhost_net_cleanup(VHostNetState *net);
>  
>  unsigned vhost_net_get_features(VHostNetState *net, unsigned features);
>  void vhost_net_ack_features(VHostNetState *net, unsigned features);
> +unsigned long long vhost_net_features(VHostNetState *net);
>  
>  bool vhost_net_virtqueue_pending(VHostNetState *net, int n);
>  void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
> -- 
> 1.8.3.2

  reply	other threads:[~2014-03-04 18:39 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 18:22 [Qemu-devel] [PATCH v9 00/20] Vhost and vhost-net support for userspace based backends Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 01/20] Convert -mem-path to QemuOpts and add share property Antonios Motakis
2014-03-04 18:22 ` [PATCH v9 02/20] Add kvm_eventfds_enabled function Antonios Motakis
2014-03-04 18:22   ` [Qemu-devel] " Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 03/20] Add chardev API qemu_chr_fe_read_all Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 04/20] Add chardev API qemu_chr_fe_set_msgfds Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 05/20] Add chardev API qemu_chr_fe_get_msgfds Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 06/20] Add G_IO_HUP handler for socket chardev Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 07/20] vhost_net should call the poll callback only when it is set Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 08/20] Refactor virtio-net to use generic get_vhost_net Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 09/20] Add new virtio API virtio_queue_get_avail_idx Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 10/20] Gracefully handle ioctl failure in vhost_virtqueue_stop Antonios Motakis
2014-03-04 18:45   ` Michael S. Tsirkin
2014-03-05 13:38     ` Antonios Motakis
2014-03-05 13:47       ` Michael S. Tsirkin
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 11/20] vhost_net_init will use VhostNetOptions to get all its arguments Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 12/20] Add vhost_ops to vhost_dev struct and replace all relevant ioctls Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 13/20] Add mandatory_features to vhost_dev Antonios Motakis
2014-03-04 18:38   ` Michael S. Tsirkin [this message]
2014-03-05 13:40     ` Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 14/20] Add vhost-backend and VhostBackendType Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 15/20] Add vhost-user as a vhost backend Antonios Motakis
2014-03-04 18:22 ` [Qemu-devel] [PATCH v9 16/20] Add new vhost-user netdev backend Antonios Motakis
2014-03-04 18:23 ` [Qemu-devel] [PATCH v9 17/20] Add the vhost-user netdev backend to the command line Antonios Motakis
2014-03-04 18:23 ` [Qemu-devel] [PATCH v9 18/20] Add vhost-user protocol documentation Antonios Motakis
2014-03-04 18:23 ` [Qemu-devel] [PATCH v9 19/20] libqemustub: add stubs to be able to use qemu-char.c Antonios Motakis
2014-03-04 18:23 ` [Qemu-devel] [PATCH v9 20/20] Add qtest for vhost-user Antonios Motakis
2014-03-04 18:39   ` Andreas Färber
2014-03-05 13:39     ` Antonios Motakis
2014-03-04 18:29 ` [Qemu-devel] [PATCH v9 00/20] Vhost and vhost-net support for userspace based backends Paolo Bonzini
2014-03-04 18:33   ` Antonios Motakis
2014-03-04 18:38     ` Paolo Bonzini
2014-05-20 11:22   ` Nikolay Nikolaev
2014-05-20 12:51     ` Paolo Bonzini

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=20140304183848.GB21171@redhat.com \
    --to=mst@redhat.com \
    --cc=a.motakis@virtualopensystems.com \
    --cc=lukego@gmail.com \
    --cc=n.nikolaev@virtualopensystems.com \
    --cc=nab@linux-iscsi.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=snabb-devel@googlegroups.com \
    --cc=tech@virtualopensystems.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.