diff options
author | Navdeep Parhar <np@FreeBSD.org> | 2012-12-21 19:28:17 +0000 |
---|---|---|
committer | Navdeep Parhar <np@FreeBSD.org> | 2012-12-21 19:28:17 +0000 |
commit | 4cead97615aad45ef426f0c96e83d4374d167f9b (patch) | |
tree | 8a4145ffa4daafa4fe8589a35efb19ef21bb9f4d /sys/dev/cxgbe/t4_l2t.c | |
parent | 526e1dc1c0d052b9d2a6cd6da7a16eb09c971c54 (diff) |
cxgbe(4): must hold a write-lock on the table while allocating an L2
entry for switching.
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=244551
Diffstat (limited to 'sys/dev/cxgbe/t4_l2t.c')
-rw-r--r-- | sys/dev/cxgbe/t4_l2t.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/cxgbe/t4_l2t.c b/sys/dev/cxgbe/t4_l2t.c index 6476b9b5ecc8..dd8748edbac9 100644 --- a/sys/dev/cxgbe/t4_l2t.c +++ b/sys/dev/cxgbe/t4_l2t.c @@ -149,7 +149,7 @@ t4_l2t_alloc_switching(struct l2t_data *d) { struct l2t_entry *e; - rw_rlock(&d->lock); + rw_wlock(&d->lock); e = t4_alloc_l2e(d); if (e) { mtx_lock(&e->lock); /* avoid race with t4_l2t_free */ @@ -157,7 +157,7 @@ t4_l2t_alloc_switching(struct l2t_data *d) atomic_store_rel_int(&e->refcnt, 1); mtx_unlock(&e->lock); } - rw_runlock(&d->lock); + rw_wunlock(&d->lock); return e; } |