<br><br>
<div class="gmail_quote">On Sun, Sep 6, 2009 at 11:49 AM, Sasha Khapyorsky <span dir="ltr"><<a href="mailto:sashak@voltaire.com" target="_blank">sashak@voltaire.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Port needs to access multicast groups where it is joined to. Now it is<br>implemented by keeping list of list of mcm_info elements where MLID of<br>
each multicast group is stored. Obviously this assumes single MGID to<br>MLID mapping model.<br></blockquote>
<div> </div>
<div> </div>
<div>Does this mean consolidate_ipv6_snm_req does not work now ? If so, did OFED 1.5 Beta go out this way ? Also, what is the plan/timeframe to restore this functionality ?  </div>
<div> </div>
<div>-- Hal</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span></span><br>This patch changes this so that instead of MLID mcm_info stores pointer<br>to multicast group object (mgrp). Such model makes it possible to<br>
have MGIDs to MLID compression.<br><br>Signed-off-by: Sasha Khapyorsky <<a href="mailto:sashak@voltaire.com" target="_blank">sashak@voltaire.com</a>><br>---<br> opensm/include/opensm/osm_mcm_info.h |   13 +++++++------<br>
 opensm/include/opensm/osm_port.h     |   13 +++++++------<br> opensm/opensm/osm_drop_mgr.c         |   10 +++-------<br> opensm/opensm/osm_mcm_info.c         |    8 ++++----<br> opensm/opensm/osm_port.c             |   10 +++++-----<br>
 opensm/opensm/osm_sm.c               |    6 +++---<br> 6 files changed, 29 insertions(+), 31 deletions(-)<br><br>diff --git a/opensm/include/opensm/osm_mcm_info.h b/opensm/include/opensm/osm_mcm_info.h<br>index dec607f..62ae326 100644<br>
