[ofa-general] Re: [PATCH] ibsim: Add support for vendor ID and system image GUID
Sasha Khapyorsky
sashak at voltaire.com
Sun Aug 31 07:46:45 PDT 2008
Hi Hal,
On 17:45 Wed 27 Aug , Hal Rosenstock wrote:
>>> diff --git a/ibsim/sim_net.c b/ibsim/sim_net.c
>>> index 6e3c0e9..146bcde 100644
>>> --- a/ibsim/sim_net.c
>>> +++ b/ibsim/sim_net.c
>>> @@ -190,7 +190,9 @@ char (*aliases)[NODEIDLEN + NODEPREFIX + 1]; //
>>> aliases map format: "%s@%s"
>>> int netnodes, netswitches, netports, netaliases;
>>> char netprefix[NODEPREFIX + 1];
>>> +int netvendid;
>>> int netdevid;
>>> +uint64_t netsysimgguid;
>>> int netwidth = DEFAULT_LINKWIDTH;
>>> int netspeed = DEFAULT_LINKSPEED;
>>> @@ -324,11 +326,12 @@ static Node *new_node(int type, char *nodename,
>>> char *nodedesc, int nodeports)
>>> }
>>> mad_set_field(nd->nodeinfo, 0, IB_NODE_NPORTS_F, nd->numports);
>>> + mad_set_field(nd->nodeinfo, 0, IB_NODE_VENDORID_F, netvendid);
>>> mad_set_field(nd->nodeinfo, 0, IB_NODE_DEVID_F, netdevid);
>>> mad_encode_field(nd->nodeinfo, IB_NODE_GUID_F, &nd->nodeguid);
>>> mad_encode_field(nd->nodeinfo, IB_NODE_PORT_GUID_F, &nd->nodeguid);
>>> - mad_encode_field(nd->nodeinfo, IB_NODE_SYSTEM_GUID_F, &nd->nodeguid);
>>> + mad_encode_field(nd->nodeinfo, IB_NODE_SYSTEM_GUID_F, &netsysimgguid);
>>>
>>
>> And when netsysimgguid was not parsed for this node, it will put previous
>> value there (or "0" if it was never parsed)?
>>
> Is "state" for a node in the topology file needed to deal with this ?
> Something like the following: When the vendor ID line is seen, reset
> netsysimgguid and if 0 when new_node is invoked, then use the node GUID as
> currently done. Does that make sense ?
Why to not reset netsysimgguid unconditionally at end of new_node()?
The rest could be as you said:
mad_encode_field(nd->nodeinfo, IB_NODE_SYSTEM_GUID_F,
netsysimgguid ? &netsysimgguid : &nd->nodeguid);
Sasha
More information about the general
mailing list