linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rdma-next] RDMA/nldev: Skip counter if port doesn't match
@ 2019-10-20  6:28 Leon Romanovsky
  2019-10-24 18:40 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Leon Romanovsky @ 2019-10-20  6:28 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Mark Zhang, RDMA mailing list, Leon Romanovsky

From: Mark Zhang <markz@mellanox.com>

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")
Signed-off-by: Mark Zhang <markz@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/core/nldev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index 5e056d5e5be3..b61005f03166 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -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);
-- 
2.20.1


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

* Re: [PATCH rdma-next] RDMA/nldev: Skip counter if port doesn't match
  2019-10-20  6:28 [PATCH rdma-next] RDMA/nldev: Skip counter if port doesn't match Leon Romanovsky
@ 2019-10-24 18:40 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2019-10-24 18:40 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Mark Zhang, RDMA mailing list, Leon Romanovsky

On Sun, Oct 20, 2019 at 09:28:00AM +0300, Leon Romanovsky wrote:
> From: Mark Zhang <markz@mellanox.com>
> 
> 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")
> Signed-off-by: Mark Zhang <markz@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  drivers/infiniband/core/nldev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-rc, thanks

Jason

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

end of thread, other threads:[~2019-10-24 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-20  6:28 [PATCH rdma-next] RDMA/nldev: Skip counter if port doesn't match Leon Romanovsky
2019-10-24 18:40 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).