Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_mbuf.c
Show First 20 Lines • Show All 1,541 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
if (ifp->if_snd_tag_alloc == NULL) | if (ifp->if_snd_tag_alloc == NULL) | ||||
return (EOPNOTSUPP); | return (EOPNOTSUPP); | ||||
return (ifp->if_snd_tag_alloc(ifp, params, mstp)); | return (ifp->if_snd_tag_alloc(ifp, params, mstp)); | ||||
} | } | ||||
void | void | ||||
m_snd_tag_init(struct m_snd_tag *mst, struct ifnet *ifp, u_int type) | m_snd_tag_init(struct m_snd_tag *mst, struct ifnet *ifp, u_int type, | ||||
const struct if_snd_tag_sw *sw) | |||||
{ | { | ||||
if_ref(ifp); | if_ref(ifp); | ||||
mst->ifp = ifp; | mst->ifp = ifp; | ||||
refcount_init(&mst->refcount, 1); | refcount_init(&mst->refcount, 1); | ||||
mst->type = type; | mst->type = type; | ||||
mst->sw = sw; | |||||
counter_u64_add(snd_tag_count, 1); | counter_u64_add(snd_tag_count, 1); | ||||
} | } | ||||
void | void | ||||
m_snd_tag_destroy(struct m_snd_tag *mst) | m_snd_tag_destroy(struct m_snd_tag *mst) | ||||
{ | { | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
ifp = mst->ifp; | ifp = mst->ifp; | ||||
ifp->if_snd_tag_free(mst); | mst->sw->snd_tag_free(mst); | ||||
if_rele(ifp); | if_rele(ifp); | ||||
counter_u64_add(snd_tag_count, -1); | counter_u64_add(snd_tag_count, -1); | ||||
} | } | ||||
/* | /* | ||||
* Allocate an mbuf with anonymous external pages. | * Allocate an mbuf with anonymous external pages. | ||||
*/ | */ | ||||
struct mbuf * | struct mbuf * | ||||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |