Skip to content

Commit

Permalink
IB/core: Fix reading capability mask of the port info class
Browse files Browse the repository at this point in the history
When checking specific attribute from a bit mask, need to use bitwise
AND and not logical AND, fixed that.

Fixes: 145d9c5 ('IB/core: Display extended counter set if
available')
Signed-off-by: Eran Ben Elisha <[email protected]>
Signed-off-by: Matan Barak <[email protected]>
Reviewed-by: Or Gerlitz <[email protected]>
Reviewed-by: Christoph Lameter <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
Eran Ben Elisha authored and dledford committed Feb 11, 2016
1 parent fa51b24 commit ee50aea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/infiniband/core/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,12 +720,11 @@ static struct attribute_group *get_counter_table(struct ib_device *dev,

if (get_perf_mad(dev, port_num, IB_PMA_CLASS_PORT_INFO,
&cpi, 40, sizeof(cpi)) >= 0) {

if (cpi.capability_mask && IB_PMA_CLASS_CAP_EXT_WIDTH)
if (cpi.capability_mask & IB_PMA_CLASS_CAP_EXT_WIDTH)
/* We have extended counters */
return &pma_group_ext;

if (cpi.capability_mask && IB_PMA_CLASS_CAP_EXT_WIDTH_NOIETF)
if (cpi.capability_mask & IB_PMA_CLASS_CAP_EXT_WIDTH_NOIETF)
/* But not the IETF ones */
return &pma_group_noietf;
}
Expand Down

0 comments on commit ee50aea

Please sign in to comment.