infiniband-diags: Fix cap_mask extended link speed supported endian checks
PATCH 1/1 infiniband-diags: Fix cap_mask extended link speed supported endian checks
Similar to previous patch for ibnetdiscover.c
---
libibnetdisc/src/ibnetdisc.c +1 -1
@@ -182,7 +182,7 @@ static void debug_port(ib_portid_t * portid, ibnd_port_t * port)else info = (uint8_t *)&port->info; cap_mask =mad_get_field (info,0 ,IB_PORT_CAPMASK_F ); -if (cap_mask &IB_PORT_CAP_HAS_EXT_SPEEDS ) +if (cap_mask &CL_NTOH32 (IB_PORT_CAP_HAS_EXT_SPEEDS )) espeed =mad_get_field (port->info,0 ,IB_PORT_LINK_SPEED_EXT_ACTIVE_F );else espeed =0 ;
src/ibdiag_common.c +2 -2
@@ -620,8 +620,8 @@ void get_max_msg(char *width_msg, char *speed_msg, int msg_size, ibnd_port_t * pelse info = (uint8_t *)&port->remoteport->info; rem_cap_mask =mad_get_field (info,0 ,IB_PORT_CAPMASK_F ); -if (cap_mask &IB_PORT_CAP_HAS_EXT_SPEEDS && - rem_cap_mask &IB_PORT_CAP_HAS_EXT_SPEEDS ) +if (cap_mask &CL_NTOH32 (IB_PORT_CAP_HAS_EXT_SPEEDS ) && + rem_cap_mask &CL_NTOH32 (IB_PORT_CAP_HAS_EXT_SPEEDS )) goto check_ext_speed; check_speed_supp: max_speed = get_max(mad_get_field(port->info, 0,
src/iblinkinfo.c +1 -1
@@ -127,7 +127,7 @@ void print_port(ibnd_node_t * node, ibnd_port_t * port, char *out_prefix)else info = (uint8_t *)&port->info; cap_mask =mad_get_field (info,0 ,IB_PORT_CAPMASK_F ); -if (cap_mask &IB_PORT_CAP_HAS_EXT_SPEEDS ) +if (cap_mask &CL_NTOH32 (IB_PORT_CAP_HAS_EXT_SPEEDS )) espeed =mad_get_field (port->info,0 ,IB_PORT_LINK_SPEED_EXT_ACTIVE_F );else
src/ibportstate.c +1 -1
@@ -135,7 +135,7 @@ static int get_port_info(ib_portid_t * dest, uint8_t * data, int portnum,if (!smp_query_via (data, dest,IB_ATTR_PORT_INFO , portnum,0 , srcport))IBERROR ("smp query portinfo failed" ); cap_mask =mad_get_field (info,0 ,IB_PORT_CAPMASK_F ); -return (cap_mask &IB_PORT_CAP_HAS_EXT_SPEEDS ); +return (cap_mask &CL_NTOH32 (IB_PORT_CAP_HAS_EXT_SPEEDS )); } static void show_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
src/ibqueryerrors.c +1 -1
@@ -183,7 +183,7 @@ static void print_port_config(char *node_name, ibnd_node_t * node, int portnum)else info = (uint8_t *)&port->info; cap_mask =mad_get_field (info,0 ,IB_PORT_CAPMASK_F ); -if (cap_mask &IB_PORT_CAP_HAS_EXT_SPEEDS ) +if (cap_mask &CL_NTOH32 (IB_PORT_CAP_HAS_EXT_SPEEDS )) espeed =mad_get_field (port->info,0 ,IB_PORT_LINK_SPEED_EXT_ACTIVE_F );else
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html