[openib-general] [PATCH][TRIVIAL] OpenSM/osm_sa_mcmember_record.(h c): Use definitions rather than hard coded constants for MC group scope
Hal Rosenstock
halr at voltaire.com
Fri Jan 5 12:09:54 PST 2007
OpenSM/osm_sa_mcmember_record.(h c): Use definitions rather than hard
coded constants for MC group scope
Signed-off-by: Hal Rosenstock <halr at voltaire.com>
diff --git a/osm/include/opensm/osm_sa_mcmember_record.h b/osm/include/opensm/osm_sa_mcmember_record.h
index eac30ae..802f3e8 100644
--- a/osm/include/opensm/osm_sa_mcmember_record.h
+++ b/osm/include/opensm/osm_sa_mcmember_record.h
@@ -392,7 +392,25 @@ osm_mcmr_rcv_find_or_create_new_mgrp(
#define OSM_DEFAULT_MGRP_RATE 0x03
/***********/
-/* These Component Mask fields comply with IB Spec 1.2 */
+/* Scope component definitions from IBA 1.2 (Table 3 p. 146) */
+#define MC_SCOPE_LINK_LOCAL 0x2
+#define MC_SCOPE_SITE_LOCAL 0x5
+#define MC_SCOPE_ORG_LOCAL 0x8
+#define MC_SCOPE_GLOBAL 0xE
+
+/****d* OpenSM: MC Member Record Receiver/OSM_DEFAULT_MGRP_SCOPE
+* Name
+* OSM_DEFAULT_MGRP_SCOPE
+*
+* DESCRIPTION
+* Default SCOPE used for new MGRP creation (link local)
+*
+* SYNOPSIS
+*/
+#define OSM_DEFAULT_MGRP_SCOPE MC_SCOPE_LINK_LOCAL
+/***********/
+
+/* JoinState definitions from IBA 1.2 */
#define MC_FULL_MEMBER 0x1
#define MC_NON_MEMBER 0x2
#define MC_SENDONLY_NON_MEMBER 0x4
diff --git a/osm/opensm/osm_sa_mcmember_record.c b/osm/opensm/osm_sa_mcmember_record.c
index 04718aa..dcc6c5a 100644
--- a/osm/opensm/osm_sa_mcmember_record.c
+++ b/osm/opensm/osm_sa_mcmember_record.c
@@ -1039,7 +1039,7 @@ __validate_requested_mgid(IN osm_mcmr_re
/* 2 - now what if the link local format 0xA01B is used -
the scope should not be link local */
if ( ( signature == 0xA01B ) &&
- ((p_mcm_rec->mgid.multicast.header[1] & 0x0F) == 0x02) ) {
+ ((p_mcm_rec->mgid.multicast.header[1] & 0x0F) == MC_SCOPE_LINK_LOCAL) ) {
osm_log( p_rcv->p_log, OSM_LOG_ERROR,
"__validate_requested_mgid: ERR 1B24: "
"MGID uses 0xA01B signature but with link-local scope\n" );
@@ -1285,7 +1285,7 @@ osm_mcmr_rcv_create_new_mgrp(
else
{
/* to guarantee no collision with other subnets use local scope! */
- scope = 0x02; /* link-local scope */
+ scope = MC_SCOPE_LINK_LOCAL;
}
p_mgid = &(mcm_rec.mgid);
More information about the general
mailing list