Worked fine on my dual-ix(4) setup. In loadbalance mode with 9k frames
it gave me more Gbits than with a single ix(4) connection, even if I
didn't go ape on all possible combinations of mtu, trunkprotos and
whatnot.
Quick test with tcpbench on Dell 320s without pf and 9k mtu and two
ix(4) showed 6.9Gbit/s over trunk with this patch as opposed to ~5.0
with just one single ix(4) link.


2013/2/22 Stuart Henderson <s...@spacehopper.org>:
> I thought we already had something for this after the misc@ thread
> a few months ago, but clearly not.
>
> Adapted from FreeBSD if_lagg.c r171661 (which includes capability
> setting which we already do).
> http://svnweb.freebsd.org/base/head/sys/net/if_lagg.c?r1=171603&r2=171661
>
> Index: if_trunk.c
> ===================================================================
> RCS file: /cvs/src/sys/net/if_trunk.c,v
> retrieving revision 1.78
> diff -u -p -r1.78 if_trunk.c
> --- if_trunk.c  28 Oct 2011 12:49:43 -0000      1.78
> +++ if_trunk.c  22 Feb 2013 12:27:18 -0000
> @@ -315,6 +315,20 @@ trunk_port_create(struct trunk_softc *tr
>         if (ifp->if_type != IFT_ETHER)
>                 return (EPROTONOSUPPORT);
>
> +       /* Take MTU from the first member port */
> +       if (SLIST_EMPTY(&tr->tr_ports)) {
> +               if (tr->tr_ifflags & IFF_DEBUG)
> +                       printf("%s: first port, setting trunk mtu %u\n",
> +                           tr->tr_ifname, ifp->if_mtu);
> +               tr->tr_ac.ac_if.if_mtu = ifp->if_mtu;
> +               tr->tr_ac.ac_if.if_hardmtu = ifp->if_mtu;
> +       }
> +       else if (tr->tr_ac.ac_if.if_mtu != ifp->if_mtu) {
> +               printf("%s: adding %s failed, MTU %u != %u\n", tr->tr_ifname,
> +                   ifp->if_xname, ifp->if_mtu, tr->tr_ac.ac_if.if_mtu);
> +               return (EINVAL);
> +       }
> +
>         if ((error = ifpromisc(ifp, 1)) != 0)
>                 return (error);
>
> @@ -510,6 +524,10 @@ trunk_port_ioctl(struct ifnet *ifp, u_lo
>                 }
>
>                 trunk_port2req(tp, rp);
> +               break;
> +       case SIOCSIFMTU:
> +               /* Do not allow the MTU to be changed once joined */
> +               error = EINVAL;
>                 break;
>         default:
>                 error = ENOTTY;
>



-- 
May the most significant bit of your life be positive.

Reply via email to