r193336 moved ifq_detach to if_free which broke if_alloc followed
by if_free (w/o doing if_attach); move ifq_attach to if_alloc and rename ifq_attach/detach to ifq_init/ifq_delete to better identify their purpose Reviewed by: jhb, kmacy
This commit is contained in:
parent
b3631c54b6
commit
df30f1c9f2
@ -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;
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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 *);
|
||||
|
Loading…
x
Reference in New Issue
Block a user