From 66d0c056bece7ec0cd2d11513eaae88d6478d231 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Sat, 29 Jun 2019 00:51:38 +0000 Subject: [PATCH] Support IFCAP_NOMAP in vlan(4). Enable IFCAP_NOMAP for a vlan interface if it is supported by the underlying trunk device. Reviewed by: gallatin, hselasky, rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20616 --- sys/net/if_vlan.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 5f29eb61b470..681d651e7796 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1731,6 +1731,16 @@ vlan_capabilities(struct ifvlan *ifv) ena |= (mena & IFCAP_TXRTLMT); #endif + /* + * If the parent interface supports unmapped mbufs, so does + * the VLAN interface. Note that this should be fine even for + * interfaces that don't support hardware tagging as headers + * are prepended in normal mbufs to unmapped mbufs holding + * payload data. + */ + cap |= (p->if_capabilities & IFCAP_NOMAP); + ena |= (mena & IFCAP_NOMAP); + ifp->if_capabilities = cap; ifp->if_capenable = ena; ifp->if_hwassist = hwa;