Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_vlan.c
Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | for (_i = 0; \ | ||||
_i = (_touch && ((_trunk) != NULL) ? 0 : _i + 1), _touch = false) \ | _i = (_touch && ((_trunk) != NULL) ? 0 : _i + 1), _touch = false) \ | ||||
if (((_ifv) = CK_SLIST_FIRST(&(_trunk)->hash[_i])) != NULL && \ | if (((_ifv) = CK_SLIST_FIRST(&(_trunk)->hash[_i])) != NULL && \ | ||||
(_touch = true)) | (_touch = true)) | ||||
#endif /* VLAN_ARRAY */ | #endif /* VLAN_ARRAY */ | ||||
struct vlan_mc_entry { | struct vlan_mc_entry { | ||||
struct sockaddr_dl mc_addr; | struct sockaddr_dl mc_addr; | ||||
CK_SLIST_ENTRY(vlan_mc_entry) mc_entries; | CK_SLIST_ENTRY(vlan_mc_entry) mc_entries; | ||||
struct epoch_context mc_epoch_ctx; | epoch_context_t mc_epoch_ctx; | ||||
}; | }; | ||||
struct ifvlan { | struct ifvlan { | ||||
struct ifvlantrunk *ifv_trunk; | struct ifvlantrunk *ifv_trunk; | ||||
struct ifnet *ifv_ifp; | struct ifnet *ifv_ifp; | ||||
#define TRUNK(ifv) ((ifv)->ifv_trunk) | #define TRUNK(ifv) ((ifv)->ifv_trunk) | ||||
#define PARENT(ifv) ((ifv)->ifv_trunk->parent) | #define PARENT(ifv) ((ifv)->ifv_trunk->parent) | ||||
void *ifv_cookie; | void *ifv_cookie; | ||||
▲ Show 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | |||||
VNET_DEFINE_STATIC(struct if_clone *, vlan_cloner); | VNET_DEFINE_STATIC(struct if_clone *, vlan_cloner); | ||||
#define V_vlan_cloner VNET(vlan_cloner) | #define V_vlan_cloner VNET(vlan_cloner) | ||||
#endif | #endif | ||||
#ifndef VLAN_ARRAY | #ifndef VLAN_ARRAY | ||||
#define HASH(n, m) ((((n) >> 8) ^ ((n) >> 4) ^ (n)) & (m)) | #define HASH(n, m) ((((n) >> 8) ^ ((n) >> 4) ^ (n)) & (m)) | ||||
static void | static void | ||||
vlan_mc_free(struct epoch_context *ctx) | vlan_mc_free(epoch_context_t *ctx) | ||||
{ | { | ||||
struct vlan_mc_entry *mc = __containerof(ctx, struct vlan_mc_entry, mc_epoch_ctx); | struct vlan_mc_entry *mc = __containerof(ctx, struct vlan_mc_entry, mc_epoch_ctx); | ||||
free(mc, M_VLAN); | free(mc, M_VLAN); | ||||
} | } | ||||
static void | static void | ||||
vlan_inithash(struct ifvlantrunk *trunk) | vlan_inithash(struct ifvlantrunk *trunk) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 1,618 Lines • Show Last 20 Lines |