[openib-general] Get Table Records for SA Attribute ID ?

Hal Rosenstock halr at voltaire.com
Thu Feb 16 12:12:28 PST 2006


Hi Takshak,

On Thu, 2006-02-16 at 08:05, Takshak C. wrote:
> Hi Hal,
> 
> Thanks for the information.
> Based on your feedback, I have corrected the SA MAD structure and added RMPP header as below:
> 
> typedef struct mad_header
> {
>     uint8_t     base_version;
>     uint8_t     mgmt_class;
>     uint8_t     class_version;
>     uint8_t     response_bit;
>     uint8_t     method;

Response bit is combined with method in 8 bits.

>     uint16_t    status;
>     uint16_t    class_spec;
>     uint64_t    tid;
>     uint16_t    attr_id;
>     uint16_t    resv;
>     uint32_t    attr_mod;
> } ib_mad_t ;
>                                                                                                                              
> typedef struct _ib_rmpp_mad
> {
>     ib_mad_t                common_hdr;
>                                                                                                                              
>     uint8_t                 rmpp_version;
>     uint8_t                 rmpp_type;
>     uint8_t                 rmpp_flags;
>     uint8_t                 rmpp_status;
>                                                                                                                              
>     uint32_t                seg_num;
>     uint32_t                paylen_newwin;
>     uint8_t                 data[192];
>                                                                                                                              
> }   ib_rmpp_mad_t;
> 
>     ib_rmpp_mad_t *p_mad = (struct ib_rmpp_mad_t*)(umad_get_mad(umad));
>     memset(p_mad, 0, sizeof(ib_rmpp_mad_t));
>                                                                                                                              
>     p_mad->common_hdr.base_version = 1 ;
>     p_mad->common_hdr.mgmt_class = IB_MCLASS_SUBN_ADM ;
>     p_mad->common_hdr.class_version = (uint8_t) 2 ;
>     p_mad->common_hdr.method = IB_MAD_METHOD_GET;
>     p_mad->common_hdr.status = 0;
>     p_mad->common_hdr.class_spec = 0;
>     p_mad->common_hdr.tid = 0x123 ;
>     p_mad->common_hdr.attr_id = IB_SA_ATTR_PATHRECORD ;
>     p_mad->common_hdr.resv = 0;
>     p_mad->common_hdr.attr_mod = 0 ;
>                                                                                                                              
>     p_mad->rmpp_version = 1 ;
>     p_mad->seg_num = 1 ;
>     p_mad->rmpp_flags |= (uint8_t)0x70 ;
>     p_mad->rmpp_status = 0;
>     p_mad->paylen_newwin = IB_MAD_SIZE - MAD_RMPP_HDR_SIZE ; // 256 - 36

Since you are doing a GET rather than GET TABLE, none of this RMPP stuff
matters.
                                                                                                                     
>     umad_set_addr(umad, port_attr.sm_lid , 1, 0, IB_DEFAULT_QP1_QKEY);
>     umad_set_grh(umad, 0);
>     umad_set_pkey(umad, 0xFFFF); // IB_DEFAULT_PKEY 0xFFFF
> 
> 
> I have registered umad with RMPP = 1. I have not started openSM instance here. I m using vendor specific SM. 
> I have done umad_send(...) and umad_recv(). 

Do you see the packet sent on the IB wire ? Do you see a response come
in ? If you don't have an analyzer, you can use madeye.

> Could you please tell me, what should I do to retrieve the PathRecord after umad_recv(...) call ?

You would need to decode it.

> I believe, if I call function :  
>           ib_rmpp_mad_t *recv_mad = (ib_rmpp_mad_t*)umad_get_mad(umad); and then 
>           read this recv_mad will give me path record from local HCA ? 
> Or is there anyother good way to do the same ?

Stepping back, what are you trying to do ? I think you answered part of
this below. Can you elaborate more ?

> Please throw some light on this. Do you have any userspace SA support for retrieving path, service record 
> information ?

There have been discussions about userspace SA support but nothing
currently for OpenIB (gen2). Currently, you can get this by using
osm_vendor_ibumad_sa.c which supports most SA requests. It is built as
part of libosmvendor (part of the OpenSM build) but can be used outside
of OpenSM. It is used by osmtest if you want to look at some use cases.
It obtains PathRecords and ServiceRecords. That might be an easier
direction to go than trying to use the management libraries to build the
pieces of a userspace SA client you want.

