[ofa-general] [PATCH] opensm/osm_multicast.[ch]: simplify flows, remove unused functions

Sasha Khapyorsky sashak at voltaire.com
Tue Sep 16 08:47:52 PDT 2008


Hi Hal,

On 09:52 Tue 16 Sep     , Hal Rosenstock wrote:
> > +void
> > +osm_mgrp_send_delete_notice(IN osm_subn_t * const p_subn,
> > +                           IN osm_log_t * const p_log, IN osm_mgrp_t * p_mgrp)
> > +{
> > +       mgrp_send_notice(p_subn, p_log, p_mgrp, 67);
> >  }
> 
> Any reason not to eliminate this extra call level ?

Basically I agree, and in future it can be eliminated (I have few more
patches in the stack :)). This patch is "cosmetic" one, so I didn't change
any OpenSM internal API.

> > -/**********************************************************************
> > - **********************************************************************/
> >  void
> >  osm_mgrp_send_create_notice(IN osm_subn_t * const p_subn,
> >                            IN osm_log_t * const p_log, IN osm_mgrp_t * p_mgrp)
> >  {
> > -       ib_mad_notice_attr_t notice;
> > -       ib_api_status_t status;
> > -
> > -       OSM_LOG_ENTER(p_log);
> > -
> > -       /* prepare the needed info */
> > -
> > -       /* details of the notice */
> > -       notice.generic_type = 0x83;     /* Generic SubnMgt type */
> > -       ib_notice_set_prod_type_ho(&notice, 4); /* A Class Manager generator */
> > -       notice.g_or_v.generic.trap_num = CL_HTON16(66); /* create of mcg */
> > -       /* The sm_base_lid is saved in network order already. */
> > -       notice.issuer_lid = p_subn->sm_base_lid;
> > -       /* following o14-12.1.11 and table 120 p726 */
> > -       /* we need to provide the MGID */
> > -       memcpy(&(notice.data_details.ntc_64_67.gid),
> > -              &(p_mgrp->mcmember_rec.mgid), sizeof(ib_gid_t));
> > -
> > -       /* According to page 653 - the issuer gid in this case of trap
> > -          is the SM gid, since the SM is the initiator of this trap. */
> > -       notice.issuer_gid.unicast.prefix = p_subn->opt.subnet_prefix;
> > -       notice.issuer_gid.unicast.interface_id = p_subn->sm_port_guid;
> > -
> > -       status = osm_report_notice(p_log, p_subn, &notice);
> > -       if (status != IB_SUCCESS) {
> > -               OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 7602: "
> > -                       "Error sending trap reports (%s)\n",
> > -                       ib_get_err_str(status));
> > -               goto Exit;
> > -       }
> > -
> > -Exit:
> > -       OSM_LOG_EXIT(p_log);
> > +       mgrp_send_notice(p_subn, p_log, p_mgrp, 66);
> 
> Similarly, any reason not to eliminate this extra calling level ?

Ditto.

Sasha



More information about the general mailing list