diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 2dacaf3eebcd..45834830a397 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -1719,7 +1719,7 @@ t3_free_qset(adapter_t *sc, struct sge_qset *q) if (q->txq[i].txq_mr != NULL) buf_ring_free(q->txq[i].txq_mr, M_DEVBUF); if (q->txq[i].txq_ifq != NULL) { - ifq_detach(q->txq[i].txq_ifq); + ifq_delete(q->txq[i].txq_ifq); free(q->txq[i].txq_ifq, M_DEVBUF); } } @@ -2289,7 +2289,7 @@ t3_sge_alloc_qset(adapter_t *sc, u_int id, int nports, int irq_vec_idx, device_printf(sc->dev, "failed to allocate ifq\n"); goto err; } - ifq_attach(q->txq[i].txq_ifq, pi->ifp); + ifq_init(q->txq[i].txq_ifq, pi->ifp); } init_qset_cntxt(q, id); q->idx = id; diff --git a/sys/net/if.c b/sys/net/if.c index 2679be3d2bf5..2881612fd44b 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -554,6 +554,7 @@ if_alloc(u_char type) #ifdef MAC mac_ifnet_init(ifp); #endif + ifq_init(&ifp->if_snd, ifp); refcount_init(&ifp->if_refcount, 1); /* Index reference. */ IFNET_WLOCK(); @@ -596,7 +597,7 @@ if_free_internal(struct ifnet *ifp) knlist_destroy(&ifp->if_klist); IF_AFDATA_DESTROY(ifp); IF_ADDR_LOCK_DESTROY(ifp); - ifq_detach(&ifp->if_snd); + ifq_delete(&ifp->if_snd); free(ifp, M_IFNET); } @@ -655,7 +656,7 @@ if_rele(struct ifnet *ifp) } void -ifq_attach(struct ifaltq *ifq, struct ifnet *ifp) +ifq_init(struct ifaltq *ifq, struct ifnet *ifp) { mtx_init(&ifq->ifq_mtx, ifp->if_xname, "if send queue", MTX_DEF); @@ -671,7 +672,7 @@ ifq_attach(struct ifaltq *ifq, struct ifnet *ifp) } void -ifq_detach(struct ifaltq *ifq) +ifq_delete(struct ifaltq *ifq) { mtx_destroy(&ifq->ifq_mtx); } @@ -742,8 +743,6 @@ if_attach_internal(struct ifnet *ifp, int vmove) net_cdevsw.d_name, ifp->if_index); } - ifq_attach(&ifp->if_snd, ifp); - /* * Create a Link Level name for this device. */ diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 375dbce09a04..8b1a849afdaf 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -817,8 +817,8 @@ int ifpromisc(struct ifnet *, int); struct ifnet *ifunit(const char *); struct ifnet *ifunit_ref(const char *); -void ifq_attach(struct ifaltq *, struct ifnet *ifp); -void ifq_detach(struct ifaltq *); +void ifq_init(struct ifaltq *, struct ifnet *ifp); +void ifq_delete(struct ifaltq *); struct ifaddr *ifa_ifwithaddr(struct sockaddr *); struct ifaddr *ifa_ifwithbroadaddr(struct sockaddr *);