-- Hal

> 
> Regards.
> - Takshak 
> 
> 
> Hal Rosenstock wrote:
> 
> >Hi,
> > 
> >There are a couple of issues with the below.
> > 
> >1. SA MAD structure is missing the RMPP header. Once I saw that I didn't check for further issues with the format.
> > 
> >2. I will assume your register call sets RMPP.
> > 
> >3. SA class version is 2.
> > 
> >What SM are you using ? If you are using OpenSM, you can turn on verbose and see if the packet is seen by the SM. You could also enable madeye (in utils) to see if the packet is sent (and if anything is received back).
> > 
> >-- Hal
> >
> >________________________________
> >
> >From: openib-general-bounces at openib.org on behalf of Takshak C.
> >Sent: Mon 2/6/2006 8:00 AM
> >To: openib-general at openib.org
> >Subject: [openib-general] Get Table Records for SA Attribute ID ?
> >
> >
> >
> >Hi,
> >
> >I m trying to get the table records for SA attribute ID in following way.
> >But, I m not getting a single record, could anyone comment on the problem.
> >
> >1. I have created saMadFormat structure described in the specification as below:
> >
> >struct saMadFormat
> >{
> >
> >    uint8_t base_version ;
> >    uint8_t mgmt_class ;
> >    uint8_t class_version ;
> >    uint8_t sa_method ;
> >    uint16_t    status ;
> >    uint16_t    not_used ;
> >    uint64_t    tid ;
> >    uint16_t    attr_id ;
> >    uint16_t    resv ;
> >    uint32_t    attr_mod ;
> >    uint64_t    sa_key;
> >    uint64_t    sm_key ;
> >    uint32_t    seg_num ;
> >    uint32_t    payload_len ;
> >    uint8_t     frag_flag ;
> >    uint8_t edit_mod ;
> >    uint16_t    window ;
> >    uint32_t    endRID ;
> >    uint64_t    comp_mask ;
> >    uint8_t adminData[192] ;
> >};
> >
> >2. Then I have done all the basic operations like umad_open, umad_register for the IB_SA_CLASS
> >   and umad_open_port etc successfully.
> >
> >3. struct saMadFormat *saQuery = (struct saMadFormat*)(umad_get_mad(umad));
> >   memset(saQuery, 0, sizeof(*saQuery));
> >
> >   saQuery->base_version = 1;
> >   saQuery->mgmt_class = IB_SA_CLASS ;
> >   saQuery->class_version = 1 ;
> >   saQuery->sa_method = IB_MAD_METHOD_GET_TABLE ;
> >   saQuery->attr_id = IB_SA_ATTR_PATHRECORD ;
> >   saQuery->attr_mod = 0 ;
> >   saQuery->tid  = htonll(drmad_tid++); 
> >   saQuery->endRID = 0 ;
> >
> >   umad_set_addr(umad, lid, 1, 0, IB_DEFAULT_QP1_QKEY);
> >   umad_set_grh(umad, 0);
> >   umad_set_pkey(umad, 0xFFFF);
> >
> >4. length = IB_MAD_SIZE;
> >
> >  if (umad_send(portid, mad_agent, umad, length, timeout_ms, 0) < 0)
> >     IBPANIC("send failed");                                                                                                                    
> >
> >  if (umad_recv(portid, umad, &length, -1) != mad_agent)
> >     IBPANIC("recv error: %s", drmad_status_str(saQuery));
> >
> >                                                                                                                     
> >
> >  if (!dump_char) {
> >      xdump(stdout, 0, saQuery->adminData, 192);
> >      return 0;
> >   }
> >
> >I m expecting that, I will get the resultant data in saQuery->adminData.
> >Is this correct ? If not then, how should I retrieve the table records ?
> >Any Idea ?
> >
> >
> >Thanks
> >- Takshak
> >
> >_______________________________________________
> >openib-general mailing list
> >openib-general at openib.org
> >http://openib.org/mailman/listinfo/openib-general
> >
> >To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
> >
> >
> >
> >  
> >
> 




More information about the general mailing list