netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: "Duyck, Alexander H" <alexander.h.duyck@intel.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>,
	Patrick McHardy <kaber@trash.net>,
	"David S. Miller" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: [PATCH] vlan: propogate MTU changes (v2)
Date: Mon, 06 Oct 2008 20:20:48 +0100	[thread overview]
Message-ID: <1223320848.3984.93.camel@achroite> (raw)
In-Reply-To: <80769D7B14936844A23C0C43D9FBCF0F16EF1C81@orsmsx501.amr.corp.intel.com>

On Mon, 2008-10-06 at 11:45 -0700, Duyck, Alexander H wrote:
> Stephen Hemminger wrote:
> > Propogate MTU changes of underlying device to all VLAN's and
> > send vlan MTU change out to userspace.
> >
> > see: https://bugzilla.vyatta.com/show_bug.cgi?id=3742
> >
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >
> >
> > --- a/net/8021q/vlan.c  2008-10-06 17:03:58.000000000 +0200
> > +++ b/net/8021q/vlan.c  2008-10-06 19:55:43.000000000 +0200
> > @@ -477,6 +477,17 @@ static int vlan_device_event(struct noti
> >
> >                 break;
> >
> > +       case NETDEV_CHANGEMTU:
> > +               /* Propogate MTU of underlying device */
> > +               for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
> > +                       vlandev = vlan_group_get_device(grp, i);
> > +                       if (!vlandev)
> > +                               continue;
> > +
> > +                       dev_set_mtu(vlandev, dev->mtu);
> > +               }
> > +               break;
> > +
> >         case NETDEV_DOWN:
> >                 /* Put all VLANs for this dev in the down state too.
> >                 */ for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
> 
> It has been a while since I worked with vlan tags, but I was just
> curious.  Shouldn't the vlan mtu be set to dev->mtu - VLAN_HLEN?
> 
> It seems like if the vlan and the device have the same mtu then
> you will always have issues since adding the vlan tag will
> increase the overall size and push the packet outside mtu size.

An MTU of 1500 is commonly taken to correspond to the IEEE 802.3 maximum
frame size of 1518 bytes which allows for a VLAN tag, and more generally
maximum frame size is set to MTU + 18.  However, not all drivers agree
with this interpretation.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  reply	other threads:[~2008-10-06 19:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-06 15:30 [PATCH] vlan: propogate MTU changes Stephen Hemminger
2008-10-06 16:02 ` Patrick McHardy
2008-10-06 17:54   ` Stephen Hemminger
2008-10-06 18:25     ` [PATCH] vlan: propogate MTU changes (v2) Stephen Hemminger
2008-10-06 18:45       ` Duyck, Alexander H
2008-10-06 19:20         ` Ben Hutchings [this message]
2008-10-06 22:53       ` Patrick McHardy
2008-10-06 22:33     ` [PATCH] vlan: propogate MTU changes Patrick McHardy
2008-10-06 22:50       ` Rick Jones
2008-10-06 23:02         ` Patrick McHardy
2008-10-06 23:04           ` Patrick McHardy
2008-10-06 23:18           ` Rick Jones
2008-10-06 23:33             ` Patrick McHardy
2008-10-07 23:05               ` David Miller
2008-10-08 11:53               ` Patrick McHardy
2008-10-06 20:14 ` Krzysztof Oledzki
2008-10-06 22:38   ` Patrick McHardy

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=1223320848.3984.93.camel@achroite \
    --to=bhutchings@solarflare.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.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 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).