linux/drivers/infiniband
willy@infradead.org 9a41e38a46 IB/mad: Use IDR for agent IDs
Allocate agent IDs from a global IDR instead of an atomic variable.
This eliminates the possibility of reusing an ID which is already in
use after 4 billion registrations.  We limit the assigned ID to be less
than 2^24 as the mlx4 driver uses the most significant byte of the agent
ID to store the slave number.  Users unlucky enough to see a collision
between agent numbers and slave numbers see messages like:

 mlx4_ib: egress mad has non-null tid msb:1 class:4 slave:0

and the MAD layer stops working.

We look up the agent under protection of the RCU lock, which means we
have to free the agent using kfree_rcu, and only increment the reference
counter if it is not 0.

Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Reported-by: Hans Westgaard Ry <hans.westgaard.ry@oracle.com>
Acked-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Tested-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2018-06-18 11:22:54 -06:00
..
core IB/mad: Use IDR for agent IDs 2018-06-18 11:22:54 -06:00
hw RDMA: Convert drivers to use the AH's sgid_attr in post_wr paths 2018-06-18 11:11:27 -06:00
sw RDMA: Convert drivers to use sgid_attr instead of sgid_index 2018-06-18 11:11:26 -06:00
ulp IB: Replace ib_query_gid/ib_get_cached_gid with rdma_query_gid 2018-06-18 11:09:05 -06:00
Kconfig RDMA/ucm: Mark UCM interface as BROKEN 2018-05-24 09:39:25 -06:00
Makefile