Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_lagg.h
Show First 20 Lines • Show All 202 Lines • ▼ Show 20 Lines | |||||
typedef enum { | typedef enum { | ||||
LAGG_LLQTYPE_PHYS = 0, /* Task related to physical (underlying) port */ | LAGG_LLQTYPE_PHYS = 0, /* Task related to physical (underlying) port */ | ||||
LAGG_LLQTYPE_VIRT, /* Task related to lagg interface itself */ | LAGG_LLQTYPE_VIRT, /* Task related to lagg interface itself */ | ||||
} lagg_llqtype; | } lagg_llqtype; | ||||
/* List of interfaces to have the MAC address modified */ | /* List of interfaces to have the MAC address modified */ | ||||
struct lagg_llq { | struct lagg_llq { | ||||
struct ifnet *llq_ifp; | struct ifnet *llq_ifp; | ||||
uint8_t llq_lladdr[ETHER_ADDR_LEN]; | uint8_t llq_lladdr[ETHER_ADDR_LEN]; | ||||
lagg_llqtype llq_type; | lagg_llqtype llq_type; | ||||
smh: Any reason for the blank line here? | |||||
#define LAGG_ASYNC_SET_MAC_ADDR 0x0001 | |||||
#define LAGG_ASYNC_SET_MTU 0x0002 | |||||
#define LAGG_ASYNC_SET_MASK (LAGG_ASYNC_SET_MAC_ADDR | LAGG_ASYNC_SET_MTU) | |||||
uint16_t flags; | |||||
hrsUnsubmitted Done Inline ActionsPlease add "llq_" prefix to the members. hrs: Please add "llq_" prefix to the members. | |||||
struct ifreq *ifr; /* Common to all lagg member ports */ | |||||
hrsUnsubmitted Done Inline ActionsIs there any reason to have ifr as a pointer? malloc is generally expensive in kernel, and overhead of struct ifreq is acceptable for me even if every llq has one. I feel this complicates the error handling at least. hrs: Is there any reason to have ifr as a pointer? malloc is generally expensive in kernel, and… | |||||
uint32_t old_mtu; | |||||
int (*llq_ioctl)(struct ifnet *, u_long, caddr_t); | |||||
SLIST_ENTRY(lagg_llq) llq_entries; | SLIST_ENTRY(lagg_llq) llq_entries; | ||||
}; | }; | ||||
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 Actionsnot sure but looks like there are alignment issues here? smh: not sure but looks like there are alignment issues here? | |||||
Not Done Inline ActionsI think it's an artifact of Phabricator; it's aligned correctly in the file. rpokala: I think it's an artifact of Phabricator; it's aligned correctly in the file. | |||||
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 */ | ||||
void *sc_psc; /* protocol data */ | void *sc_psc; /* protocol data */ | ||||
uint32_t sc_seq; /* sequence counter */ | uint32_t sc_seq; /* sequence counter */ | ||||
uint32_t sc_flags; | uint32_t sc_flags; | ||||
SLIST_HEAD(__tplhd, lagg_port) sc_ports; /* list of interfaces */ | SLIST_HEAD(__tplhd, lagg_port) sc_ports; /* list of interfaces */ | ||||
SLIST_ENTRY(lagg_softc) sc_entries; | SLIST_ENTRY(lagg_softc) sc_entries; | ||||
struct task sc_lladdr_task; | struct task sc_llq_task; /* ASYNC ops enqueued here */ | ||||
SLIST_HEAD(__llqhd, lagg_llq) sc_llq_head; /* interfaces to program | SLIST_HEAD(__llqhd, lagg_llq) sc_llq_head; /* interfaces to program | ||||
the lladdr on */ | the MAC, lladdr on */ | ||||
eventhandler_tag vlan_attach; | eventhandler_tag vlan_attach; | ||||
eventhandler_tag vlan_detach; | eventhandler_tag vlan_detach; | ||||
struct callout sc_callout; | struct callout sc_callout; | ||||
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 */ | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |
Any reason for the blank line here?