[ofa-general] Issues with osm_lin_fwd_tbl.h:osm_lin_fwd_tbl_get_lids_per_block()

Vincent Ficet jean-vincent.ficet at bull.net
Wed Jul 9 06:37:57 PDT 2008


Hello,

The function osm_lin_fwd_tbl.h:osm_lin_fwd_tbl_get_lids_per_block() is 
coded as follows:

static inline uint16_t
osm_lin_fwd_tbl_get_lids_per_block(IN const osm_lin_fwd_tbl_t * const p_tbl)
{
    UNUSED_PARAM(p_tbl);
    return (64);
}

Given that the block used comes from the 'data' (payload) field of the 
ib_smp_t structure (defined in opensm/include/iba/ib_types.h) which is:

uint8_t data[IB_SMP_DATA_SIZE];

where IB_SMP_DATA_SIZE is defined as:

#define IB_SMP_DATA_SIZE 64

Shouldn't osm_lin_fwd_tbl_get_lids_per_block() be implemented as follows:

{
    UNUSED_PARAM(p_tbl);
    return IB_SMP_DATA_SIZE;
}

Also, a LID beeing 16 bit wide, the function name is rather misleading 
if not wrong:
In actual fact, it should rather be called 
osm_lin_fwd_tbl_get_ports_per_block(), since output ports are encoded as 
uint8_t in osm_lin_fwd_tbl.h:

typedef struct osm_lin_fwdbl {
    uint16_t size;
    uint8_t port_tbl[1];
} osm_lin_fwd_tbl_t;

I think the confusion here is the same as a previous issue I raised in 
commit a4934944004586759b3519afa71db5fddebb6541
Do you agree ? If so, I can post a patch if you wish.

Finally, what is the point in keeping the unused parameter p_tbl ?

Thanks for your help,

Vincent



More information about the general mailing list