MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vxlan_set_reqcap

Function vxlan_set_reqcap

freebsd/net/if_vxlan.c:3018–3049  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3016}
3017
3018static int
3019vxlan_set_reqcap(struct vxlan_softc *sc, struct ifnet *ifp, int reqcap)
3020{
3021 int mask = reqcap ^ ifp->if_capenable;
3022
3023 /* Disable TSO if tx checksums are disabled. */
3024 if (mask & IFCAP_TXCSUM && !(reqcap & IFCAP_TXCSUM) &&
3025 reqcap & IFCAP_TSO4) {
3026 reqcap &= ~IFCAP_TSO4;
3027 if_printf(ifp, "tso4 disabled due to -txcsum.\n");
3028 }
3029 if (mask & IFCAP_TXCSUM_IPV6 && !(reqcap & IFCAP_TXCSUM_IPV6) &&
3030 reqcap & IFCAP_TSO6) {
3031 reqcap &= ~IFCAP_TSO6;
3032 if_printf(ifp, "tso6 disabled due to -txcsum6.\n");
3033 }
3034
3035 /* Do not enable TSO if tx checksums are disabled. */
3036 if (mask & IFCAP_TSO4 && reqcap & IFCAP_TSO4 &&
3037 !(reqcap & IFCAP_TXCSUM)) {
3038 if_printf(ifp, "enable txcsum first.\n");
3039 return (EAGAIN);
3040 }
3041 if (mask & IFCAP_TSO6 && reqcap & IFCAP_TSO6 &&
3042 !(reqcap & IFCAP_TXCSUM_IPV6)) {
3043 if_printf(ifp, "enable txcsum6 first.\n");
3044 return (EAGAIN);
3045 }
3046
3047 sc->vxl_reqcap = reqcap;
3048 return (0);
3049}
3050
3051/*
3052 * A VXLAN interface inherits the capabilities of the vxlandev or the interface

Callers 1

vxlan_ioctlFunction · 0.85

Calls 1

if_printfFunction · 0.85

Tested by

no test coverage detected