Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee50aeac authored by Eran Ben Elisha's avatar Eran Ben Elisha Committed by Doug Ledford
Browse files

IB/core: Fix reading capability mask of the port info class



When checking specific attribute from a bit mask, need to use bitwise
AND and not logical AND, fixed that.

Fixes: 145d9c54 ('IB/core: Display extended counter set if
available')
Signed-off-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
Reviewed-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: default avatarChristoph Lameter <cl@linux.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent fa51b247
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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;
	}