From: Long Li Date: Sun, 2 Aug 2020 06:04:28 +0000 (-0700) Subject: net/netvsc: fix chimney index X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3eee636809e449b8b4c0cdfaf841f2d0e4a558e8;p=dpdk.git net/netvsc: fix chimney index 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") Cc: stable@dpdk.org Signed-off-by: Long Li Acked-by: Stephen Hemminger --- diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 0428c586a8..87b1184bc1 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -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;