On Wed, Oct 18, 2023 at 08:53:44PM +0200, Alexander Bluhm wrote:
> On Wed, Oct 18, 2023 at 08:19:29PM +0200, Mischa wrote:
> > It's indeed something like that: ix -> vlan (tagged) -> veb
>
> When vlan is added to veb, kernel should disable LRO on ix.
> All testing before release did not find this code path :-(
>
> Is it possible to add vlan to veb first, and then add or change the
> vlan parent to ix? If it works, that should also disable LRO.
>
> Jan said he will have a look tomorrow.
>
> trunk, carp, ... in veb or bridge might have the same issue.
First round of fixes for vlan(4), vxlan(4), nvgre(4) and bpe(4).
ok?
Index: net/if.c
===================================================================
RCS file: /cvs/src/sys/net/if.c,v
retrieving revision 1.708
diff -u -p -r1.708 if.c
--- net/if.c 16 Sep 2023 09:33:27 -0000 1.708
+++ net/if.c 19 Oct 2023 13:03:33 -0000
@@ -3243,6 +3243,17 @@ ifsetlro(struct ifnet *ifp, int on)
struct ifreq ifrq;
int error = 0;
int s = splnet();
+ struct if_parent parent;
+
+ memset(&parent, 0, sizeof(parent));
+ if ((*ifp->if_ioctl)(ifp, SIOCGIFPARENT, (caddr_t)&parent) != -1) {
+ struct ifnet *ifp0 = if_unit(parent.ifp_parent);
+
+ if (ifp0 != NULL) {
+ ifsetlro(ifp0, on);
+ if_put(ifp0);
+ }
+ }
if (!ISSET(ifp->if_capabilities, IFCAP_LRO)) {
error = ENOTSUP;
Index: net/if_bpe.c
===================================================================
RCS file: /cvs/src/sys/net/if_bpe.c,v
retrieving revision 1.19
diff -u -p -r1.19 if_bpe.c
--- net/if_bpe.c 8 Nov 2021 04:54:44 -0000 1.19
+++ net/if_bpe.c 19 Oct 2023 13:20:18 -0000
@@ -631,6 +631,9 @@ bpe_set_parent(struct bpe_softc *sc, con
goto put;
}
+ if (ether_brport_isset(ifp))
+ ifsetlro(ifp0, 0);
+
/* commit */
sc->sc_key.k_if = ifp0->if_index;
etherbridge_flush(&sc->sc_eb, IFBF_FLUSHALL);
Index: net/if_gre.c
===================================================================
RCS file: /cvs/src/sys/net/if_gre.c,v
retrieving revision 1.174
diff -u -p -r1.174 if_gre.c
--- net/if_gre.c 13 May 2023 13:35:17 -0000 1.174
+++ net/if_gre.c 19 Oct 2023 13:24:56 -0000
@@ -3544,6 +3544,9 @@ nvgre_set_parent(struct nvgre_softc *sc,
return (EPROTONOSUPPORT);
}
+ if (ether_brport_isset(&sc->sc_ac.ac_if))
+ ifsetlro(ifp0, 0);
+
/* commit */
sc->sc_ifp0 = ifp0->if_index;
if_put(ifp0);
Index: net/if_vlan.c
===================================================================
RCS file: /cvs/src/sys/net/if_vlan.c,v
retrieving revision 1.215
diff -u -p -r1.215 if_vlan.c
--- net/if_vlan.c 16 May 2023 14:32:54 -0000 1.215
+++ net/if_vlan.c 19 Oct 2023 11:08:23 -0000
@@ -937,6 +937,9 @@ vlan_set_parent(struct vlan_softc *sc, c
if (error != 0)
goto put;
+ if (ether_brport_isset(ifp))
+ ifsetlro(ifp0, 0);
+
/* commit */
sc->sc_ifidx0 = ifp0->if_index;
if (!ISSET(sc->sc_flags, IFVF_LLADDR))
Index: net/if_vxlan.c
===================================================================
RCS file: /cvs/src/sys/net/if_vxlan.c,v
retrieving revision 1.93
diff -u -p -r1.93 if_vxlan.c
--- net/if_vxlan.c 3 Aug 2023 09:49:08 -0000 1.93
+++ net/if_vxlan.c 19 Oct 2023 13:18:47 -0000
@@ -1582,6 +1582,9 @@ vxlan_set_parent(struct vxlan_softc *sc,
goto put;
}
+ if (ether_brport_isset(ifp))
+ ifsetlro(ifp0, 0);
+
/* commit */
sc->sc_if_index0 = ifp0->if_index;
etherbridge_flush(&sc->sc_eb, IFBF_FLUSHALL);