--- a/opensm/include/opensm/osm_mcm_info.h<br>+++ b/opensm/include/opensm/osm_mcm_info.h<br>@@ -47,6 +47,7 @@<br> #include <iba/ib_types.h><br> #include <complib/cl_qlist.h><br> #include <opensm/osm_base.h><br>
+#include <opensm/osm_multicast.h><br><br> #ifdef __cplusplus<br> #  define BEGIN_C_DECLS extern "C" {<br>@@ -73,15 +74,15 @@ BEGIN_C_DECLS<br> */<br> typedef struct osm_mcm_info {<br>       cl_list_item_t list_item;<br>
-       ib_net16_t mlid;<br>+       osm_mgrp_t *mgrp;<br> } osm_mcm_info_t;<br> /*<br> * FIELDS<br> *      list_item<br> *              Linkage structure for cl_qlist.  MUST BE FIRST MEMBER!<br> *<br>-*      mlid<br>-*              MLID of this multicast group.<br>
+*      mgrp<br>+*              The pointer to multicast group where this port is member of<br> *<br> * SEE ALSO<br> *********/<br>@@ -95,11 +96,11 @@ typedef struct osm_mcm_info {<br> *<br> * SYNOPSIS<br> */<br>-osm_mcm_info_t *osm_mcm_info_new(IN const ib_net16_t mlid);<br>
+osm_mcm_info_t *osm_mcm_info_new(IN osm_mgrp_t *mgrp);<br> /*<br> * PARAMETERS<br>-*      mlid<br>-*              [in] MLID value for this multicast group.<br>+*      mgrp<br>+*              [in] the pointer to multicast group.<br>
 *<br> * RETURN VALUES<br> *      Pointer to an initialized tree node.<br>diff --git a/opensm/include/opensm/osm_port.h b/opensm/include/opensm/osm_port.h<br>index 7079e74..0e0d3d2 100644<br>--- a/opensm/include/opensm/osm_port.h<br>
+++ b/opensm/include/opensm/osm_port.h<br>@@ -65,6 +65,7 @@ BEGIN_C_DECLS<br> */<br> struct osm_port;<br> struct osm_node;<br>+struct osm_mgrp;<br><br> /****h* OpenSM/Physical Port<br> * NAME<br>@@ -1420,14 +1421,14 @@ osm_get_port_by_base_lid(IN const osm_subn_t * const p_subn,<br>
 * SYNOPSIS<br> */<br> ib_api_status_t<br>-osm_port_add_mgrp(IN osm_port_t * const p_port, IN const ib_net16_t mlid);<br>+osm_port_add_mgrp(IN osm_port_t * const p_port, IN struct osm_mgrp *mgrp);<br> /*<br> * PARAMETERS<br>
 *      p_port<br> *              [in] Pointer to an osm_port_t object.<br> *<br>-*      mlid<br>-*              [in] MLID of the multicast group.<br>+*      mgrp<br>+*              [in] Pointer to the multicast group.<br>
 *<br> * RETURN VALUES<br> *      IB_SUCCESS<br>@@ -1449,14 +1450,14 @@ osm_port_add_mgrp(IN osm_port_t * const p_port, IN const ib_net16_t mlid);<br> * SYNOPSIS<br> */<br> void<br>-osm_port_remove_mgrp(IN osm_port_t * const p_port, IN const ib_net16_t mlid);<br>
+osm_port_remove_mgrp(IN osm_port_t * const p_port, IN struct osm_mgrp *mgrp);<br> /*<br> * PARAMETERS<br> *      p_port<br> *              [in] Pointer to an osm_port_t object.<br> *<br>-*      mlid<br>-*              [in] MLID of the multicast group.<br>
+*      mgrp<br>+*              [in] Pointer to the multicast group.<br> *<br> * RETURN VALUES<br> *      None.<br>diff --git a/opensm/opensm/osm_drop_mgr.c b/opensm/opensm/osm_drop_mgr.c<br>index c9a4f33..4891bb8 100644<br>
--- a/opensm/opensm/osm_drop_mgr.c<br>+++ b/opensm/opensm/osm_drop_mgr.c<br>@@ -158,7 +158,6 @@ static void drop_mgr_remove_port(osm_sm_t * sm, IN osm_port_t * p_port)<br>       osm_port_t *p_port_check;<br>       cl_qmap_t *p_sm_guid_tbl;<br>
       osm_mcm_info_t *p_mcm;<br>-       osm_mgrp_t *p_mgrp;<br>       cl_ptr_vector_t *p_port_lid_tbl;<br>       uint16_t min_lid_ho;<br>       uint16_t max_lid_ho;<br>@@ -212,12 +211,9 @@ static void drop_mgr_remove_port(osm_sm_t * sm, IN osm_port_t * p_port)<br>
<br>       p_mcm = (osm_mcm_info_t *) cl_qlist_remove_head(&p_port->mcm_list);<br>       while (p_mcm != (osm_mcm_info_t *) cl_qlist_end(&p_port->mcm_list)) {<br>-               p_mgrp = osm_get_mgrp_by_mlid(sm->p_subn, p_mcm->mlid);<br>
-               if (p_mgrp) {<br>-                       osm_mgrp_delete_port(sm->p_subn, sm->p_log,<br>-                                            p_mgrp, p_port->guid);<br>-                       osm_mcm_info_delete((osm_mcm_info_t *) p_mcm);<br>
-               }<br>+               osm_mgrp_delete_port(sm->p_subn, sm->p_log, p_mcm->mgrp,<br>+                                    p_port->guid);<br>+               osm_mcm_info_delete(p_mcm);<br>               p_mcm =<br>
                   (osm_mcm_info_t *) cl_qlist_remove_head(&p_port->mcm_list);<br>       }<br>diff --git a/opensm/opensm/osm_mcm_info.c b/opensm/opensm/osm_mcm_info.c<br>index 0325a34..c07c70b 100644<br>--- a/opensm/opensm/osm_mcm_info.c<br>
+++ b/opensm/opensm/osm_mcm_info.c<br>@@ -49,17 +49,17 @@<br><br> /**********************************************************************<br> **********************************************************************/<br>-osm_mcm_info_t *osm_mcm_info_new(IN const ib_net16_t mlid)<br>
+osm_mcm_info_t *osm_mcm_info_new(IN osm_mgrp_t *mgrp)<br> {<br>       osm_mcm_info_t *p_mcm;<br><br>-       p_mcm = (osm_mcm_info_t *) malloc(sizeof(*p_mcm));<br>+       p_mcm = malloc(sizeof(*p_mcm));<br>       if (p_mcm) {<br>
               memset(p_mcm, 0, sizeof(*p_mcm));<br>-               p_mcm->mlid = mlid;<br>+               p_mcm->mgrp = mgrp;<br>       }<br><br>-       return (p_mcm);<br>+       return p_mcm;<br> }<br><br> /**********************************************************************<br>
diff --git a/opensm/opensm/osm_port.c b/opensm/opensm/osm_port.c<br>index 751c0f0..3470381 100644<br>--- a/opensm/opensm/osm_port.c<br>+++ b/opensm/opensm/osm_port.c<br>@@ -223,12 +223,12 @@ Found:<br><br> /**********************************************************************<br>
 **********************************************************************/<br>-ib_api_status_t osm_port_add_mgrp(IN osm_port_t * p_port, IN ib_net16_t mlid)<br>+ib_api_status_t osm_port_add_mgrp(IN osm_port_t * p_port, IN osm_mgrp_t *mgrp)<br>
 {<br>       ib_api_status_t status = IB_SUCCESS;<br>       osm_mcm_info_t *p_mcm;<br><br>-       p_mcm = osm_mcm_info_new(mlid);<br>+       p_mcm = osm_mcm_info_new(mgrp);<br>       if (p_mcm)<br>               cl_qlist_insert_tail(&p_port->mcm_list,<br>
                                    (cl_list_item_t *) p_mcm);<br>@@ -243,7 +243,7 @@ ib_api_status_t osm_port_add_mgrp(IN osm_port_t * p_port, IN ib_net16_t mlid)<br> static cl_status_t port_mgrp_find_func(IN const cl_list_item_t * p_list_item,<br>
                                      IN void *context)<br> {<br>-       if (*((ib_net16_t *) context) == ((osm_mcm_info_t *) p_list_item)->mlid)<br>+       if (context == ((osm_mcm_info_t *) p_list_item)->mgrp)<br>
               return CL_SUCCESS;<br>       else<br>               return CL_NOT_FOUND;<br>@@ -251,12 +251,12 @@ static cl_status_t port_mgrp_find_func(IN const cl_list_item_t * p_list_item,<br><br> /**********************************************************************<br>
 **********************************************************************/<br>-void osm_port_remove_mgrp(IN osm_port_t * p_port, IN const ib_net16_t mlid)<br>+void osm_port_remove_mgrp(IN osm_port_t * p_port, IN osm_mgrp_t *mgrp)<br>
 {<br>       cl_list_item_t *p_mcm;<br><br>       p_mcm = cl_qlist_find_from_head(&p_port->mcm_list, port_mgrp_find_func,<br>-                                       &mlid);<br>+                                       mgrp);<br>
<br>       if (p_mcm != cl_qlist_end(&p_port->mcm_list)) {<br>               cl_qlist_remove_item(&p_port->mcm_list, p_mcm);<br>diff --git a/opensm/opensm/osm_sm.c b/opensm/opensm/osm_sm.c<br>index b3ce69a..2794775 100644<br>
--- a/opensm/opensm/osm_sm.c<br>+++ b/opensm/opensm/osm_sm.c<br>@@ -520,7 +520,7 @@ ib_api_status_t osm_sm_mcgrp_join(IN osm_sm_t * p_sm, IN const ib_net16_t mlid,<br>        */<br>       p_mcm = (osm_mcm_info_t *) cl_qlist_head(&p_port->mcm_list);<br>
       while (p_mcm != (osm_mcm_info_t *) cl_qlist_end(&p_port->mcm_list)) {<br>-               if (p_mcm->mlid == mlid) {<br>+               if (p_mcm->mgrp->mlid == mlid) {<br>                       OSM_LOG(p_sm->p_log, OSM_LOG_DEBUG,<br>
                               "Found mlid object for Port:"<br>                               "0x%016" PRIx64 " lid:0x%X\n",<br>@@ -530,7 +530,7 @@ ib_api_status_t osm_sm_mcgrp_join(IN osm_sm_t * p_sm, IN const ib_net16_t mlid,<br>
               p_mcm = (osm_mcm_info_t *) cl_qlist_next(&p_mcm->list_item);<br>       }<br><br>-       status = osm_port_add_mgrp(p_port, mlid);<br>+       status = osm_port_add_mgrp(p_port, p_mgrp);<br>       if (status != IB_SUCCESS) {<br>
               OSM_LOG(p_sm->p_log, OSM_LOG_ERROR, "ERR 2E03: "<br>                       "Unable to associate port 0x%" PRIx64 " to mlid 0x%X\n",<br>@@ -590,7 +590,7 @@ ib_api_status_t osm_sm_mcgrp_leave(IN osm_sm_t * p_sm, IN const ib_net16_t mlid,<br>
       /*<br>        * Walk the list of ports in the group, and remove the appropriate one.<br>        */<br>-       osm_port_remove_mgrp(p_port, mlid);<br>+       osm_port_remove_mgrp(p_port, p_mgrp);<br><br>       status = sm_mgrp_process(p_sm, p_mgrp);<br>
 Exit:<br>--<br>1.6.4.2<br><br>_______________________________________________<br>general mailing list<br><a href="mailto:general@lists.openfabrics.org" target="_blank">general@lists.openfabrics.org</a><br><a href="http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general" target="_blank">http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general</a><br>
<br>To unsubscribe, please visit <a href="http://openib.org/mailman/listinfo/openib-general" target="_blank">http://openib.org/mailman/listinfo/openib-general</a><br></blockquote></div><br>