[ofa-general] [PATCH 3/3] Add option to Special Case the IPv6 Solicited Node Multicast address into a single Mcast Group

Ira Weiny weiny2 at llnl.gov
Mon Jan 14 11:45:30 PST 2008


>From a1d38895e7e34e9fec297b1dbdb0637ed858d6f0 Mon Sep 17 00:00:00 2001
From: Ira K. Weiny <weiny2 at llnl.gov>
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 <weiny2 at llnl.gov>
---
 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;
 } 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 */
+#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);
-- 
1.5.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-option-to-Special-Case-the-IPv6-Solicited-Node-M.patch
Type: application/octet-stream
Size: 5330 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080114/b0fef443/attachment.obj>


More information about the general mailing list