Skip to content

Commit

Permalink
RDMA/nldev: Skip counter if port doesn't match
Browse files Browse the repository at this point in the history
The counter resource should return -EAGAIN if it was requested for a
different port, this is similar to how QP works if the users provides a
port filter.

Otherwise port filtering in netlink will return broken counter nests.

Fixes: c4ffee7 ("RDMA/netlink: Implement counter dumpit calback")
Link: https://lore.kernel.org/r/20191020062800.8065-1-leon@kernel.org
Signed-off-by: Mark Zhang <markz@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Mark Zhang authored and Jason Gunthorpe committed Oct 24, 2019
1 parent a9018ad commit a15542b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/nldev.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,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);
Expand Down

0 comments on commit a15542b

Please sign in to comment.