[ofa-general] Re: [PATCHv2] osm: adding root_guid_file and cn_guid_file OpenSM options

Hal Rosenstock halr at voltaire.com
Thu Jun 21 10:40:02 PDT 2007


Hi Yevgeny,

On Thu, 2007-06-21 at 10:49, Yevgeny Kliteynik wrote:
> Hi Hal,
> 
> Hal Rosenstock wrote:
> > Hi Yevgeny,
> > 
> > On Sun, 2007-06-17 at 08:26, Yevgeny Kliteynik wrote:
> >> Hi Hal,
> >>
> >> This patch replaces updn_guid_file in the Up/Down routing with
> >> root_guid_file for Up/Down and Fat-Tree routing, and adds a new
> >> option - cn_guid_file for Fat-Tree routing.
> >> OpenSM command line options for these two files are:
> >>
> >>   '-a' or '--root_guid_file' for roots
> >>   '-u' or '--cn_guid_file' for compute nodes
> >>
> >> Signed-off-by:  Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
> > 
> > This entire patch was rejected when I attempted to apply it. Can you
> > regenerate it ? Thanks.
> 
> Indeed, there were changes in osm_subnet.{c,h} since I've issued this patch.

That wasn't the problem.

> Here's the new one:

This one was rejected too. I hand applied it so please double check it.

Also, I updated the opensm man page for these options.

Thanks.

-- Hal

> Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
> ---
>   opensm/include/opensm/osm_subnet.h |   12 +++++++++---
>   opensm/opensm/main.c               |   29 ++++++++++++++++++++++-------
>   opensm/opensm/osm_subnet.c         |   25 ++++++++++++++++++-------
>   opensm/opensm/osm_ucast_updn.c     |    6 +++---
>   4 files changed, 52 insertions(+), 20 deletions(-)
> 
> diff --git a/opensm/include/opensm/osm_subnet.h b/opensm/include/opensm/osm_subnet.h
> index b296caf..2ee5689 100644
> --- a/opensm/include/opensm/osm_subnet.h
> +++ b/opensm/include/opensm/osm_subnet.h
> @@ -278,7 +278,8 @@ typedef struct _osm_subn_opt
>     char *                   routing_engine_name;
>     char *                   lid_matrix_dump_file;
>     char *                   ucast_dump_file;
> -  char *                   updn_guid_file;
> +  char *                   root_guid_file;
> +  char *                   cn_guid_file;
>     char *                   sa_db_file;
>     boolean_t                exit_on_fatal;
>     boolean_t                honor_guid2lid_file;
> @@ -452,8 +453,13 @@ typedef struct _osm_subn_opt
>   *		Name of the unicast routing dump file from where switch
>   *		forwarding tables will be loaded
>   *
> -*	updn_guid_file
> -*		Pointer to name of the UPDN guid file given by User
> +*	root_guid_file
> +*		Name of the file that contains list of root guids that
> +*		will be used by fat-tree or up/dn routing (provided by User)
> +*
> +*	cn_guid_file
> +*		Name of the file that contains list of compute node guids that
> +*		will be used by fat-tree routing (provided by User)
>   *
>   *	sa_db_file
>   *		Name of the SA database file.
> diff --git a/opensm/opensm/main.c b/opensm/opensm/main.c
> index 6b4cb4f..d17a994 100644
> --- a/opensm/opensm/main.c
> +++ b/opensm/opensm/main.c
> @@ -189,8 +189,14 @@ show_usage(void)
>             "          This option specifies the name of the SA DB dump file\n"
>             "          from where SA database will be loaded.\n\n");
>     printf ("-a\n"
> -          "--add_guid_file <path to file>\n"
> -          "          Set the root nodes for the Up/Down routing algorithm\n"
> +          "--root_guid_file <path to file>\n"
> +          "          Set the root nodes for the Up/Down or Fat-Tree routing\n"
> +          "          algorithm to the guids provided in the given file (one\n"
> +          "          to a line)\n"
> +          "\n");
> +  printf ("-u\n"
> +          "--cn_guid_file <path to file>\n"
> +          "          Set the compute nodes for the Fat-Tree routing algorithm\n"
>             "          to the guids provided in the given file (one to a line)\n"
>             "\n");
>     printf( "-o\n"
> @@ -585,7 +591,7 @@ main(
>     char                 *ignore_guids_file_name = NULL;
>     uint32_t              val;
>     const char * const    short_option =
> -	  "i:f:ed:g:l:L:s:t:a:R:M:U:S:P:NBIQvVhorcyxp:n:q:k:C:";
> +	  "i:f:ed:g:l:L:s:t:a:u:R:M:U:S:P:NBIQvVhorcyxp:n:q:k:C:";
> 
>     /*
>       In the array below, the 2nd parameter specifies the number
> @@ -622,7 +628,8 @@ main(
>         {  "lid_matrix_file",1, NULL, 'M'},
>         {  "ucast_file",    1, NULL, 'U'},
>         {  "sadb_file",     1, NULL, 'S'},
> -      {  "add_guid_file", 1, NULL, 'a'},
> +      {  "root_guid_file",1, NULL, 'a'},
> +      {  "cn_guid_file",  1, NULL, 'u'},
>         {  "cache-options", 0, NULL, 'c'},
>         {  "stay_on_fatal", 0, NULL, 'y'},
>         {  "honor_guid2lid",0, NULL, 'x'},
> @@ -886,10 +893,18 @@ main(
> 
>       case 'a':
>         /*
> -        Specifies port guids file
> +        Specifies root guids file
> +      */
> +      opt.root_guid_file = optarg;
> +      printf (" Root Guid File: %s\n", opt.root_guid_file );
> +      break;
> +
> +    case 'u':
> +      /*
> +        Specifies compute node guids file
>         */
> -      opt.updn_guid_file = optarg;
> -      printf (" UPDN Guid File: %s\n", opt.updn_guid_file );
> +      opt.cn_guid_file = optarg;
> +      printf (" Compute Node Guid File: %s\n", opt.cn_guid_file );
>         break;
> 
>       case 'c':
> diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
> index 5a79149..7a223e3 100644
> --- a/opensm/opensm/osm_subnet.c
> +++ b/opensm/opensm/osm_subnet.c
> @@ -502,7 +502,8 @@ osm_subn_set_default_opt(
>     p_opt->routing_engine_name = NULL;
>     p_opt->lid_matrix_dump_file = NULL;
>     p_opt->ucast_dump_file = NULL;
> -  p_opt->updn_guid_file = NULL;
> +  p_opt->root_guid_file = NULL;
> +  p_opt->cn_guid_file = NULL;
>     p_opt->sa_db_file = NULL;
>     p_opt->exit_on_fatal = TRUE;
>     p_opt->enable_quirks = FALSE;
> @@ -1325,8 +1326,12 @@ osm_subn_parse_conf_file(
>           p_key, p_val, &p_opts->ucast_dump_file);
> 
>         __osm_subn_opts_unpack_charp(
> -        "updn_guid_file",
> -        p_key, p_val, &p_opts->updn_guid_file);
> +        "root_guid_file",
> +        p_key, p_val, &p_opts->root_guid_file);
> +
> +      __osm_subn_opts_unpack_charp(
> +        "cn_guid_file",
> +        p_key, p_val, &p_opts->cn_guid_file);
> 
>         __osm_subn_opts_unpack_charp(
>           "sa_db_file",
> @@ -1550,12 +1555,18 @@ osm_subn_write_conf_file(
>                "# Ucast dump file name\n"
>                "ucast_dump_file %s\n\n",
>                p_opts->ucast_dump_file);
> -  if (p_opts->updn_guid_file)
> +  if (p_opts->root_guid_file)
> +    fprintf( opts_file,
> +             "# The file holding the root node guids (for fat-tree or Up/Down)\n"
> +             "# One guid in each line\n"
> +             "root_guid_file %s\n\n",
> +             p_opts->root_guid_file);
> +  if (p_opts->cn_guid_file)
>       fprintf( opts_file,
> -             "# The file holding the Up/Down root node guids\n"
> +             "# The file holding the fat-tree compute node guids\n"
>                "# One guid in each line\n"
> -             "updn_guid_file %s\n\n",
> -             p_opts->updn_guid_file);
> +             "cn_guid_file %s\n\n",
> +             p_opts->cn_guid_file);
>     if (p_opts->sa_db_file)
>       fprintf( opts_file,
>                "# SA database file name\n"
> diff --git a/opensm/opensm/osm_ucast_updn.c b/opensm/opensm/osm_ucast_updn.c
> index 2448246..af5ee4e 100644
> --- a/opensm/opensm/osm_ucast_updn.c
> +++ b/opensm/opensm/osm_ucast_updn.c
> @@ -311,10 +311,10 @@ updn_init(
>        Check the source for root node list, if file parse it, otherwise
>        wait for a callback to activate auto detection
>     */
> -  if (p_osm->subn.opt.updn_guid_file)
> +  if (p_osm->subn.opt.root_guid_file)
>     {
>       status = osm_ucast_mgr_read_guid_file( &p_osm->sm.ucast_mgr,
> -                                           p_osm->subn.opt.updn_guid_file,
> +                                           p_osm->subn.opt.root_guid_file,
>                                              p_updn->p_root_nodes );
>       if (status != IB_SUCCESS)
>          goto Exit;
> @@ -323,7 +323,7 @@ updn_init(
>       osm_log( &p_osm->log, OSM_LOG_DEBUG,
>                "updn_init: "
>                "UPDN - Fetching root nodes from file %s\n",
> -             p_osm->subn.opt.updn_guid_file );
> +             p_osm->subn.opt.root_guid_file );
>       guid_iterator = cl_list_head(p_updn->p_root_nodes);
>       while( guid_iterator != cl_list_end(p_updn->p_root_nodes) )
>       {




More information about the general mailing list