[ofa-general] [PATCH] opensm/multicast: remove some unused parameters.
Sasha Khapyorsky
sashak at voltaire.com
Sat Dec 13 12:40:24 PST 2008
Remove some unused in multicast routing processing parameters - req_type
and port_guid.
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
opensm/include/opensm/osm_base.h | 17 -------------
opensm/include/opensm/osm_multicast.h | 10 -------
opensm/include/opensm/osm_sm.h | 7 +----
opensm/opensm/osm_mcast_mgr.c | 31 ++++++------------------
opensm/opensm/osm_sa_mcmember_record.c | 8 +----
opensm/opensm/osm_sm.c | 41 +++++--------------------------
6 files changed, 18 insertions(+), 96 deletions(-)
diff --git a/opensm/include/opensm/osm_base.h b/opensm/include/opensm/osm_base.h
index 54df41e..7f485ff 100644
--- a/opensm/include/opensm/osm_base.h
+++ b/opensm/include/opensm/osm_base.h
@@ -828,23 +828,6 @@ typedef enum _osm_sm_signal {
} osm_sm_signal_t;
/***********/
-/****d* OpenSM/osm_mcast_req_type_t
-* NAME
-* osm_mcast_req_type_t
-*
-* DESCRIPTION
-* Enumerates the possible signals used by the OSM_MCAST_REQUEST
-*
-* SYNOPSIS
-*/
-typedef enum _osm_mcast_req_type {
- OSM_MCAST_REQ_TYPE_CREATE,
- OSM_MCAST_REQ_TYPE_JOIN,
- OSM_MCAST_REQ_TYPE_LEAVE,
- OSM_MCAST_REQ_TYPE_SUBNET_CHANGE
-} osm_mcast_req_type_t;
-/***********/
-
/****s* OpenSM: Base/MAX_GUID_FILE_LINE_LENGTH
* NAME
* MAX_GUID_FILE_LINE_LENGTH
diff --git a/opensm/include/opensm/osm_multicast.h b/opensm/include/opensm/osm_multicast.h
index bd219d1..a871306 100644
--- a/opensm/include/opensm/osm_multicast.h
+++ b/opensm/include/opensm/osm_multicast.h
@@ -96,8 +96,6 @@ BEGIN_C_DECLS
typedef struct osm_mcast_mgr_ctxt {
cl_list_item_t list_item;
ib_net16_t mlid;
- osm_mcast_req_type_t req_type;
- ib_net64_t port_guid;
} osm_mcast_mgr_ctxt_t;
/*
* FIELDS
@@ -106,14 +104,6 @@ typedef struct osm_mcast_mgr_ctxt {
* The network ordered LID of this Multicast Group
* (must be >= 0xC000).
*
-* req_type
-* The type of the request that caused this call
-* (multicast create/join/leave).
-*
-* port_guid
-* The port guid of the port that is being added/removed from
-* the multicast group due to this call.
-*
* SEE ALSO
*********/
diff --git a/opensm/include/opensm/osm_sm.h b/opensm/include/opensm/osm_sm.h
index ebe3dc3..cc8321d 100644
--- a/opensm/include/opensm/osm_sm.h
+++ b/opensm/include/opensm/osm_sm.h
@@ -539,8 +539,7 @@ osm_resp_send(IN osm_sm_t * sm,
ib_api_status_t
osm_sm_mcgrp_join(IN osm_sm_t * const p_sm,
IN const ib_net16_t mlid,
- IN const ib_net64_t port_guid,
- IN osm_mcast_req_type_t req_type);
+ IN const ib_net64_t port_guid);
/*
* PARAMETERS
* p_sm
@@ -552,10 +551,6 @@ osm_sm_mcgrp_join(IN osm_sm_t * const p_sm,
* port_guid
* [in] Port GUID to add to the group.
*
-* req_type
-* [in] Type of the MC request that caused this join
-* (MC create/join).
-*
* RETURN VALUES
* None
*
diff --git a/opensm/opensm/osm_mcast_mgr.c b/opensm/opensm/osm_mcast_mgr.c
index 2f9cb5e..e42be7b 100644
--- a/opensm/opensm/osm_mcast_mgr.c
+++ b/opensm/opensm/osm_mcast_mgr.c
@@ -68,9 +68,6 @@ typedef struct osm_mcast_work_obj {
static osm_mcast_work_obj_t *__osm_mcast_work_obj_new(IN const osm_port_t *
const p_port)
{
- /*
- TO DO - get these objects from a lockpool.
- */
osm_mcast_work_obj_t *p_obj;
/*
@@ -895,7 +892,7 @@ osm_mcast_mgr_set_table(osm_sm_t * sm,
/**********************************************************************
**********************************************************************/
-static void __osm_mcast_mgr_clear(osm_sm_t * sm, IN osm_mgrp_t * const p_mgrp)
+static void __osm_mcast_mgr_clear(osm_sm_t * sm, uint16_t mlid)
{
osm_switch_t *p_sw;
cl_qmap_t *p_sw_tbl;
@@ -911,7 +908,7 @@ static void __osm_mcast_mgr_clear(osm_sm_t * sm, IN osm_mgrp_t * const p_mgrp)
p_sw = (osm_switch_t *) cl_qmap_head(p_sw_tbl);
while (p_sw != (osm_switch_t *) cl_qmap_end(p_sw_tbl)) {
p_mcast_tbl = osm_switch_get_mcast_tbl_ptr(p_sw);
- osm_mcast_tbl_clear_mlid(p_mcast_tbl, cl_ntoh16(p_mgrp->mlid));
+ osm_mcast_tbl_clear_mlid(p_mcast_tbl, mlid);
p_sw = (osm_switch_t *) cl_qmap_next(&p_sw->map_item);
}
@@ -1046,10 +1043,7 @@ Exit:
lock must already be held on entry
**********************************************************************/
static ib_api_status_t
-osm_mcast_mgr_process_tree(osm_sm_t * sm,
- IN osm_mgrp_t * const p_mgrp,
- IN osm_mcast_req_type_t req_type,
- ib_net64_t port_guid)
+osm_mcast_mgr_process_tree(osm_sm_t * sm, IN osm_mgrp_t * const p_mgrp)
{
ib_api_status_t status = IB_SUCCESS;
ib_net16_t mlid;
@@ -1075,7 +1069,7 @@ osm_mcast_mgr_process_tree(osm_sm_t * sm,
the spanning tree which sets the mcast table bits for each
port in the group.
*/
- __osm_mcast_mgr_clear(sm, p_mgrp);
+ __osm_mcast_mgr_clear(sm, cl_ntoh16(mlid));
if (!p_mgrp->full_members)
goto Exit;
@@ -1098,16 +1092,13 @@ Exit:
NOTE : The lock should be held externally!
**********************************************************************/
static ib_api_status_t
-mcast_mgr_process_mgrp(osm_sm_t * sm,
- IN osm_mgrp_t * const p_mgrp,
- IN osm_mcast_req_type_t req_type,
- IN ib_net64_t port_guid)
+mcast_mgr_process_mgrp(osm_sm_t * sm, IN osm_mgrp_t * const p_mgrp)
{
ib_api_status_t status;
OSM_LOG_ENTER(sm->p_log);
- status = osm_mcast_mgr_process_tree(sm, p_mgrp, req_type, port_guid);
+ status = osm_mcast_mgr_process_tree(sm, p_mgrp);
if (status != IB_SUCCESS) {
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0A19: "
"Unable to create spanning tree (%s)\n",
@@ -1162,9 +1153,7 @@ osm_signal_t osm_mcast_mgr_process(osm_sm_t * sm)
*/
p_mgrp = sm->p_subn->mgroups[i];
if (p_mgrp)
- mcast_mgr_process_mgrp(sm, p_mgrp,
- OSM_MCAST_REQ_TYPE_SUBNET_CHANGE,
- 0);
+ mcast_mgr_process_mgrp(sm, p_mgrp);
}
/*
@@ -1206,8 +1195,6 @@ osm_signal_t osm_mcast_mgr_process_mgroups(osm_sm_t * sm)
ib_net16_t mlid;
osm_signal_t ret, signal = OSM_SIGNAL_DONE;
osm_mcast_mgr_ctxt_t *ctx;
- osm_mcast_req_type_t req_type;
- ib_net64_t port_guid;
OSM_LOG_ENTER(sm->p_log);
@@ -1216,8 +1203,6 @@ osm_signal_t osm_mcast_mgr_process_mgroups(osm_sm_t * sm)
while (!cl_is_qlist_empty(p_list)) {
ctx = (osm_mcast_mgr_ctxt_t *) cl_qlist_remove_head(p_list);
- req_type = ctx->req_type;
- port_guid = ctx->port_guid;
/* nice copy no warning on size diff */
memcpy(&mlid, &ctx->mlid, sizeof(mlid));
@@ -1244,7 +1229,7 @@ osm_signal_t osm_mcast_mgr_process_mgroups(osm_sm_t * sm)
OSM_LOG(sm->p_log, OSM_LOG_DEBUG,
"Processing mgrp with lid:0x%X change id:%u\n",
cl_ntoh16(mlid), p_mgrp->last_change_id);
- mcast_mgr_process_mgrp(sm, p_mgrp, req_type, port_guid);
+ mcast_mgr_process_mgrp(sm, p_mgrp);
}
/*
diff --git a/opensm/opensm/osm_sa_mcmember_record.c b/opensm/opensm/osm_sa_mcmember_record.c
index 4561808..b586942 100644
--- a/opensm/opensm/osm_sa_mcmember_record.c
+++ b/opensm/opensm/osm_sa_mcmember_record.c
@@ -1123,7 +1123,6 @@ __osm_mcmr_rcv_join_mgrp(IN osm_sa_t * sa, IN osm_madw_t * const p_madw)
osm_physp_t *p_physp;
osm_physp_t *p_request_physp;
uint8_t is_new_group; /* TRUE = there is a need to create a group */
- osm_mcast_req_type_t req_type;
uint8_t join_state;
OSM_LOG_ENTER(sa->p_log);
@@ -1235,12 +1234,9 @@ __osm_mcmr_rcv_join_mgrp(IN osm_sa_t * sa, IN osm_madw_t * const p_madw)
/* copy the MGID to the result */
mcmember_rec.mgid = p_mgrp->mcmember_rec.mgid;
is_new_group = 1;
- req_type = OSM_MCAST_REQ_TYPE_CREATE;
- } else {
+ } else
/* no need for a new group */
is_new_group = 0;
- req_type = OSM_MCAST_REQ_TYPE_JOIN;
- }
CL_ASSERT(p_mgrp);
mlid = p_mgrp->mlid;
@@ -1331,7 +1327,7 @@ __osm_mcmr_rcv_join_mgrp(IN osm_sa_t * sa, IN osm_madw_t * const p_madw)
/* do the actual routing (actually schedule the update) */
status = osm_sm_mcgrp_join(sa->sm, mlid,
p_recvd_mcmember_rec->port_gid.unicast.
- interface_id, req_type);
+ interface_id);
if (status != IB_SUCCESS) {
OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B14: "
diff --git a/opensm/opensm/osm_sm.c b/opensm/opensm/osm_sm.c
index 649ff2a..d1d8863 100644
--- a/opensm/opensm/osm_sm.c
+++ b/opensm/opensm/osm_sm.c
@@ -449,9 +449,7 @@ Exit:
**********************************************************************/
static ib_api_status_t
__osm_sm_mgrp_process(IN osm_sm_t * const p_sm,
- IN osm_mgrp_t * const p_mgrp,
- IN const ib_net64_t port_guid,
- IN osm_mcast_req_type_t req_type)
+ IN osm_mgrp_t * const p_mgrp)
{
osm_mcast_mgr_ctxt_t *ctx;
@@ -464,8 +462,6 @@ __osm_sm_mgrp_process(IN osm_sm_t * const p_sm,
return IB_ERROR;
memset(ctx, 0, sizeof(*ctx));
ctx->mlid = p_mgrp->mlid;
- ctx->req_type = req_type;
- ctx->port_guid = port_guid;
cl_spinlock_acquire(&p_sm->mgrp_lock);
cl_qlist_insert_tail(&p_sm->mgrp_list, &ctx->list_item);
@@ -478,33 +474,10 @@ __osm_sm_mgrp_process(IN osm_sm_t * const p_sm,
/**********************************************************************
**********************************************************************/
-static ib_api_status_t
-__osm_sm_mgrp_connect(IN osm_sm_t * const p_sm,
- IN osm_mgrp_t * const p_mgrp,
- IN const ib_net64_t port_guid,
- IN osm_mcast_req_type_t req_type)
-{
- return __osm_sm_mgrp_process(p_sm, p_mgrp, port_guid, req_type);
-}
-
-/**********************************************************************
- **********************************************************************/
-static void
-__osm_sm_mgrp_disconnect(IN osm_sm_t * const p_sm,
- IN osm_mgrp_t * const p_mgrp,
- IN const ib_net64_t port_guid)
-{
- __osm_sm_mgrp_process(p_sm, p_mgrp, port_guid,
- OSM_MCAST_REQ_TYPE_LEAVE);
-}
-
-/**********************************************************************
- **********************************************************************/
ib_api_status_t
osm_sm_mcgrp_join(IN osm_sm_t * const p_sm,
IN const ib_net16_t mlid,
- IN const ib_net64_t port_guid,
- IN osm_mcast_req_type_t req_type)
+ IN const ib_net64_t port_guid)
{
osm_mgrp_t *p_mgrp;
osm_port_t *p_port;
@@ -579,12 +552,12 @@ osm_sm_mcgrp_join(IN osm_sm_t * const p_sm,
goto Exit;
}
- status = __osm_sm_mgrp_connect(p_sm, p_mgrp, port_guid, req_type);
+ status = __osm_sm_mgrp_process(p_sm, p_mgrp);
CL_PLOCK_RELEASE(p_sm->p_lock);
Exit:
OSM_LOG_EXIT(p_sm->p_log);
- return (status);
+ return status;
}
/**********************************************************************
@@ -595,7 +568,7 @@ osm_sm_mcgrp_leave(IN osm_sm_t * const p_sm,
{
osm_mgrp_t *p_mgrp;
osm_port_t *p_port;
- ib_api_status_t status = IB_SUCCESS;
+ ib_api_status_t status;
OSM_LOG_ENTER(p_sm->p_log);
@@ -635,12 +608,12 @@ osm_sm_mcgrp_leave(IN osm_sm_t * const p_sm,
*/
osm_port_remove_mgrp(p_port, mlid);
- __osm_sm_mgrp_disconnect(p_sm, p_mgrp, port_guid);
+ status = __osm_sm_mgrp_process(p_sm, p_mgrp);
CL_PLOCK_RELEASE(p_sm->p_lock);
Exit:
OSM_LOG_EXIT(p_sm->p_log);
- return (status);
+ return status;
}
void osm_set_sm_priority(osm_sm_t *sm, uint8_t priority)
--
1.6.0.4.766.g6fc4a
More information about the general
mailing list