From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dor Laor Subject: Re: MTU on a virtio-net device? Date: Thu, 23 Oct 2008 14:09:48 +0200 Message-ID: <4900698C.90905@redhat.com> References: <49003700.2020905@msgid.tls.msk.ru> Reply-To: dor@redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Michael Tokarev Return-path: Received: from mx2.redhat.com ([66.187.237.31]:36165 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805AbYJWMJs (ORCPT ); Thu, 23 Oct 2008 08:09:48 -0400 In-Reply-To: <49003700.2020905@msgid.tls.msk.ru> Sender: kvm-owner@vger.kernel.org List-ID: 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; } > I'm asking because I'm not familiar with the internals, > and because, I think, increasing MTU (so that the > resulting skb still fits in a single page) will increase > performance significantly, at least on a internal/virtual > network -- currently there are just way too many context > switches and the like while copying data from one guest > to another or between guest and host. > > Thanks! > > /mjt > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html