* [PATCH] opensm/osm_prtn.c: removing TopSpin hack
@ 2010-09-07 14:50 Yevgeny Kliteynik
[not found] ` <4C865139.7010705-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Yevgeny Kliteynik @ 2010-09-07 14:50 UTC (permalink / raw)
To: Sasha Khapyorsky; +Cc: Linux RDMA
Removing hack that was supposed to support TopSpin's non-compliant
join compmask for IPoIB v4 multicast group ff12:401b:<pkey>::1
Signed-off-by: Yevgeny Kliteynik <kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
---
opensm/opensm/osm_prtn.c | 31 -------------------------------
1 files changed, 0 insertions(+), 31 deletions(-)
diff --git a/opensm/opensm/osm_prtn.c b/opensm/opensm/osm_prtn.c
index f953876..4b087a4 100644
--- a/opensm/opensm/osm_prtn.c
+++ b/opensm/opensm/osm_prtn.c
@@ -167,21 +167,6 @@ static const ib_gid_t osm_ipoib_mgid = {
},
};
-/*
- * HACK: Until TS resolves their noncompliant join compmask,
- * we have to pre-define the MGID
- */
-static const ib_gid_t osm_ts_ipoib_mgid = {
- {
- 0xff, /* multicast field */
- 0x12, /* non-permanent bit, link local scope */
- 0x40, 0x1b, /* IPv4 signature */
- 0xff, 0xff, /* 16 bits of P_Key (to be filled in) */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 48 bits of zeros */
- 0x00, 0x00, 0x00, 0x01, /* 32 bit IPv4 broadcast address */
- },
-};
-
ib_api_status_t osm_prtn_add_mcgroup(osm_log_t * p_log, osm_subn_t * p_subn,
osm_prtn_t * p, uint8_t rate, uint8_t mtu,
uint8_t scope)
@@ -229,22 +214,6 @@ ib_api_status_t osm_prtn_add_mcgroup(osm_log_t * p_log, osm_subn_t * p_subn,
p->mgrp = p_mgrp;
}
- /* workaround for TS */
- /* FIXME: remove this upon TS fixes */
- mc_rec.mgid = osm_ts_ipoib_mgid;
- memcpy(&mc_rec.mgid.raw[4], &pkey, sizeof(pkey));
- /* Scope in MCMemberRecord (if present) needs to be consistent with MGID */
- mc_rec.scope_state = ib_member_set_scope_state(scope, IB_MC_REC_STATE_FULL_MEMBER);
- ib_mgid_set_scope(&mc_rec.mgid, scope);
-
- status = osm_mcmr_rcv_find_or_create_new_mgrp(p_sa, comp_mask, &mc_rec,
- &p_mgrp);
- if (p_mgrp) {
- p_mgrp->well_known = TRUE;
- if (!p->mgrp)
- p->mgrp = p_mgrp;
- }
-
return status;
}
--
1.6.2.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 4+ messages in thread[parent not found: <4C865139.7010705-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>]
* Re: [PATCH] opensm/osm_prtn.c: removing TopSpin hack [not found] ` <4C865139.7010705-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org> @ 2010-09-07 18:19 ` Sasha Khapyorsky 2010-09-07 20:55 ` [PATCH] opensm/sa: simplify osm_mcmr_rcv_find_or_create_new_mgrp() function call Sasha Khapyorsky 1 sibling, 0 replies; 4+ messages in thread From: Sasha Khapyorsky @ 2010-09-07 18:19 UTC (permalink / raw) To: kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb; +Cc: Linux RDMA On 17:50 Tue 07 Sep , Yevgeny Kliteynik wrote: > Removing hack that was supposed to support TopSpin's non-compliant > join compmask for IPoIB v4 multicast group ff12:401b:<pkey>::1 > > Signed-off-by: Yevgeny Kliteynik <kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> Applied. Thanks. Sasha -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] opensm/sa: simplify osm_mcmr_rcv_find_or_create_new_mgrp() function call [not found] ` <4C865139.7010705-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org> 2010-09-07 18:19 ` Sasha Khapyorsky @ 2010-09-07 20:55 ` Sasha Khapyorsky 2010-09-21 15:51 ` Yevgeny Kliteynik 1 sibling, 1 reply; 4+ messages in thread From: Sasha Khapyorsky @ 2010-09-07 20:55 UTC (permalink / raw) To: Linux RDMA; +Cc: kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb Simplify osm_mcmr_rcv_find_or_create_new_mgrp() function call so that it will return the pointer to created of found MC group. Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org> --- opensm/include/opensm/osm_sa.h | 15 +++++++-------- opensm/opensm/osm_prtn.c | 20 ++++++++++---------- opensm/opensm/osm_sa.c | 8 ++++---- opensm/opensm/osm_sa_mcmember_record.c | 21 ++++++++++----------- 4 files changed, 31 insertions(+), 33 deletions(-) diff --git a/opensm/include/opensm/osm_sa.h b/opensm/include/opensm/osm_sa.h index d516310..7c1061d 100644 --- a/opensm/include/opensm/osm_sa.h +++ b/opensm/include/opensm/osm_sa.h @@ -472,22 +472,21 @@ int osm_sa_db_file_load(struct osm_opensm *p_osm); * SYNOPSIS */ -ib_api_status_t -osm_mcmr_rcv_find_or_create_new_mgrp(IN osm_sa_t * sa, IN ib_net64_t comp_mask, - IN ib_member_rec_t * p_recvd_mcmember_rec, - OUT osm_mgrp_t ** pp_mgrp); +osm_mgrp_t *osm_mcmr_rcv_find_or_create_new_mgrp(IN osm_sa_t * sa, + IN ib_net64_t comp_mask, + IN ib_member_rec_t * + p_recvd_mcmember_rec); /* * PARAMETERS * p_sa * [in] Pointer to an osm_sa_t object. +* comp_mask +* [in] SA query component mask * p_recvd_mcmember_rec * [in] Received Multicast member record * -* pp_mgrp -* [out] pointer the osm_mgrp_t object -* * RETURN VALUES -* IB_SUCCESS, IB_ERROR +* The pointer to MC group object found or created, NULL in case of errors * *********/ diff --git a/opensm/opensm/osm_prtn.c b/opensm/opensm/osm_prtn.c index 4b087a4..6a23c76 100644 --- a/opensm/opensm/osm_prtn.c +++ b/opensm/opensm/osm_prtn.c @@ -174,9 +174,8 @@ ib_api_status_t osm_prtn_add_mcgroup(osm_log_t * p_log, osm_subn_t * p_subn, ib_member_rec_t mc_rec; ib_net64_t comp_mask; ib_net16_t pkey; - osm_mgrp_t *p_mgrp = NULL; + osm_mgrp_t *mgrp; osm_sa_t *p_sa = &p_subn->p_osm->sa; - ib_api_status_t status = IB_SUCCESS; uint8_t hop_limit; pkey = p->pkey | cl_hton16(0x8000); @@ -197,24 +196,25 @@ ib_api_status_t osm_prtn_add_mcgroup(osm_log_t * p_log, osm_subn_t * p_subn, mc_rec.pkt_life = p_subn->opt.subnet_timeout; mc_rec.sl_flow_hop = ib_member_set_sl_flow_hop(p->sl, 0, hop_limit); /* Scope in MCMemberRecord (if present) needs to be consistent with MGID */ - mc_rec.scope_state = ib_member_set_scope_state(scope, IB_MC_REC_STATE_FULL_MEMBER); + mc_rec.scope_state = + ib_member_set_scope_state(scope, IB_MC_REC_STATE_FULL_MEMBER); ib_mgid_set_scope(&mc_rec.mgid, scope); /* don't update rate, mtu */ comp_mask = IB_MCR_COMPMASK_MTU | IB_MCR_COMPMASK_MTU_SEL | IB_MCR_COMPMASK_RATE | IB_MCR_COMPMASK_RATE_SEL; - status = osm_mcmr_rcv_find_or_create_new_mgrp(p_sa, comp_mask, &mc_rec, - &p_mgrp); - if (!p_mgrp || status != IB_SUCCESS) + mgrp = osm_mcmr_rcv_find_or_create_new_mgrp(p_sa, comp_mask, &mc_rec); + if (!mgrp) { OSM_LOG(p_log, OSM_LOG_ERROR, "Failed to create MC group with pkey 0x%04x\n", cl_ntoh16(pkey)); - if (p_mgrp) { - p_mgrp->well_known = TRUE; - p->mgrp = p_mgrp; + return IB_ERROR; } - return status; + mgrp->well_known = TRUE; + p->mgrp = mgrp; + + return IB_SUCCESS; } static uint16_t generate_pkey(osm_subn_t * p_subn) diff --git a/opensm/opensm/osm_sa.c b/opensm/opensm/osm_sa.c index ef9872d..812e435 100644 --- a/opensm/opensm/osm_sa.c +++ b/opensm/opensm/osm_sa.c @@ -741,10 +741,10 @@ static osm_mgrp_t *load_mcgroup(osm_opensm_t * p_osm, ib_net16_t mlid, comp_mask = IB_MCR_COMPMASK_MTU | IB_MCR_COMPMASK_MTU_SEL | IB_MCR_COMPMASK_RATE | IB_MCR_COMPMASK_RATE_SEL; - if (osm_mcmr_rcv_find_or_create_new_mgrp(&p_osm->sa, - comp_mask, p_mcm_rec, - &p_mgrp) != IB_SUCCESS || - !p_mgrp || p_mgrp->mlid != mlid) { + if (!(p_mgrp = osm_mcmr_rcv_find_or_create_new_mgrp(&p_osm->sa, + comp_mask, + p_mcm_rec)) || + p_mgrp->mlid != mlid) { OSM_LOG(&p_osm->log, OSM_LOG_ERROR, "cannot create MC group with mlid 0x%04x and mgid " "0x%016" PRIx64 ":0x%016" PRIx64 "\n", cl_ntoh16(mlid), diff --git a/opensm/opensm/osm_sa_mcmember_record.c b/opensm/opensm/osm_sa_mcmember_record.c index 93c2767..b2318ec 100644 --- a/opensm/opensm/osm_sa_mcmember_record.c +++ b/opensm/opensm/osm_sa_mcmember_record.c @@ -868,21 +868,20 @@ Exit: /********************************************************************** Call this function to find or create a new mgrp. **********************************************************************/ -ib_api_status_t osm_mcmr_rcv_find_or_create_new_mgrp(IN osm_sa_t * sa, - IN ib_net64_t comp_mask, - IN ib_member_rec_t * - p_recvd_mcmember_rec, - OUT osm_mgrp_t ** pp_mgrp) +osm_mgrp_t *osm_mcmr_rcv_find_or_create_new_mgrp(IN osm_sa_t * sa, + IN ib_net64_t comp_mask, + IN ib_member_rec_t * + p_recvd_mcmember_rec) { osm_mgrp_t *mgrp; if ((mgrp = osm_get_mgrp_by_mgid(sa->p_subn, - &p_recvd_mcmember_rec->mgid))) { - *pp_mgrp = mgrp; - return IB_SUCCESS; - } - return mcmr_rcv_create_new_mgrp(sa, comp_mask, p_recvd_mcmember_rec, - NULL, pp_mgrp); + &p_recvd_mcmember_rec->mgid))) + return mgrp; + if (mcmr_rcv_create_new_mgrp(sa, comp_mask, p_recvd_mcmember_rec, NULL, + &mgrp) == IB_SUCCESS) + return mgrp; + return NULL; } /********************************************************************* -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] opensm/sa: simplify osm_mcmr_rcv_find_or_create_new_mgrp() function call 2010-09-07 20:55 ` [PATCH] opensm/sa: simplify osm_mcmr_rcv_find_or_create_new_mgrp() function call Sasha Khapyorsky @ 2010-09-21 15:51 ` Yevgeny Kliteynik 0 siblings, 0 replies; 4+ messages in thread From: Yevgeny Kliteynik @ 2010-09-21 15:51 UTC (permalink / raw) To: Sasha Khapyorsky; +Cc: Linux RDMA, Yevgeny Kliteynik On 07-Sep-10 11:55 PM, Sasha Khapyorsky wrote: > > Simplify osm_mcmr_rcv_find_or_create_new_mgrp() function call so that it > will return the pointer to created of found MC group. Looks good. -- Yevgeny > Signed-off-by: Sasha Khapyorsky<sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org> > --- > opensm/include/opensm/osm_sa.h | 15 +++++++-------- > opensm/opensm/osm_prtn.c | 20 ++++++++++---------- > opensm/opensm/osm_sa.c | 8 ++++---- > opensm/opensm/osm_sa_mcmember_record.c | 21 ++++++++++----------- > 4 files changed, 31 insertions(+), 33 deletions(-) > > diff --git a/opensm/include/opensm/osm_sa.h b/opensm/include/opensm/osm_sa.h > index d516310..7c1061d 100644 > --- a/opensm/include/opensm/osm_sa.h > +++ b/opensm/include/opensm/osm_sa.h > @@ -472,22 +472,21 @@ int osm_sa_db_file_load(struct osm_opensm *p_osm); > * SYNOPSIS > */ > > -ib_api_status_t > -osm_mcmr_rcv_find_or_create_new_mgrp(IN osm_sa_t * sa, IN ib_net64_t comp_mask, > - IN ib_member_rec_t * p_recvd_mcmember_rec, > - OUT osm_mgrp_t ** pp_mgrp); > +osm_mgrp_t *osm_mcmr_rcv_find_or_create_new_mgrp(IN osm_sa_t * sa, > + IN ib_net64_t comp_mask, > + IN ib_member_rec_t * > + p_recvd_mcmember_rec); > /* > * PARAMETERS > * p_sa > * [in] Pointer to an osm_sa_t object. > +* comp_mask > +* [in] SA query component mask > * p_recvd_mcmember_rec > * [in] Received Multicast member record > * > -* pp_mgrp > -* [out] pointer the osm_mgrp_t object > -* > * RETURN VALUES > -* IB_SUCCESS, IB_ERROR > +* The pointer to MC group object found or created, NULL in case of errors > * > *********/ > > diff --git a/opensm/opensm/osm_prtn.c b/opensm/opensm/osm_prtn.c > index 4b087a4..6a23c76 100644 > --- a/opensm/opensm/osm_prtn.c > +++ b/opensm/opensm/osm_prtn.c > @@ -174,9 +174,8 @@ ib_api_status_t osm_prtn_add_mcgroup(osm_log_t * p_log, osm_subn_t * p_subn, > ib_member_rec_t mc_rec; > ib_net64_t comp_mask; > ib_net16_t pkey; > - osm_mgrp_t *p_mgrp = NULL; > + osm_mgrp_t *mgrp; > osm_sa_t *p_sa =&p_subn->p_osm->sa; > - ib_api_status_t status = IB_SUCCESS; > uint8_t hop_limit; > > pkey = p->pkey | cl_hton16(0x8000); > @@ -197,24 +196,25 @@ ib_api_status_t osm_prtn_add_mcgroup(osm_log_t * p_log, osm_subn_t * p_subn, > mc_rec.pkt_life = p_subn->opt.subnet_timeout; > mc_rec.sl_flow_hop = ib_member_set_sl_flow_hop(p->sl, 0, hop_limit); > /* Scope in MCMemberRecord (if present) needs to be consistent with MGID */ > - mc_rec.scope_state = ib_member_set_scope_state(scope, IB_MC_REC_STATE_FULL_MEMBER); > + mc_rec.scope_state = > + ib_member_set_scope_state(scope, IB_MC_REC_STATE_FULL_MEMBER); > ib_mgid_set_scope(&mc_rec.mgid, scope); > > /* don't update rate, mtu */ > comp_mask = IB_MCR_COMPMASK_MTU | IB_MCR_COMPMASK_MTU_SEL | > IB_MCR_COMPMASK_RATE | IB_MCR_COMPMASK_RATE_SEL; > - status = osm_mcmr_rcv_find_or_create_new_mgrp(p_sa, comp_mask,&mc_rec, > - &p_mgrp); > - if (!p_mgrp || status != IB_SUCCESS) > + mgrp = osm_mcmr_rcv_find_or_create_new_mgrp(p_sa, comp_mask,&mc_rec); > + if (!mgrp) { > OSM_LOG(p_log, OSM_LOG_ERROR, > "Failed to create MC group with pkey 0x%04x\n", > cl_ntoh16(pkey)); > - if (p_mgrp) { > - p_mgrp->well_known = TRUE; > - p->mgrp = p_mgrp; > + return IB_ERROR; > } > > - return status; > + mgrp->well_known = TRUE; > + p->mgrp = mgrp; > + > + return IB_SUCCESS; > } > > static uint16_t generate_pkey(osm_subn_t * p_subn) > diff --git a/opensm/opensm/osm_sa.c b/opensm/opensm/osm_sa.c > index ef9872d..812e435 100644 > --- a/opensm/opensm/osm_sa.c > +++ b/opensm/opensm/osm_sa.c > @@ -741,10 +741,10 @@ static osm_mgrp_t *load_mcgroup(osm_opensm_t * p_osm, ib_net16_t mlid, > > comp_mask = IB_MCR_COMPMASK_MTU | IB_MCR_COMPMASK_MTU_SEL > | IB_MCR_COMPMASK_RATE | IB_MCR_COMPMASK_RATE_SEL; > - if (osm_mcmr_rcv_find_or_create_new_mgrp(&p_osm->sa, > - comp_mask, p_mcm_rec, > - &p_mgrp) != IB_SUCCESS || > - !p_mgrp || p_mgrp->mlid != mlid) { > + if (!(p_mgrp = osm_mcmr_rcv_find_or_create_new_mgrp(&p_osm->sa, > + comp_mask, > + p_mcm_rec)) || > + p_mgrp->mlid != mlid) { > OSM_LOG(&p_osm->log, OSM_LOG_ERROR, > "cannot create MC group with mlid 0x%04x and mgid " > "0x%016" PRIx64 ":0x%016" PRIx64 "\n", cl_ntoh16(mlid), > diff --git a/opensm/opensm/osm_sa_mcmember_record.c b/opensm/opensm/osm_sa_mcmember_record.c > index 93c2767..b2318ec 100644 > --- a/opensm/opensm/osm_sa_mcmember_record.c > +++ b/opensm/opensm/osm_sa_mcmember_record.c > @@ -868,21 +868,20 @@ Exit: > /********************************************************************** > Call this function to find or create a new mgrp. > **********************************************************************/ > -ib_api_status_t osm_mcmr_rcv_find_or_create_new_mgrp(IN osm_sa_t * sa, > - IN ib_net64_t comp_mask, > - IN ib_member_rec_t * > - p_recvd_mcmember_rec, > - OUT osm_mgrp_t ** pp_mgrp) > +osm_mgrp_t *osm_mcmr_rcv_find_or_create_new_mgrp(IN osm_sa_t * sa, > + IN ib_net64_t comp_mask, > + IN ib_member_rec_t * > + p_recvd_mcmember_rec) > { > osm_mgrp_t *mgrp; > > if ((mgrp = osm_get_mgrp_by_mgid(sa->p_subn, > - &p_recvd_mcmember_rec->mgid))) { > - *pp_mgrp = mgrp; > - return IB_SUCCESS; > - } > - return mcmr_rcv_create_new_mgrp(sa, comp_mask, p_recvd_mcmember_rec, > - NULL, pp_mgrp); > + &p_recvd_mcmember_rec->mgid))) > + return mgrp; > + if (mcmr_rcv_create_new_mgrp(sa, comp_mask, p_recvd_mcmember_rec, NULL, > + &mgrp) == IB_SUCCESS) > + return mgrp; > + return NULL; > } > > /********************************************************************* -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-21 15:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-07 14:50 [PATCH] opensm/osm_prtn.c: removing TopSpin hack Yevgeny Kliteynik
[not found] ` <4C865139.7010705-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
2010-09-07 18:19 ` Sasha Khapyorsky
2010-09-07 20:55 ` [PATCH] opensm/sa: simplify osm_mcmr_rcv_find_or_create_new_mgrp() function call Sasha Khapyorsky
2010-09-21 15:51 ` Yevgeny Kliteynik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox