Skip to contentSkip to conversation

net/netvsc: return the correct chimney index

PATCH Applied [email protected] 3 participants 3 messages Aug 2, 2020 – Aug 5, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/netvsc: return the correct chimney index

From: Long Li <[email protected]>

The code should look into "slab" to figure out the index returned from rte_bitmap_scan().

Fixes cc02518132 ("net/netvsc: split send buffers from Tx descriptors")
---
 drivers/net/netvsc/hn_rxtx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/netvsc/hn_rxtx.c +4 -2
index 86a4c0d74..6b32c2ca7 100644
@@ -206,11 +206,13 @@ hn_chim_uninit(struct rte_eth_dev *dev)
 static uint32_t hn_chim_alloc(struct hn_data *hv)
 {
 	uint32_t index = NVS_CHIM_IDX_INVALID;
-	uint64_t slab;
+	uint64_t slab = 0;
 
 	rte_spinlock_lock(&hv->chim_lock);
-	if (rte_bitmap_scan(hv->chim_bmap, &index, &slab))
+	if (rte_bitmap_scan(hv->chim_bmap, &index, &slab)) {
+		index += rte_bsf64(slab);
 		rte_bitmap_clear(hv->chim_bmap, index);
+	}
 	rte_spinlock_unlock(&hv->chim_lock);
 
 	return index;
Signature · 1 line
2.25.1
#2 lore raw

02/08/2020 19:28, Stephen Hemminger:

Quoted 5 lines
Quoted 2 lines · On Sat, 1 Aug 2020 23:04:28 -0700 [email protected] wrote:

From: Long Li <[email protected]>

Quoted 8 lines
Quoted 6 lines

The code should look into "slab" to figure out the index returned from rte_bitmap_scan().

Fixes cc02518132 ("net/netvsc: split send buffers from Tx descriptors")

Applied, thanks