virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [RFC v2 -next 1/2] virtio: Start feature MTU support
Date: Wed, 16 Mar 2016 20:29:58 +0200	[thread overview]
Message-ID: <20160316202625-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <20160316112314.4510d386@samsung9>

On Wed, Mar 16, 2016 at 11:23:14AM -0700, Stephen Hemminger wrote:
> On Tue, 15 Mar 2016 17:04:12 -0400
> Aaron Conole <aconole@redhat.com> wrote:
> 
> > --- a/include/uapi/linux/virtio_net.h
> > +++ b/include/uapi/linux/virtio_net.h
> > @@ -55,6 +55,7 @@
> >  #define VIRTIO_NET_F_MQ	22	/* Device supports Receive Flow
> >  					 * Steering */
> >  #define VIRTIO_NET_F_CTRL_MAC_ADDR 23	/* Set MAC address */
> > +#define VIRTIO_NET_F_MTU 25	/* Device supports Default MTU Negotiation */
> >  
> >  #ifndef VIRTIO_NET_NO_LEGACY
> >  #define VIRTIO_NET_F_GSO	6	/* Host handles pkts w/ any GSO type */
> > @@ -73,6 +74,8 @@ struct virtio_net_config {
> >  	 * Legal values are between 1 and 0x8000
> >  	 */
> >  	__u16 max_virtqueue_pairs;
> > +	/* Default maximum transmit unit advice */
> > +	__u16 mtu;
> >  } __attribute__((packed));
> >  
> >  /*
> 
> You can't change user visible headers without breaking ABI.
> This structure might be used by other user code.

Then this userspace is broken.

If someone uses virtio code one has to follow virtio spec.

And Virtio spec makes it very clear that
1. config space size can change at any time
2. fields can only be accessed if the correct feature bit
   has been both advertized in host bitmap and acknowledged
   in guest bitmap

> Also how can this
> work if host is using old size of structure.

It works because access is guarded by feature bit check.

-- 
MST

  reply	other threads:[~2016-03-16 18:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 21:04 [RFC v2 -next 0/2] virtio-net: Advised MTU feature Aaron Conole
2016-03-15 21:04 ` [RFC v2 -next 1/2] virtio: Start feature MTU support Aaron Conole
2016-03-16 18:23   ` Stephen Hemminger
2016-03-16 18:29     ` Michael S. Tsirkin [this message]
2016-03-17 21:10     ` Aaron Conole
2016-03-17 22:04       ` Stephen Hemminger
2016-03-15 21:04 ` [RFC v2 -next 2/2] virtio_net: Read the advised MTU Aaron Conole
2016-03-16 14:11   ` Sergei Shtylyov
2016-03-17 21:15     ` Aaron Conole
2016-03-16 14:24   ` Michael S. Tsirkin
2016-03-17 21:20     ` Aaron Conole
2016-03-15 21:34 ` [RFC v2 -next 0/2] virtio-net: Advised MTU feature Rick Jones
2016-03-17 21:24   ` Aaron Conole
2016-03-16  4:55 ` Pankaj Gupta
2016-03-17 21:24   ` 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=20160316202625-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).