[ofa-general] Re: ibsim parsing question
Sasha Khapyorsky
sashak at voltaire.com
Mon May 12 15:23:16 PDT 2008
Hi Hal,
On 14:02 Sun 04 May , Hal Rosenstock wrote:
>
> 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.
I can see the issue, but not sure I know best solution yet (never used
's' and 'w' options and didn't see topology files examples where it was
used).
> 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
Not sure that "per the spec" restriction is applicable here, it is
only about simulator topology file format and this file is editable
(node description value is ignored by ibsim parser in those lines
anyway).
> 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 ?
Do you have examples of 'w' or 's' usage?
If it is something like:
[1] "S-0008f104003f15e4"[19][ext 1] w=4 s=2 # lid 460 lmc 1 "ISR9288/ISR9096 Voltaire sLB-24D"
, then it should be easy separable by '#' character.
Sasha
More information about the general
mailing list