On 2013/02/22 12:30, Stuart Henderson wrote:
> 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

JJ tested this diff but I didn't hear much else. Any comments?
Currently it is not possible to use jumbo frames with trunk(4) interfaces.



Index: if_trunk.c
===================================================================
RCS file: /cvs/src/sys/net/if_trunk.c,v
retrieving revision 1.81
diff -u -p -r1.81 if_trunk.c
--- if_trunk.c  2 Apr 2013 08:54:37 -0000       1.81
+++ if_trunk.c  10 May 2013 13:09:49 -0000
@@ -313,6 +313,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);
 
@@ -508,6 +522,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;

Reply via email to