Adding Congestion Control definitions.
Subsystems (2)
PATCH 1/1 Adding Congestion Control definitions.
Adding Congestion Control definitions as described in IB spec A10 and Link Working Group Errata Q3/2010.
--- Makefile.am | 4 +- include/infiniband/mad.h | 67 +++++++++++++++++++++++++++++- src/ccm.c | 102 ++++++++++++++++++++++++++++++++++++++++++++++ src/dump.c | 25 +++++++++++ src/fields.c | 47 +++++++++++++++++++++- src/libibmad.map | 2 + src/mad.c | 3 +- 7 files changed, 244 insertions(+), 6 deletions(-) create mode 100644 src/ccm.c
Makefile.am +2 -2
@@ -15,8 +15,8 @@ endif libibmad_la_SOURCES = src/dump.c src/fields.c src/mad.c src/portid.c \ src/resolve.c src/rpc.c src/sa.c src/smp.c src/gs.c \ - src/serv.c src/register.c src/vendor.c src/bm.c \ - src/mad_internal.h + src/serv.c src/register.c src/vendor.c src/bm.c src/ccm.c\ + src/mad_internal.h libibmad_la_LDFLAGS = -version-info $(ibmad_api_version) \ -export-dynamic $(libibmad_version_script)
include/infiniband/mad.h +66 -1
97 lines not on this page · raw message
src/ccm.c new file +102 -0
102 lines not on this page · raw message
src/dump.c +25 -0
@@ -591,6 +591,7 @@ static inline void ib_slvl_get_i(ib_slvl_table_t * tbl, int i, uint8_t * vl) }#define IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK 32 +#define IB_NUM_CONGESTION_ENTRIES 15 typedef struct _ib_vl_arb_table { struct {
@@ -599,6 +600,15 @@ typedef struct _ib_vl_arb_table { } vl_entry[IB_NUM_VL_ARB_ELEMENTS_IN_BLOCK ]; } ib_vl_arb_table_t; +typedef struct _ib_cc_log_entry { + +uint16_t res_vl; +uint16_t weight; +uint32_t sl_res; +uint32_t timestamp; + +}ib_cc_log_entry_t ; +static inline void ib_vl_arb_get_vl (uint8_t res_vl,uint8_t *const vl) { *vl = res_vl &0x0F ;
@@ -715,6 +725,21 @@ void mad_dump_perfcounters_ext(char *buf, int bufsz, void *val, int valsz)_dump_fields (buf, bufsz, val,IB_PC_EXT_FIRST_F ,IB_PC_EXT_LAST_F ); } +void mad_dump_cc_list (char *buf,int bufsz,void *val,int valsz) +{ +int i; +int n =0 ; +ib_cc_log_entry_t *ib_cc_table = (ib_cc_log_entry_t *) val; + +for (i =0 ; i <IB_NUM_CONGESTION_ENTRIES ; i++) { + n +=sprintf (buf + n,"\nentry %d: " , i +1 ); + n +=_dump_fields (buf + n, bufsz - n, ib_cc_table + i, +IB_CC_LOG_EVENT_FIRST_F , +IB_CC_LOG_EVENT_LAST ); + } +sprintf (buf + n,"\n" ); +} +void mad_dump_perfcounters_xmt_sl (char *buf,int bufsz,void *val,int valsz) {int cnt;
src/fields.c +46 -1
59 lines not on this page · raw message
src/libibmad.map +2 -0
@@ -110,5 +110,7 @@ IBMAD_1.3 { ib_resolve_self_via; mad_field_name; bm_call_via; + cc_query_via; + cc_set_via; local: *; };
src/mad.c +1 -2
@@ -82,8 +82,7 @@ void *mad_encode(void *buf, ib_rpc_t * rpc, ib_dr_path_t * drpath, void *data)/* first word */ mad_set_field (buf,0 ,IB_MAD_METHOD_F , rpc->method);mad_set_field (buf,0 ,IB_MAD_RESPONSE_F , is_resp ?1 :0 ); -mad_set_field (buf,0 ,IB_MAD_CLASSVER_F , - rpc->mgtclass ==IB_SA_CLASS ?2 :1 ); +mad_set_field (buf,0 ,IB_MAD_CLASSVER_F ,mgmt_class_vers ( rpc->mgtclass));mad_set_field (buf,0 ,IB_MAD_MGMTCLASS_F , rpc->mgtclass);mad_set_field (buf,0 ,IB_MAD_BASEVER_F ,1 );
Signature · 6 lines
1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20110321162017.GA5062-iQai9MGU/dyyaiaB+Ve85laTQe2KTcn/@public.gmane.org
src/ccm.c line 46
Quoted 2 lines
src/ccm.c new file +2
-0+#undef DEBUG +#define DEBUG if (ibdebug) IBWARN
I didn't see where this was used, but in general this sort of definition may not work. It can incorrectly associate a 'else' class with the if (ibdebug) statement, rather than the intended statement. --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CF9C39F99A89134C9CF9C4CCB68B8DDF25CCC7B902-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org
Quoted 4 lines · Sean
src/ccm.c line 46
Quoted 2 lines
src/ccm.c new file +2
-0+#undef DEBUG +#define DEBUG if (ibdebug) IBWARNI didn't see where this was used, but in general this sort of definition may not work. It can incorrectly associate a 'else' class with the if (ibdebug) statement, rather than the intended statement.
You are right. These lines shouln't be here at the first place. I'll review the patch and resend.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html