Skip to content

Commit

Permalink
ibqueryerrors: Support XDR speeds decoding
Browse files Browse the repository at this point in the history
Adding using new aggregation values of LinkSpeedExt & LinkSpeedExt2 mechaism

Signed-off-by: Gregory Linschitz <[email protected]>
  • Loading branch information
gregoryl-mlnx committed Jun 29, 2023
1 parent cf8f5fb commit 08ba2c9
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions infiniband-diags/ibqueryerrors.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static void print_port_config(ibnd_node_t * node, int portnum)
char width_msg[256];
char speed_msg[256];
char ext_port_str[256];
int iwidth, ispeed, fdr10, espeed, istate, iphystate, cap_mask;
int iwidth, ispeed, fdr10, espeed, istate, iphystate;
uint8_t *info;
int rc;

Expand All @@ -196,12 +196,9 @@ static void print_port_config(ibnd_node_t * node, int portnum)
info = (uint8_t *)&port->node->ports[0]->info;
else
info = (uint8_t *)&port->info;
cap_mask = mad_get_field(info, 0, IB_PORT_CAPMASK_F);
if (cap_mask & be32toh(IB_PORT_CAP_HAS_EXT_SPEEDS))
espeed = mad_get_field(port->info, 0,
IB_PORT_LINK_SPEED_EXT_ACTIVE_F);
else
espeed = 0;

espeed = ibnd_get_agg_linkspeedext(info, port->info);

istate = mad_get_field(port->info, 0, IB_PORT_STATE_F);
iphystate = mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F);

Expand All @@ -218,11 +215,9 @@ static void print_port_config(ibnd_node_t * node, int portnum)
if (fdr10)
sprintf(speed, "10.0 Gbps (FDR10)");
else
mad_dump_val(IB_PORT_LINK_SPEED_ACTIVE_F, speed,
64, &ispeed);
mad_dump_val(IB_PORT_LINK_SPEED_ACTIVE_F, speed, 64, &ispeed);
} else
mad_dump_val(IB_PORT_LINK_SPEED_EXT_ACTIVE_F, speed,
64, &espeed);
ibnd_dump_agg_linkspeedext(speed, 64, espeed);

snprintf(link_str, 256, "(%3s %18s %6s/%8s)",
mad_dump_val(IB_PORT_LINK_WIDTH_ACTIVE_F, width, 64, &iwidth),
Expand Down

0 comments on commit 08ba2c9

Please sign in to comment.