PERFORCE change 134821 for review
Kip Macy
kmacy at FreeBSD.org
Mon Feb 4 22:50:25 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=134821
Change 134821 by kmacy at kmacy:storage:toehead on 2008/02/05 06:49:56
ensure that all locks get destroyed at unload
Affected files ...
.. //depot/projects/toehead/sys/dev/cxgb/cxgb_l2t.c#4 edit
.. //depot/projects/toehead/sys/dev/cxgb/cxgb_offload.c#5 edit
Differences ...
==== //depot/projects/toehead/sys/dev/cxgb/cxgb_l2t.c#4 (text+ko) ====
@@ -543,6 +543,12 @@
void
t3_free_l2t(struct l2t_data *d)
{
+ int i;
+
+ rw_destroy(&d->lock);
+ for (i = 0; i < d->nentries; ++i)
+ mtx_destroy(&d->l2tab[i].lock);
+
cxgb_free_mem(d);
}
==== //depot/projects/toehead/sys/dev/cxgb/cxgb_offload.c#5 (text+ko) ====
@@ -1166,7 +1166,6 @@
free(addr, M_CXGB);
}
-
/*
* Allocate and initialize the TID tables. Returns 0 on success.
*/
@@ -1215,6 +1214,8 @@
static void
free_tid_maps(struct tid_info *t)
{
+ mtx_destroy(&t->stid_lock);
+ mtx_destroy(&t->atid_lock);
cxgb_free_mem(t->tid_tab);
}
@@ -1234,11 +1235,6 @@
rw_wunlock(&adapter_list_lock);
}
-/*
- * XXX
- */
-#define t3_free_l2t(...)
-
int
cxgb_offload_activate(struct adapter *adapter)
{
@@ -1272,8 +1268,6 @@
device_printf(adapter->dev, "%s: t3_init_l2t failed\n", __FUNCTION__);
goto out_free;
}
-
-
natids = min(tid_range.num / 2, MAX_ATIDS);
err = init_tid_tabs(&t->tid_maps, tid_range.num, natids,
stid_range.num, ATID_BASE, stid_range.base);
@@ -1337,6 +1331,7 @@
T3C_DATA(tdev) = NULL;
t3_free_l2t(L2DATA(tdev));
L2DATA(tdev) = NULL;
+ mtx_destroy(&t->tid_release_lock);
free(t, M_CXGB);
}
More information about the p4-projects
mailing list