All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Conole <aconole@redhat.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: mst@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org,
	fbl@redhat.com, berrange@redhat.com, mlureau@redhat.com,
	ktraynor@redhat.com, jasowang@redhat.com,
	yuanhan.liu@linux.intel.com
Subject: Re: [Qemu-devel] [RFC v3 2/3] vhost-net: Notify the backend about the host MTU
Date: Tue, 06 Dec 2016 13:31:55 -0500	[thread overview]
Message-ID: <f7t37i0x61w.fsf@redhat.com> (raw)
In-Reply-To: <20161130101017.13382-3-maxime.coquelin@redhat.com> (Maxime Coquelin's message of "Wed, 30 Nov 2016 11:10:16 +0100")

Maxime Coquelin <maxime.coquelin@redhat.com> writes:

> This patch provides a way for virtio-net to notify the
> backend about the host MTU set by the user.
>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Aaron Conole <aconole@redhat.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  hw/net/vhost_net.c      | 22 ++++++++++++++++++++++
>  include/net/vhost_net.h |  2 ++
>  2 files changed, 24 insertions(+)
>
> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> index f2d49ad..d7c13d4 100644
> --- a/hw/net/vhost_net.c
> +++ b/hw/net/vhost_net.c
> @@ -51,6 +51,7 @@ static const int kernel_feature_bits[] = {
>      VIRTIO_RING_F_EVENT_IDX,
>      VIRTIO_NET_F_MRG_RXBUF,
>      VIRTIO_F_VERSION_1,
> +    VIRTIO_NET_F_MTU,
>      VHOST_INVALID_FEATURE_BIT
>  };
>  
> @@ -74,6 +75,7 @@ static const int user_feature_bits[] = {
>      VIRTIO_NET_F_HOST_ECN,
>      VIRTIO_NET_F_HOST_UFO,
>      VIRTIO_NET_F_MRG_RXBUF,
> +    VIRTIO_NET_F_MTU,
>  
>      /* This bit implies RARP isn't sent by QEMU out of band */
>      VIRTIO_NET_F_GUEST_ANNOUNCE,
> @@ -435,6 +437,22 @@ int vhost_set_vring_enable(NetClientState *nc, int enable)
>      return 0;
>  }
>  
> +int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu)
> +{
> +    const VhostOps *vhost_ops = net->dev.vhost_ops;
> +    int ret;
> +
> +    if (!vhost_ops->vhost_net_set_mtu) {
> +        return -ENOSYS;
> +    }
> +
> +    ret = vhost_ops->vhost_net_set_mtu(&net->dev, mtu);
> +    if (ret < 0) {
> +        return -errno;
> +    }
> +    return 0;
> +}
> +
>  #else
>  uint64_t vhost_net_get_max_queues(VHostNetState *net)
>  {
> @@ -501,4 +519,8 @@ int vhost_set_vring_enable(NetClientState *nc, int enable)
>  {
>      return 0;
>  }
> +
> +int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu)
> +{
> +}
>  #endif

I think this should return something - I don't know what value will come
through if it doesn't :).

> diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h
> index 5a08eff..afc1499 100644
> --- a/include/net/vhost_net.h
> +++ b/include/net/vhost_net.h
> @@ -35,4 +35,6 @@ int vhost_set_vring_enable(NetClientState * nc, int enable);
>  
>  uint64_t vhost_net_get_acked_features(VHostNetState *net);
>  
> +int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu);
> +
>  #endif

  reply	other threads:[~2016-12-06 18:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-30 10:10 [Qemu-devel] [RFC v3 0/3] virtio-net: Add support to MTU feature Maxime Coquelin
2016-11-30 10:10 ` [Qemu-devel] [RFC v3 1/3] vhost-user: Add MTU protocol feature and op Maxime Coquelin
2016-11-30 10:25   ` Yuanhan Liu
2016-11-30 12:17     ` Maxime Coquelin
2016-11-30 10:10 ` [Qemu-devel] [RFC v3 2/3] vhost-net: Notify the backend about the host MTU Maxime Coquelin
2016-12-06 18:31   ` Aaron Conole [this message]
2016-12-07  7:49     ` Maxime Coquelin
2016-11-30 10:10 ` [Qemu-devel] [RFC v3 3/3] virtio-net: Add MTU feature support Maxime Coquelin
2016-11-30 11:24   ` Jason Wang
2016-11-30 12:24     ` Maxime Coquelin
2016-11-30 10:30 ` [Qemu-devel] [RFC v3 0/3] virtio-net: Add support to MTU feature no-reply
2016-11-30 11:23 ` Jason Wang
2016-11-30 12:16   ` Maxime Coquelin
2016-11-30 13:42     ` Michael S. Tsirkin
2016-12-05 16:11       ` Aaron Conole

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=f7t37i0x61w.fsf@redhat.com \
    --to=aconole@redhat.com \
    --cc=berrange@redhat.com \
    --cc=fbl@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=ktraynor@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mlureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yuanhan.liu@linux.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
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.