]> www.infradead.org Git - users/jedix/linux-maple.git/commit
IB/mad: Use ID allocator routines to allocate agent number
authorHans Westgaard Ry <hans.westgaard.ry@oracle.com>
Fri, 1 Jun 2018 10:24:40 +0000 (12:24 +0200)
committerBrian Maly <brian.maly@oracle.com>
Tue, 31 Jul 2018 19:35:30 +0000 (15:35 -0400)
commit54be9e10290b9e4626732dd943dacca3e1c946a4
treeaa37005cf6a43ca8647cb7d89e2a77438fa02789
parent8f8d480300222ec7391462759e03b6886c083eda
IB/mad: Use ID allocator routines to allocate agent number

The agent TID is a 64 bit value split in two dwords.  The least
significant dword is the TID running counter. The most significant
dword is the agent number. In the CX-3 shared port model, the mlx4
driver uses the most significant byte of the agent number to store the
slave number, making agent numbers greater and equal to 2^24 (3 bytes)
unusable.  The current codebase uses a variable which is incremented
for each new agent number giving too large agent numbers over time.
The IDA set of functions are used instead of the simple counter
approach. This allows re-use of agent numbers.

The signature of the bug is a MAD layer that stops working and the
console is flooded with messages like:
mlx4_ib: egress mad has non-null tid msb:1 class:4 slave:0

Orabug: 28339815

Signed-off-by: Hans Westgaard Ry <hans.westgaard.ry@oracle.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Reviewed-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/infiniband/core/mad.c