Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: xen vs bridges

>>> Nothing in the xennet protocol prevents us from using MTU up to 2k.
>>> The linux frontends and backends limit it to 1500 though, so we'd
>>> need a way to know what MTU backends support.

Would we?  What happens if we send more than they're expecting?  Does
it work the way it does if you connect a vlan-capable interface to a
non-capable one with physical interfaces?  That's what I'd expect it to
do, on the "xennet and xvif are just a crossed cable between two
interfaces" principle.

>> For my purposes, I just want it to work with NetBSD and I don't care
>> about compatability with other domU OSes.  Will it work to just
>> patch the xennet and xvif drivers to give them ETHERCAP_VLAN_MTU,
> Yes, it should work

And it does!

--- /sys/arch/xen/xen/if_xennet_xenbus.c=       2006-11-02 22:03:32.000000000 
+++ /sys/arch/xen/xen/if_xennet_xenbus.c        2008-06-21 10:32:21.000000000 
@@ -322,6 +322,7 @@
        /* Initialize ifnet structure and attach interface */
        memcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
+       ((struct ethercom *)ifp)->ec_capabilities = ETHERCAP_VLAN_MTU;
        ifp->if_softc = sc;
        ifp->if_start = xennet_start;
        ifp->if_ioctl = xennet_ioctl;

--- /sys/arch/xen/xen/xennetback_xenbus.c=      2006-10-15 09:34:17.000000000 
+++ /sys/arch/xen/xen/xennetback_xenbus.c       2008-06-21 10:27:21.000000000 
@@ -310,6 +310,7 @@
            (int)domid, (int)handle);
        printf("%s: Ethernet address %s\n", ifp->if_xname,
+       ((struct ethercom *)ifp)->ec_capabilities = ETHERCAP_VLAN_MTU;
        ifp->if_flags =
        ifp->if_snd.ifq_maxlen =

gives the behaviour I wanted.

I actually don't know whether it passes oversized packets correctly,
because the vlan interface I'm using in the bridge is an untagged
interface (see the thread on tech-net about untagged vlans).  Hmm, I
should improve that so that an untagged vlan interface does not
subtract off encapsulation overhead from its parent's MTU; that would
have done as well in this case (but I think xennet and xvif should
support VLAN MTUs in any case).

/~\ The ASCII                           der Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index