Lines 56-61
__FBSDID("$FreeBSD: stable/11/sys/net/if
Link Here
|
56 |
#include <net/if_var.h> |
56 |
#include <net/if_var.h> |
57 |
#include <net/if_clone.h> |
57 |
#include <net/if_clone.h> |
58 |
#include <net/if_dl.h> |
58 |
#include <net/if_dl.h> |
|
|
59 |
#include <net/if_media.h> |
59 |
#include <net/if_types.h> |
60 |
#include <net/if_types.h> |
60 |
#include <net/if_vxlan.h> |
61 |
#include <net/if_vxlan.h> |
61 |
#include <net/netisr.h> |
62 |
#include <net/netisr.h> |
Lines 180-185
struct vxlan_softc {
Link Here
|
180 |
char vxl_mc_ifname[IFNAMSIZ]; |
181 |
char vxl_mc_ifname[IFNAMSIZ]; |
181 |
LIST_ENTRY(vxlan_softc) vxl_entry; |
182 |
LIST_ENTRY(vxlan_softc) vxl_entry; |
182 |
LIST_ENTRY(vxlan_softc) vxl_ifdetach_list; |
183 |
LIST_ENTRY(vxlan_softc) vxl_ifdetach_list; |
|
|
184 |
struct ifmedia vxl_media; |
183 |
}; |
185 |
}; |
184 |
|
186 |
|
185 |
#define VXLAN_RLOCK(_sc, _p) rm_rlock(&(_sc)->vxl_lock, (_p)) |
187 |
#define VXLAN_RLOCK(_sc, _p) rm_rlock(&(_sc)->vxl_lock, (_p)) |
Lines 361-366
static int vxlan_check_ttl(int);
Link Here
|
361 |
static int vxlan_check_ftable_timeout(uint32_t); |
363 |
static int vxlan_check_ftable_timeout(uint32_t); |
362 |
static int vxlan_check_ftable_max(uint32_t); |
364 |
static int vxlan_check_ftable_max(uint32_t); |
363 |
|
365 |
|
|
|
366 |
static int vxlan_media_change(struct ifnet *); |
367 |
static void vxlan_media_status(struct ifnet *, struct ifmediareq *); |
368 |
|
364 |
static void vxlan_sysctl_setup(struct vxlan_softc *); |
369 |
static void vxlan_sysctl_setup(struct vxlan_softc *); |
365 |
static void vxlan_sysctl_destroy(struct vxlan_softc *); |
370 |
static void vxlan_sysctl_destroy(struct vxlan_softc *); |
366 |
static int vxlan_tunable_int(struct vxlan_softc *, const char *, int); |
371 |
static int vxlan_tunable_int(struct vxlan_softc *, const char *, int); |
Lines 1706-1711
vxlan_teardown_locked(struct vxlan_softc
Link Here
|
1706 |
ifp->if_flags &= ~IFF_UP; |
1711 |
ifp->if_flags &= ~IFF_UP; |
1707 |
ifp->if_drv_flags &= ~IFF_DRV_RUNNING; |
1712 |
ifp->if_drv_flags &= ~IFF_DRV_RUNNING; |
1708 |
callout_stop(&sc->vxl_callout); |
1713 |
callout_stop(&sc->vxl_callout); |
|
|
1714 |
ifmedia_removeall(&sc->vxl_media); |
1709 |
vso = sc->vxl_sock; |
1715 |
vso = sc->vxl_sock; |
1710 |
sc->vxl_sock = NULL; |
1716 |
sc->vxl_sock = NULL; |
1711 |
|
1717 |
|
Lines 2219-2224
vxlan_ioctl(struct ifnet *ifp, u_long cm
Link Here
|
2219 |
case SIOCSIFFLAGS: |
2225 |
case SIOCSIFFLAGS: |
2220 |
error = vxlan_ioctl_ifflags(sc); |
2226 |
error = vxlan_ioctl_ifflags(sc); |
2221 |
break; |
2227 |
break; |
|
|
2228 |
|
2229 |
case SIOCSIFMEDIA: |
2230 |
case SIOCGIFMEDIA: |
2231 |
error = ifmedia_ioctl(ifp, (struct ifreq *)data, &sc->vxl_media, cmd); |
2232 |
break; |
2233 |
|
2222 |
default: |
2234 |
default: |
2223 |
error = ether_ioctl(ifp, cmd, data); |
2235 |
error = ether_ioctl(ifp, cmd, data); |
2224 |
break; |
2236 |
break; |
Lines 2227-2232
vxlan_ioctl(struct ifnet *ifp, u_long cm
Link Here
|
2227 |
return (error); |
2239 |
return (error); |
2228 |
} |
2240 |
} |
2229 |
|
2241 |
|
|
|
2242 |
static int |
2243 |
vxlan_media_change(struct ifnet *ifp) |
2244 |
{ |
2245 |
/* Ignore */ |
2246 |
return (0); |
2247 |
} |
2248 |
|
2249 |
static void |
2250 |
vxlan_media_status(struct ifnet *ifp, struct ifmediareq *imr) |
2251 |
{ |
2252 |
imr->ifm_status = IFM_ACTIVE | IFM_AVALID; |
2253 |
imr->ifm_active = IFM_ETHER | IFM_10G_T | IFM_FDX; |
2254 |
} |
2255 |
|
2230 |
#if defined(INET) || defined(INET6) |
2256 |
#if defined(INET) || defined(INET6) |
2231 |
static uint16_t |
2257 |
static uint16_t |
2232 |
vxlan_pick_source_port(struct vxlan_softc *sc, struct mbuf *m) |
2258 |
vxlan_pick_source_port(struct vxlan_softc *sc, struct mbuf *m) |
Lines 2678-2694
vxlan_clone_create(struct if_clone *ifc,
Link Here
|
2678 |
vxlan_sysctl_setup(sc); |
2704 |
vxlan_sysctl_setup(sc); |
2679 |
|
2705 |
|
2680 |
ifp->if_softc = sc; |
2706 |
ifp->if_softc = sc; |
|
|
2707 |
/* Initialize pseudo media types */ |
2708 |
|
2709 |
ifmedia_init(&sc->vxl_media, 0, vxlan_media_change, vxlan_media_status); |
2710 |
ifmedia_add(&sc->vxl_media, IFM_ETHER | IFM_10G_T | IFM_FDX, 0, NULL); |
2711 |
ifmedia_set(&sc->vxl_media, IFM_ETHER | IFM_10G_T | IFM_FDX); |
2712 |
|
2681 |
if_initname(ifp, vxlan_name, unit); |
2713 |
if_initname(ifp, vxlan_name, unit); |
2682 |
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; |
2714 |
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; |
2683 |
ifp->if_init = vxlan_init; |
2715 |
ifp->if_init = vxlan_init; |
2684 |
ifp->if_ioctl = vxlan_ioctl; |
2716 |
ifp->if_ioctl = vxlan_ioctl; |
2685 |
ifp->if_transmit = vxlan_transmit; |
2717 |
ifp->if_transmit = vxlan_transmit; |
2686 |
ifp->if_qflush = vxlan_qflush; |
2718 |
ifp->if_qflush = vxlan_qflush; |
|
|
2719 |
ifp->if_link_state = LINK_STATE_UP; |
2687 |
|
2720 |
|
2688 |
vxlan_fakeaddr(sc); |
2721 |
vxlan_fakeaddr(sc); |
2689 |
ether_ifattach(ifp, sc->vxl_hwaddr); |
2722 |
ether_ifattach(ifp, sc->vxl_hwaddr); |
2690 |
|
2723 |
|
2691 |
ifp->if_baudrate = 0; |
2724 |
ifp->if_baudrate = IF_Gbps(10); |
2692 |
ifp->if_hdrlen = 0; |
2725 |
ifp->if_hdrlen = 0; |
2693 |
|
2726 |
|
2694 |
return (0); |
2727 |
return (0); |