IB/mlx4: Saturate RoCE port PMA counters in case of overflow
authorMajd Dibbiny <majd@mellanox.com>
Wed, 18 Mar 2015 14:51:37 +0000 (16:51 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 9 May 2015 22:16:30 +0000 (23:16 +0100)
commit1591b5006b0d51258a0d8cb873df52f43c64781d
tree51ad51f35ab271f4c5a67714dacc2a5270a1c1bf
parent1ffc3cd9a36b504c20ce98fe5eeb5463f389e1ac
IB/mlx4: Saturate RoCE port PMA counters in case of overflow

commit 61a3855bb726cbb062ef02a31a832dea455456e0 upstream.

For RoCE ports, we set the u32 PMA values based on u64 HCA counters. In case of
overflow, according to the IB spec, we have to saturate a counter to its
max value, do that.

Fixes: c37791349cc7 ('IB/mlx4: Support PMA counters for IBoE')
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2:
 - Adjust context
 - Open-code U32_MAX]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/infiniband/hw/mlx4/mad.c