From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tokarev Subject: Re: MTU on a virtio-net device? Date: Thu, 23 Oct 2008 16:30:11 +0400 Message-ID: <49006E53.1090106@msgid.tls.msk.ru> References: <49003700.2020905@msgid.tls.msk.ru> <4900698C.90905@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: dor@redhat.com Return-path: Received: from hobbit.corpit.ru ([81.13.33.150]:24268 "EHLO hobbit.corpit.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753102AbYJWMaO (ORCPT ); Thu, 23 Oct 2008 08:30:14 -0400 In-Reply-To: <4900698C.90905@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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