Subject: Re: change MCLBYTES in kernel
To: Thor Lancelot Simon <>
From: Manuel Bouyer <>
List: tech-net
Date: 10/02/2005 14:53:24
On Sat, Oct 01, 2005 at 10:18:48AM -0400, Thor Lancelot Simon wrote:
> On Sat, Oct 01, 2005 at 04:11:06PM +0200, Manuel Bouyer wrote:
> > Hi,
> > for Xen domain0 I'd like to change the mbuf cluster size to 4k (so that
> > we have only one cluster per page, and it can be swapped with the guest
> > rather than memcpy'd). It looks like I could use
> > options MCLSHIFT=12
> > on i386/conf/XEN0 for this. Any bad side-effect to expect ?
> > /usr/include/machine/param.h wouldn't match the kernel's idea of MCLBYTES ...
> I do this regularly on systems that use Ethernet jumbograms.  It works
> fine.

OK, thanks. Seems to work fine for me too, but for now I've only used ttcp
with this setup :)

> You might consider adding the jumbogram capability bit to xennet, so
> that when talking to other domains the domUs can use 4k - hdrlen
> packets, which will save needless trips around the xennet ring/needless
> traps to the hypervisor/etc. 

I'll look at this. I've been thinking at this for some time.
Ideally we should suppport 9k, but sending packets of more than one page
doesn't fit well the Xen network interface (this would require
physically-contigous pages, so would need multiple hypervisor calls and
data copy). 4k is easy enouth to do, though.

> Technically this would require some
> changes to bridge(4) to support non-1500 MTUs but in practice you can
> bring the bridge up, then change the interface MTUs out from underneath
> it, so I think it'd just work.

It will also work out of the box in routing setups, or for inter-domain
communications (I can immagine setups where domUs would only talk to others
domains on the box directly, using application proxies on domain0
for anything else. Or 2 sets of inter-domain interfaces, one for internal
communications and one for internet connectivity).

Manuel Bouyer <>
     NetBSD: 26 ans d'experience feront toujours la difference