Skip to content

Commit 7acb441

Browse files
committed
ibsim/sim_net.c: Assume QDR speed when port speed is 0
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]>
1 parent a5152b7 commit 7acb441

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ibsim/sim_net.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,12 @@ static int parse_port_opt(Port * port, char *opt, char *val)
577577
break;
578578
case 's':
579579
v = strtoul(val, NULL, 0);
580-
if (!is_linkspeed_valid(v))
580+
if (v && !is_linkspeed_valid(v))
581581
return -1;
582582

583+
/* If 0, assume QDR */
584+
v = v ? v : LINKSPEED_QDR;
585+
583586
port->linkspeedena = v;
584587
DEBUG("port %p linkspeed enabled set to %d", port,
585588
port->linkspeedena);

0 commit comments

Comments
 (0)