| 3016 | } |
| 3017 | |
| 3018 | static int |
| 3019 | vxlan_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 |
no test coverage detected