All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: dor@redhat.com
Cc: kvm@vger.kernel.org
Subject: Re: MTU on a virtio-net device?
Date: Thu, 23 Oct 2008 16:30:11 +0400	[thread overview]
Message-ID: <49006E53.1090106@msgid.tls.msk.ru> (raw)
In-Reply-To: <4900698C.90905@redhat.com>

Dor Laor wrote:
> Michael Tokarev wrote:
>> Right now (2.6.27), there's no way to change MTU of a
>> virtio-net interface, since the mtu-changing method is
>> not provided.  Is there a simple way to add such a
>> beast?
>>
> It should be a nice easy patch for mtu < 4k.
> You can just implement a 'change_mtu' handler like:
> 
> static int virtio_change_mtu(struct net_device *netdev, int new_mtu)
> {
>        if(new_mtu < ETH_ZLEN || new_mtu > PAGE_SIZE)
>                return -EINVAL;
>        netdev->mtu = new_mtu;
>        return 0;
> }

Well, this isn't enough I think.  That is, new_mtu's upper cap should be
less than PAGE_SIZE due to various additional data structures.  But it
is enough to start playing.

I just added the above method, which allowed me to set MTU to 3500
(arbitrary).  But it still does not work.  In guest, I see the
following while pinging it from host with `ping -s2000':

16:26:57.952684 IP truncated-ip - 528 bytes missing! 81.13.33.145 > 81.13.33.150: ICMP echo request, id 12869, seq 19, length 2008
16:26:58.954133 IP truncated-ip - 528 bytes missing! 81.13.33.145 > 81.13.33.150: ICMP echo request, id 12869, seq 20, length 2008
...

So something else has to be changed for this to work, it seems.
That's why I wrote:

>> I'm asking because I'm not familiar with the internals,
[...]

;)

Thanks!

/mjt

  reply	other threads:[~2008-10-23 12:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-23  8:34 MTU on a virtio-net device? Michael Tokarev
2008-10-23 12:09 ` Dor Laor
2008-10-23 12:30   ` Michael Tokarev [this message]
     [not found]     ` <490073EA.5060009@redhat.com>
2008-10-23 13:19       ` Michael Tokarev
2008-10-23 13:27         ` Dor Laor

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=49006E53.1090106@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=dor@redhat.com \
    --cc=kvm@vger.kernel.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 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.