Skip to contentSkip to conversation

RDMA/nldev: Skip counter if port doesn't match

PATCH Applied Leon Romanovsky 2 participants 2 messages Oct 20, 2019 – Oct 24, 2019 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/nldev: Skip counter if port doesn't match

From: Mark Zhang <[email protected]>

Counter resource should return -EAGAIN if it was requested for other part. Such situation can occur in multi-port systems.

Fixes c4ffee7c9bdb ("RDMA/netlink: Implement counter dumpit calback")
---
 drivers/infiniband/core/nldev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/nldev.c +1 -1
index 5e056d5e5be3..b61005f03166 100644
@@ -832,7 +832,7 @@ static int fill_res_counter_entry(struct sk_buff *msg, bool has_cap_net_admin,
 		container_of(res, struct rdma_counter, res);
 
 	if (port && port != counter->port)
-		return 0;
+		return -EAGAIN;
 
 	/* Dump it even query failed */
 	rdma_counter_query_stats(counter);
Signature · 1 line
2.20.1
#1 lore raw
Quoted 11 lines · Leon Romanovsky

From: Mark Zhang <[email protected]>

Counter resource should return -EAGAIN if it was requested for other part. Such situation can occur in multi-port systems.

Fixes c4ffee7c9bdb ("RDMA/netlink: Implement counter dumpit calback")
---
 drivers/infiniband/core/nldev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-rc, thanks

Jason