mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
t3_free_sge_resources should be given the number of qsets it needs to free.
MFC after: 1 week
This commit is contained in:
parent
2b3b9558ef
commit
7eeb16cee7
3 changed files with 9 additions and 12 deletions
|
|
@ -510,7 +510,7 @@ int t3_sge_alloc(struct adapter *);
|
|||
int t3_sge_free(struct adapter *);
|
||||
int t3_sge_alloc_qset(adapter_t *, uint32_t, int, int, const struct qset_params *,
|
||||
int, struct port_info *);
|
||||
void t3_free_sge_resources(adapter_t *);
|
||||
void t3_free_sge_resources(adapter_t *, int);
|
||||
void t3_sge_start(adapter_t *);
|
||||
void t3_sge_stop(adapter_t *);
|
||||
void t3b_intr(void *data);
|
||||
|
|
|
|||
|
|
@ -717,7 +717,7 @@ cxgb_controller_detach(device_t dev)
|
|||
static void
|
||||
cxgb_free(struct adapter *sc)
|
||||
{
|
||||
int i;
|
||||
int i, nqsets = 0;
|
||||
|
||||
ADAPTER_LOCK(sc);
|
||||
sc->flags |= CXGB_SHUTDOWN;
|
||||
|
|
@ -731,6 +731,7 @@ cxgb_free(struct adapter *sc)
|
|||
if (sc->portdev[i] &&
|
||||
device_delete_child(sc->dev, sc->portdev[i]) != 0)
|
||||
device_printf(sc->dev, "failed to delete child port\n");
|
||||
nqsets += sc->port[i].nqsets;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -756,7 +757,7 @@ cxgb_free(struct adapter *sc)
|
|||
* sysctls are cleaned up by the kernel linker.
|
||||
*/
|
||||
if (sc->flags & FULL_INIT_DONE) {
|
||||
t3_free_sge_resources(sc);
|
||||
t3_free_sge_resources(sc, nqsets);
|
||||
sc->flags &= ~FULL_INIT_DONE;
|
||||
}
|
||||
|
||||
|
|
@ -842,9 +843,9 @@ setup_sge_qsets(adapter_t *sc)
|
|||
(sc->flags & USING_MSIX) ? qset_idx + 1 : irq_idx,
|
||||
&sc->params.sge.qset[qset_idx], ntxq, pi);
|
||||
if (err) {
|
||||
t3_free_sge_resources(sc);
|
||||
device_printf(sc->dev, "t3_sge_alloc_qset failed with %d\n",
|
||||
err);
|
||||
t3_free_sge_resources(sc, qset_idx);
|
||||
device_printf(sc->dev,
|
||||
"t3_sge_alloc_qset failed with %d\n", err);
|
||||
return (err);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2092,18 +2092,14 @@ t3_free_qset(adapter_t *sc, struct sge_qset *q)
|
|||
* Frees resources used by the SGE queue sets.
|
||||
*/
|
||||
void
|
||||
t3_free_sge_resources(adapter_t *sc)
|
||||
t3_free_sge_resources(adapter_t *sc, int nqsets)
|
||||
{
|
||||
int i, nqsets;
|
||||
|
||||
for (nqsets = i = 0; i < (sc)->params.nports; i++)
|
||||
nqsets += sc->port[i].nqsets;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nqsets; ++i) {
|
||||
TXQ_LOCK(&sc->sge.qs[i]);
|
||||
t3_free_qset(sc, &sc->sge.qs[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue