[ofa-general] ibsim parsing question

Hal Rosenstock hrosenstock at xsigo.com
Sun May 4 14:02:24 PDT 2008


Hi Sasha,

I have a question on ibsim parsing:

In sim_net.c:parse_port, there is the following code:
      parse_opt:
        line = s;
        while (s && (s = strchr(s + 1, '='))) {
                char *opt = s;
                while (opt && !isalpha(*opt))
                        opt--;
                if (!opt || parse_port_opt(port, opt, s + 1) < 0) {
                        IBWARN("bad port option");
                        return -1;
                }
                line = s + 1;
        }

port options appear include w for link width and s for link speed.

An issue is that this parsing starts inside the NodeDescription. = is a
valid character there and causes an invalid port option. There seem to
me to be two choices here:
1. Either ignore unknown options in parse_port_option and the rule
becomes w= and s= are invalid in the NodeDescription (which is
artificial and not really per the spec).
or
2. Find some way to start this port option parsing past the end of the
NodeDescription. As I'm not sure about all the formats supported, I
don't know how to determine a "solid" way to get past the end of the
NodeDescription in the topology format. Do you ?

-- Hal




More information about the general mailing list