On Tue, 2008-01-15 at 09:37 -0800, Ira Weiny wrote:
> On Mon, 14 Jan 2008 18:31:43 -0800
> Hal Rosenstock <[EMAIL PROTECTED]> wrote:
> 
> > On Mon, 2008-01-14 at 11:45 -0800, Ira Weiny wrote:
> > > >From a1d38895e7e34e9fec297b1dbdb0637ed858d6f0 Mon Sep 17 00:00:00 2001
> > > From: Ira K. Weiny <[EMAIL PROTECTED]>
> > > Date: Sun, 13 Jan 2008 16:03:31 -0800
> > > Subject: [PATCH] Add option to Special Case the IPv6 Solicited Node 
> > > Multicast address into a single Mcast Group
> > > 
> > > 
> > > Signed-off-by: Ira K. Weiny <[EMAIL PROTECTED]>
> > > ---
> > >  opensm/include/opensm/osm_subnet.h     |    1 +
> > >  opensm/man/opensm.8                    |    4 +++
> > >  opensm/opensm/main.c                   |    4 +++
> > >  opensm/opensm/osm_sa_mcmember_record.c |   35 
> > > +++++++++++++++++++++++++++++++-
> > >  opensm/opensm/osm_subnet.c             |    9 ++++++++
> > >  5 files changed, 52 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/opensm/include/opensm/osm_subnet.h 
> > > b/opensm/include/opensm/osm_subnet.h
> > > index 2a28045..558b34e 100644
> > > --- a/opensm/include/opensm/osm_subnet.h
> > > +++ b/opensm/include/opensm/osm_subnet.h
> > > @@ -283,6 +283,7 @@ typedef struct _osm_subn_opt {
> > >   char *event_plugin_name;
> > >   char *node_name_map_name;
> > >   char *prefix_routes_file;
> > > + boolean_t consolodate_ipv6_snm_req;
> > 
> > Nit: in all of the this, consolodate -> consolidate
> 
> Oops...  I will fix...  :-)
> 
> > 
> > >  } osm_subn_opt_t;
> > >  /*
> > >  * FIELDS
> > > diff --git a/opensm/man/opensm.8 b/opensm/man/opensm.8
> > > index 475eeec..9c7b371 100644
> > > --- a/opensm/man/opensm.8
> > > +++ b/opensm/man/opensm.8
> > > @@ -239,6 +239,10 @@ Specify the sweep time for the performance manager 
> > > in seconds
> > >  (default is 180 seconds).  Only takes
> > >  effect if --enable-perfmgr was specified at configure time.
> > >  .TP
> > > +.BI --consolodate_ipv6_snm_reqests
> > > +Consolodate IPv6 Solicited Node Multicast group joins into 1 IB multicast
> > > +group.
> > > +.TP
> > >  \fB\-v\fR, \fB\-\-verbose\fR
> > >  This option increases the log verbosity level.
> > >  The -v option may be specified multiple times
> > > diff --git a/opensm/opensm/main.c b/opensm/opensm/main.c
> > > index 4d0d51d..a84f6c2 100644
> > > --- a/opensm/opensm/main.c
> > > +++ b/opensm/opensm/main.c
> > > @@ -615,6 +615,7 @@ int main(int argc, char *argv[])
> > >           {"perfmgr_sweep_time_s", 1, NULL, 2},
> > >  #endif
> > >           {"prefix_routes_file", 1, NULL, 3},
> > > +         {"consolodate_ipv6_snm_reqests", 0, NULL, 4},
> > >           {NULL, 0, NULL, 0}      /* Required at the end of the array */
> > >   };
> > >  
> > > @@ -916,6 +917,9 @@ int main(int argc, char *argv[])
> > >           case 3:
> > >                   opt.prefix_routes_file = optarg;
> > >                   break;
> > > +         case 4:
> > > +                 opt.consolodate_ipv6_snm_req = TRUE;
> > > +                 break;
> > >           case 'h':
> > >           case '?':
> > >           case ':':
> > > diff --git a/opensm/opensm/osm_sa_mcmember_record.c 
> > > b/opensm/opensm/osm_sa_mcmember_record.c
> > > index d37a655..bfa5d2d 100644
> > > --- a/opensm/opensm/osm_sa_mcmember_record.c
> > > +++ b/opensm/opensm/osm_sa_mcmember_record.c
> > > @@ -1167,9 +1167,42 @@ __search_mgrp_by_mgid(IN cl_map_item_t * const 
> > > p_map_item, IN void *context)
> > >  
> > >   /* compare entire MGID so different scope will not sneak in for
> > >      the same MGID */
> > > - if (memcmp(&p_mgrp->mcmember_rec.mgid, p_recvd_mgid, sizeof(ib_gid_t)))
> > > + if (memcmp(&p_mgrp->mcmember_rec.mgid, p_recvd_mgid, sizeof(ib_gid_t))) 
> > > {
> > > +
> > > +         if (sa->p_subn->opt.consolodate_ipv6_snm_req) {
> > > +                 /* Special Case IPV6 Multicast Loopback addresses */
> > > +                 /* 0xff12601bXXXX0000 : 0x00000001ffYYYYYY */
> > > +                 /* Where XXXX is the partition and YYYYYY is the last 
> > > 24 bits
> > > +                  * of the port guid */
> > 
> > Masking off the partition is counter to IBA 1.2.1 vol 1 p. 151 10) which
> > states:
> > 
> > "When a multicast LID is overloaded, the multicast groups
> > sharing the same MLID must have the same P_Key. This simplification
> > is required to allow switches and routers that implement optional
> > P_Key enforcement for multicast operations."
> 
> I believe this will create a different group (MGID, group, and MLID) for each
> partition which comes in.  The first check ignores the partition to see if the
> MGID is "special".  But the second.  "if ((g_prefix == rcv_prefix)" will
> separate out the partitions.

Even if it doesn't, making it do so is a better approach and removes
this as an issue as far as I am concerned.

-- Hal

> I should test this.
> 
> Ira
> 
> > 
> > -- Hal
> > 
> > > +#define PREFIX_MASK (0xff12601b00000000)
> > > +#define INT_ID_MASK (0x00000001ff000000)
> > > +                 uint64_t g_prefix = 
> > > cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.prefix);
> > > +                 uint64_t g_interface_id = 
> > > cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.interface_id);
> > > +                 uint64_t rcv_prefix = 
> > > cl_ntoh64(p_recvd_mgid->unicast.prefix);
> > > +                 uint64_t rcv_interface_id = 
> > > cl_ntoh64(p_recvd_mgid->unicast.interface_id);
> > > +
> > > +                 if (((rcv_prefix & PREFIX_MASK) == PREFIX_MASK)
> > > +                         &&
> > > +                         (rcv_interface_id & INT_ID_MASK) == 
> > > INT_ID_MASK) {
> > > +
> > > +                         if ((g_prefix == rcv_prefix)
> > > +                                 &&
> > > +                                 (g_interface_id & INT_ID_MASK) ==
> > > +                                         (rcv_interface_id & INT_ID_MASK)
> > > +                                 ) {
> > > +                                 osm_log(sa->p_log, OSM_LOG_INFO,
> > > +                                         "Special Case Mcast Join for 
> > > MGID "
> > > +                                         " MGID 0x%016"PRIx64" : 
> > > 0x%016"PRIx64"\n",
> > > +                                         rcv_prefix, rcv_interface_id);
> > > +                                 goto match;
> > > +                         }
> > > +                 }
> > > +         }
> > > +
> > >           return;
> > > + }
> > >  
> > > +match:
> > >   if (p_ctxt->p_mgrp) {
> > >           osm_log(sa->p_log, OSM_LOG_ERROR,
> > >                   "__search_mgrp_by_mgid: ERR 1F08: "
> > > diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
> > > index 0103940..558ea68 100644
> > > --- a/opensm/opensm/osm_subnet.c
> > > +++ b/opensm/opensm/osm_subnet.c
> > > @@ -481,6 +481,7 @@ void osm_subn_set_default_opt(IN osm_subn_opt_t * 
> > > const p_opt)
> > >   p_opt->enable_quirks = FALSE;
> > >   p_opt->no_clients_rereg = FALSE;
> > >   p_opt->prefix_routes_file = OSM_DEFAULT_PREFIX_ROUTES_FILE;
> > > + p_opt->consolodate_ipv6_snm_req = FALSE;
> > >   subn_set_default_qos_options(&p_opt->qos_options);
> > >   subn_set_default_qos_options(&p_opt->qos_ca_options);
> > >   subn_set_default_qos_options(&p_opt->qos_sw0_options);
> > > @@ -1394,6 +1395,9 @@ ib_api_status_t osm_subn_parse_conf_file(IN 
> > > osm_subn_opt_t * const p_opts)
> > >  
> > >           opts_unpack_charp("prefix_routes_file",
> > >                             p_key, p_val, &p_opts->prefix_routes_file);
> > > +
> > > +         opts_unpack_boolean("consolodate_ipv6_snm_req",
> > > +                         p_key, p_val, 
> > > &p_opts->consolodate_ipv6_snm_req);
> > >   }
> > >   fclose(opts_file);
> > >  
> > > @@ -1721,6 +1725,11 @@ ib_api_status_t osm_subn_write_conf_file(IN 
> > > osm_subn_opt_t * const p_opts)
> > >           "prefix_routes_file %s\n\n",
> > >           p_opts->prefix_routes_file);
> > >  
> > > + fprintf(opts_file,
> > > +         "#\n# IPv6 MCast Options\n#\n"
> > > +         "consolodate_ipv6_snm_req %s\n\n",
> > > +         p_opts->consolodate_ipv6_snm_req ? "TRUE" : "FALSE");
> > > +
> > >   /* optional string attributes ... */
> > >  
> > >   fclose(opts_file);
> > > _______________________________________________
> > > general mailing list
> > > [email protected]
> > > http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
> > > 
> > > To unsubscribe, please visit 
> > > http://openib.org/mailman/listinfo/openib-general
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to