patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH 18.11] net/netvsc: fix chimney index
@ 2020-09-03  0:01 Long Li
  2020-09-03  9:37 ` Kevin Traynor
  0 siblings, 1 reply; 2+ messages in thread
From: Long Li @ 2020-09-03  0:01 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: stable, Long Li

From: Long Li <longli@microsoft.com>

[ upstream commit 3eee636809e449b8b4c0cdfaf841f2d0e4a558e8 ]

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")

Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/netvsc/hn_rxtx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
index cdd44a76c3..535f27d009 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 += __builtin_ctzll(slab);
 		rte_bitmap_clear(hv->chim_bmap, index);
+	}
 	rte_spinlock_unlock(&hv->chim_lock);
 
 	return index;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH 18.11] net/netvsc: fix chimney index
  2020-09-03  0:01 [dpdk-stable] [PATCH 18.11] net/netvsc: fix chimney index Long Li
@ 2020-09-03  9:37 ` Kevin Traynor
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Traynor @ 2020-09-03  9:37 UTC (permalink / raw)
  To: Long Li, Stephen Hemminger; +Cc: stable, Long Li

On 03/09/2020 01:01, Long Li wrote:
> From: Long Li <longli@microsoft.com>
> 
> [ upstream commit 3eee636809e449b8b4c0cdfaf841f2d0e4a558e8 ]
> 
> 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")
> 
> Signed-off-by: Long Li <longli@microsoft.com>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  drivers/ne

Applied, thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03  0:01 [dpdk-stable] [PATCH 18.11] net/netvsc: fix chimney index Long Li
2020-09-03  9:37 ` Kevin Traynor

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox