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 */ | ||||
int lp_detaching; /* ifnet is detaching */ | int lp_detaching; /* ifnet is detaching */ | ||||
SLIST_HEAD(__mclhd, lagg_mc) lp_mc_head; /* multicast addresses */ | SLIST_HEAD(__mclhd, lagg_mc) lp_mc_head; /* multicast addresses */ | ||||
/* Redirected callbacks */ | /* Redirected callbacks */ | ||||
int (*lp_ioctl)(struct ifnet *, u_long, caddr_t); | int (*lp_ioctl)(struct ifnet *, u_long, caddr_t); | ||||
int (*lp_output)(struct ifnet *, struct mbuf *, | int (*lp_output)(struct ifnet *, struct mbuf *, | ||||
const struct sockaddr *, struct route *); | const struct sockaddr *, struct route *); | ||||
struct lagg_counters port_counters; /* ifp counters copy */ | struct lagg_counters port_counters; /* ifp counters copy */ | ||||
CK_SLIST_ENTRY(lagg_port) lp_entries; | CK_SLIST_ENTRY(lagg_port) lp_entries; | ||||
struct epoch_context lp_epoch_ctx; | struct epoch_context lp_epoch_ctx; | ||||
}; | }; | ||||
extern struct mbuf *(*lagg_input_p)(struct ifnet *, struct mbuf *); | extern struct mbuf *(*lagg_input_ethernet_p)(struct ifnet *, struct mbuf *); | ||||
extern struct mbuf *(*lagg_input_infiniband_p)(struct ifnet *, struct mbuf *); | |||||
extern void (*lagg_linkstate_p)(struct ifnet *, int ); | extern void (*lagg_linkstate_p)(struct ifnet *, int ); | ||||
int lagg_enqueue(struct ifnet *, struct mbuf *); | int lagg_enqueue(struct ifnet *, struct mbuf *); | ||||
SYSCTL_DECL(_net_link_lagg); | SYSCTL_DECL(_net_link_lagg); | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#endif /* _NET_LAGG_H */ | #endif /* _NET_LAGG_H */ |
Nit: maybe it's worth adding a bit more spare fields just in case? e.g. making it 16 or 32 bytes?