[ofa-general] Re: [PATCHv2] ibsim: Add support for vendor ID and system image GUID]
Sasha Khapyorsky
sashak at voltaire.com
Thu Sep 4 18:57:12 PDT 2008
On 14:41 Thu 04 Sep , Hal Rosenstock wrote:
> Sasha,
>
> Attached is the updated patch for adding support for vendor ID and system
> image GUID
> to ibsim utilizing your idea to reset netsysimgguid to 0 in new_node.
>
> -- Hal
>
> ibsim: Add support for vendor ID and system image GUID
>
> Signed-off-by: Hal Rosenstock <hal.rosenstock at gmail.com>
Applied with few fixes (see below). Thanks.
> ---
> v2: Reset netsysimgguid in new_node
>
> diff --git a/ibsim/sim_cmd.c b/ibsim/sim_cmd.c
> index 820f77e..d587128 100644
> --- a/ibsim/sim_cmd.c
> +++ b/ibsim/sim_cmd.c
> @@ -571,8 +571,8 @@ static int dump_net(FILE * f, char *line)
> fprintf(f, "\n%s %d \"%s\"",
> node_type_name(node->type),
> node->numports, node->nodeid);
> - fprintf(f, "\tnodeguid %" PRIx64 "\n", node->nodeguid);
> -
> + fprintf(f, "\tnodeguid %" PRIx64 "\tsysimgguid %" PRIx64 "\n",
> + node->nodeguid, node->sysguid);
> nports = node->numports;
> if (node->type == SWITCH_NODE) {
> nports++;
> diff --git a/ibsim/sim_net.c b/ibsim/sim_net.c
> index 6e3c0e9..55da898 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);
As we discussed sysimage should be encoded to netsysimage if it is
presnent in a file or otherwise to nodeguid (as it was). So I changed
this to:
mad_encode_field(nd->nodeinfo, IB_NODE_SYSTEM_GUID_F,
netsysimgguid ? &netsysimgguid , &nd->nodeguid);
>
> if ((nd->portsbase = new_ports(nd, nodeports, firstport)) < 0) {
> IBWARN("can't alloc %d ports for node %s", nodeports,
> @@ -336,6 +339,8 @@ static Node *new_node(int type, char *nodename, char *nodedesc, int nodeports)
> return 0;
> }
>
> + netsysimgguid = 0;
The same story is with newly introduced netvendid, added 'netvendid = 0'
too.
Sasha
More information about the general
mailing list