Skip to content

Commit

Permalink
ibsim/sim_net.c: Assume QDR speed when port speed is 0
Browse files Browse the repository at this point in the history
If there are devices with active extended speed, that responds to
PortInfo with LinkSpeedActive set to 0 (instead of QDR)
ibnetdiscover -f writes links with LinkSpeedActive set to 0 (s=0),
and as a result ibsim is unable to parse the file.

With this change, ibsim assumes LinkSpeedActive as QDR when
LinkSpeedActive is 0.

Signed-off-by: Daniel Klein <[email protected]>
  • Loading branch information
AlexMinchiu committed Oct 31, 2022
1 parent a5152b7 commit 7acb441
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ibsim/sim_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,12 @@ static int parse_port_opt(Port * port, char *opt, char *val)
break;
case 's':
v = strtoul(val, NULL, 0);
if (!is_linkspeed_valid(v))
if (v && !is_linkspeed_valid(v))
return -1;

/* If 0, assume QDR */
v = v ? v : LINKSPEED_QDR;

port->linkspeedena = v;
DEBUG("port %p linkspeed enabled set to %d", port,
port->linkspeedena);
Expand Down

0 comments on commit 7acb441

Please sign in to comment.