Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_lagg.h
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/* | /* | ||||
* lagg ioctls. | * lagg ioctls. | ||||
*/ | */ | ||||
/* | /* | ||||
* LACP current operational parameters structure. | * LACP current operational parameters structure. | ||||
*/ | */ | ||||
melifaro: Nit: maybe it's worth adding a bit more spare fields just in case? e.g. making it 16 or 32… | |||||
struct lacp_opreq { | struct lacp_opreq { | ||||
uint16_t actor_prio; | uint16_t actor_prio; | ||||
uint8_t actor_mac[ETHER_ADDR_LEN]; | uint8_t actor_mac[ETHER_ADDR_LEN]; | ||||
uint16_t actor_key; | uint16_t actor_key; | ||||
uint16_t actor_portprio; | uint16_t actor_portprio; | ||||
uint16_t actor_portno; | uint16_t actor_portno; | ||||
uint8_t actor_state; | uint8_t actor_state; | ||||
uint16_t partner_prio; | uint16_t partner_prio; | ||||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
struct lagg_counters { | struct lagg_counters { | ||||
uint64_t val[IFCOUNTERS]; | uint64_t val[IFCOUNTERS]; | ||||
}; | }; | ||||
struct lagg_softc { | struct lagg_softc { | ||||
struct ifnet *sc_ifp; /* virtual interface */ | struct ifnet *sc_ifp; /* virtual interface */ | ||||
struct rmlock sc_mtx; | struct rmlock sc_mtx; | ||||
Done Inline ActionsProbably worth adding some comment what does this lock protect? :-) melifaro: Probably worth adding some comment what does this lock protect? :-) | |||||
struct sx sc_sx; | struct sx sc_sx; | ||||
int sc_proto; /* lagg protocol */ | int sc_proto; /* lagg protocol */ | ||||
u_int sc_count; /* number of ports */ | u_int sc_count; /* number of ports */ | ||||
u_int sc_active; /* active port count */ | u_int sc_active; /* active port count */ | ||||
u_int sc_flapping; /* number of flapping | u_int sc_flapping; /* number of flapping | ||||
* events */ | * events */ | ||||
struct lagg_port *sc_primary; /* primary port */ | struct lagg_port *sc_primary; /* primary port */ | ||||
struct ifmedia sc_media; /* media config */ | struct ifmedia sc_media; /* media config */ | ||||
Show All 12 Lines | struct lagg_softc { | ||||
u_int sc_opts; | u_int sc_opts; | ||||
int flowid_shift; /* shift the flowid */ | int flowid_shift; /* shift the flowid */ | ||||
struct lagg_counters detached_counters; /* detached ports sum */ | struct lagg_counters detached_counters; /* detached ports sum */ | ||||
}; | }; | ||||
struct lagg_port { | struct lagg_port { | ||||
struct ifnet *lp_ifp; /* physical interface */ | struct ifnet *lp_ifp; /* physical interface */ | ||||
struct lagg_softc *lp_softc; /* parent lagg */ | struct lagg_softc *lp_softc; /* parent lagg */ | ||||
uint8_t lp_lladdr[ETHER_ADDR_LEN]; | #define LAGG_ADDR_LEN \ | ||||
MAX(INFINIBAND_ADDR_LEN, ETHER_ADDR_LEN) | |||||
uint8_t lp_lladdr[LAGG_ADDR_LEN]; | |||||
u_char lp_iftype; /* interface type */ | u_char lp_iftype; /* interface type */ | ||||
uint32_t lp_prio; /* port priority */ | uint32_t lp_prio; /* port priority */ | ||||
uint32_t lp_flags; /* port flags */ | uint32_t lp_flags; /* port flags */ | ||||
int lp_ifflags; /* saved ifp flags */ | int lp_ifflags; /* saved ifp flags */ | ||||
int lp_ifcapenable; /* saved ifp capenable */ | int lp_ifcapenable; /* saved ifp capenable */ | ||||
void *lh_cookie; /* if state hook */ | void *lh_cookie; /* if state hook */ | ||||
void *lp_psc; /* protocol data */ | void *lp_psc; /* protocol data */ | ||||
Show All 23 Lines |
Nit: maybe it's worth adding a bit more spare fields just in case? e.g. making it 16 or 32 bytes?