Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/if_lagg.c
Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | |||||
static int lagg_snd_tag_alloc(struct ifnet *, | static int lagg_snd_tag_alloc(struct ifnet *, | ||||
union if_snd_tag_alloc_params *, | union if_snd_tag_alloc_params *, | ||||
struct m_snd_tag **); | struct m_snd_tag **); | ||||
static int lagg_snd_tag_modify(struct m_snd_tag *, | static int lagg_snd_tag_modify(struct m_snd_tag *, | ||||
union if_snd_tag_modify_params *); | union if_snd_tag_modify_params *); | ||||
static int lagg_snd_tag_query(struct m_snd_tag *, | static int lagg_snd_tag_query(struct m_snd_tag *, | ||||
union if_snd_tag_query_params *); | union if_snd_tag_query_params *); | ||||
static void lagg_snd_tag_free(struct m_snd_tag *); | static void lagg_snd_tag_free(struct m_snd_tag *); | ||||
static void lagg_ratelimit_query(struct ifnet *, | |||||
struct if_ratelimit_query_results *); | |||||
#endif | #endif | ||||
static int lagg_setmulti(struct lagg_port *); | static int lagg_setmulti(struct lagg_port *); | ||||
static int lagg_clrmulti(struct lagg_port *); | static int lagg_clrmulti(struct lagg_port *); | ||||
static int lagg_setcaps(struct lagg_port *, int cap); | static int lagg_setcaps(struct lagg_port *, int cap); | ||||
static int lagg_setflag(struct lagg_port *, int, int, | static int lagg_setflag(struct lagg_port *, int, int, | ||||
int (*func)(struct ifnet *, int)); | int (*func)(struct ifnet *, int)); | ||||
static int lagg_setflags(struct lagg_port *, int status); | static int lagg_setflags(struct lagg_port *, int status); | ||||
static uint64_t lagg_get_counter(struct ifnet *ifp, ift_counter cnt); | static uint64_t lagg_get_counter(struct ifnet *ifp, ift_counter cnt); | ||||
▲ Show 20 Lines • Show All 377 Lines • ▼ Show 20 Lines | lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params) | ||||
ifp->if_ioctl = lagg_ioctl; | ifp->if_ioctl = lagg_ioctl; | ||||
ifp->if_get_counter = lagg_get_counter; | ifp->if_get_counter = lagg_get_counter; | ||||
ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; | ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; | ||||
#ifdef RATELIMIT | #ifdef RATELIMIT | ||||
ifp->if_snd_tag_alloc = lagg_snd_tag_alloc; | ifp->if_snd_tag_alloc = lagg_snd_tag_alloc; | ||||
ifp->if_snd_tag_modify = lagg_snd_tag_modify; | ifp->if_snd_tag_modify = lagg_snd_tag_modify; | ||||
ifp->if_snd_tag_query = lagg_snd_tag_query; | ifp->if_snd_tag_query = lagg_snd_tag_query; | ||||
ifp->if_snd_tag_free = lagg_snd_tag_free; | ifp->if_snd_tag_free = lagg_snd_tag_free; | ||||
ifp->if_ratelimit_query = lagg_ratelimit_query; | |||||
#endif | #endif | ||||
ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; | ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; | ||||
/* | /* | ||||
* Attach as an ordinary ethernet device, children will be attached | * Attach as an ordinary ethernet device, children will be attached | ||||
* as special device IFT_IEEE8023ADLAG. | * as special device IFT_IEEE8023ADLAG. | ||||
*/ | */ | ||||
ether_ifattach(ifp, eaddr); | ether_ifattach(ifp, eaddr); | ||||
▲ Show 20 Lines • Show All 1,117 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct lagg_snd_tag *lst; | struct lagg_snd_tag *lst; | ||||
lst = mst_to_lst(mst); | lst = mst_to_lst(mst); | ||||
m_snd_tag_rele(lst->tag); | m_snd_tag_rele(lst->tag); | ||||
free(lst, M_LAGG); | free(lst, M_LAGG); | ||||
} | } | ||||
static void | |||||
lagg_ratelimit_query(struct ifnet *ifp __unused, struct if_ratelimit_query_results *q) | |||||
{ | |||||
/* | |||||
* For lagg, we have an indirect | |||||
* interface. The caller needs to | |||||
* get a ratelimit tag on the actual | |||||
* interface the flow will go on. | |||||
*/ | |||||
q->rate_table = NULL; | |||||
q->flags = RT_IS_INDIRECT; | |||||
q->max_flows = 0; | |||||
q->number_of_rates = 0; | |||||
} | |||||
#endif | #endif | ||||
static int | static int | ||||
lagg_setmulti(struct lagg_port *lp) | lagg_setmulti(struct lagg_port *lp) | ||||
{ | { | ||||
struct lagg_softc *sc = lp->lp_softc; | struct lagg_softc *sc = lp->lp_softc; | ||||
struct ifnet *ifp = lp->lp_ifp; | struct ifnet *ifp = lp->lp_ifp; | ||||
struct ifnet *scifp = sc->sc_ifp; | struct ifnet *scifp = sc->sc_ifp; | ||||
▲ Show 20 Lines • Show All 693 Lines • Show Last 20 Lines |