summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2013-08-23 18:03:18 +0000
committernp <np@FreeBSD.org>2013-08-23 18:03:18 +0000
commitcde487f27a84e02a560384f75178fddca68740f6 (patch)
tree3e47823008481e812b1f3dc80ad109fd4059d8c0
parent1a535523cd7d4a25cbdb68b60e29942c9f7afef3 (diff)
downloadFreeBSD-src-cde487f27a84e02a560384f75178fddca68740f6.zip
FreeBSD-src-cde487f27a84e02a560384f75178fddca68740f6.tar.gz
There is no need to hold the freelist lock around alloc/free of
software descriptors. This also silences WITNESS warnings when the software descriptors are allocated with M_WAITOK. MFC after: 1 week
-rw-r--r--sys/dev/cxgbe/t4_sge.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index 5064d70..2ab1810 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -1802,9 +1802,7 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
/* Allocate space for one software descriptor per buffer. */
fl->cap = (fl->qsize - spg_len / RX_FL_ESIZE) * 8;
- FL_LOCK(fl);
rc = alloc_fl_sdesc(fl);
- FL_UNLOCK(fl);
if (rc != 0) {
device_printf(sc->dev,
"failed to setup fl software descriptors: %d\n",
@@ -1937,11 +1935,8 @@ free_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl)
free_ring(sc, fl->desc_tag, fl->desc_map, fl->ba,
fl->desc);
- if (fl->sdesc) {
- FL_LOCK(fl);
+ if (fl->sdesc)
free_fl_sdesc(fl);
- FL_UNLOCK(fl);
- }
if (mtx_initialized(&fl->fl_lock))
mtx_destroy(&fl->fl_lock);
@@ -2788,8 +2783,6 @@ alloc_fl_sdesc(struct sge_fl *fl)
bus_dma_tag_t tag;
int i, rc;
- FL_LOCK_ASSERT_OWNED(fl);
-
fl->sdesc = malloc(fl->cap * sizeof(struct fl_sdesc), M_CXGBE,
M_ZERO | M_WAITOK);
@@ -2828,8 +2821,6 @@ free_fl_sdesc(struct sge_fl *fl)
struct fl_sdesc *sd;
int i;
- FL_LOCK_ASSERT_OWNED(fl);
-
sd = fl->sdesc;
for (i = 0; i < fl->cap; i++, sd++) {
OpenPOWER on IntegriCloud