[ofa-general] [PATCH 2/3] ibutils/ibis: adding support for Congestion Control

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Mon Jun 30 01:33:35 PDT 2008


Hi Oren,

This patch integrates new CC interface into ibis
and exposes all the CC attributes and methods.

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 ibis/src/Makefile.am |    8 ++-
 ibis/src/ibis.i      |  100 +++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 103 insertions(+), 5 deletions(-)

diff --git a/ibis/src/Makefile.am b/ibis/src/Makefile.am
index 7166906..a45b1ec 100644
--- a/ibis/src/Makefile.am
+++ b/ibis/src/Makefile.am
@@ -57,11 +57,11 @@ LIB_FILE_TRIPLET=1.0.0
 lib_LTLIBRARIES = libibiscom.la libibis.la

 libibiscom_la_SOURCES = ibbbm.c ibcr.c	ibis.c ibis_gsi_mad_ctrl.c \
-	ibpm.c ibsac.c ibsm.c ibvs.c
+	ibpm.c ibsac.c ibsm.c ibvs.c ibcc.c

 # client library to be used by IBIS TCL package:
 libibis_la_SOURCES = ibis_wrap.c ibbbm.c ibcr.c	ibis.c ibis_gsi_mad_ctrl.c \
-	ibpm.c ibsac.c ibsm.c ibvs.c
+	ibpm.c ibsac.c ibsm.c ibvs.c ibcc.c

 libibis_la_LDFLAGS = -version-info $(LIB_VER_TRIPLET) -no-undefined  \
 	 $(OSM_LDFLAGS) $(TCL_LIBS)
@@ -87,7 +87,8 @@ SWIG_IFC_FILES= $(srcdir)/ibbbm.i \
 	$(srcdir)/ibpm.i \
 	$(srcdir)/ibsac.i \
 	$(srcdir)/ibsm.i \
-	$(srcdir)/ibvs.i
+	$(srcdir)/ibvs.i \
+	$(srcdir)/ibcc.i

 ibis.lo: $(srcdir)/git_version.h

@@ -150,6 +151,7 @@ EXTRA_DIST = swig_extended_obj.c fixSwigWrapper pkgIndex.tcl \
 	 ibsm.h \
 	 ibvs_base.h \
 	 ibvs.h \
+	 ibcc.h \
 	 git_version.h

 # we do not want the temporary and the archive libs installed:
diff --git a/ibis/src/ibis.i b/ibis/src/ibis.i
index a3c9b45..12e2115 100644
--- a/ibis/src/ibis.i
+++ b/ibis/src/ibis.i
@@ -64,6 +64,7 @@ BEGIN_C_DECLS
 #include "ibbbm.h"
 #include "ibsac.h"
 #include "ibsm.h"
+#include "ibcc.h"

 END_C_DECLS

@@ -149,7 +150,7 @@ ibisp_is_debug(void)
 %include ibcr.i

 //
-// IBCR Interfaces and C Code
+// IBPM Interfaces and C Code
 //
 %include ibpm.i

@@ -173,6 +174,11 @@ ibisp_is_debug(void)
 //
 %include ibsm.i

+//
+// IBCC Interfaces and C Code
+//
+%include ibcc.i
+
 %{
   /* globals */
   ibis_t    IbisObj;
@@ -231,11 +237,19 @@ ibisp_is_debug(void)
     status = ibsm_init(gp_ibsm);
     if( status != IB_SUCCESS )
     {
-      printf("-E- Fail to init ibbbm_init.\n");
+      printf("-E- Fail to init ibsm_init.\n");
       ibsm_destroy( gp_ibsm );
       exit(1);
     }

+    status = ibcc_init(gp_ibcc);
+    if( status != IB_SUCCESS )
+    {
+      printf("-E- Fail to init ibcc_init.\n");
+      ibcc_destroy( gp_ibcc );
+      exit(1);
+    }
+
     return 0;
   }

@@ -249,6 +263,7 @@ ibisp_is_debug(void)
     ibvs_destroy(p_ibvs_global);
     ibbbm_destroy(p_ibbbm_global);
     ibsm_destroy(gp_ibsm);
+    ibcc_destroy(gp_ibcc);

     ibis_destroy();
     usleep(100);
@@ -321,6 +336,14 @@ ibisp_is_debug(void)
       exit(1);
     }

+    status = ibcc_bind(gp_ibcc);
+    if( status != IB_SUCCESS )
+    {
+      printf("-E- Fail to ibcc_bind.\n");
+      ibcc_destroy( gp_ibcc );
+      exit(1);
+    }
+
     if (ibsac_bind(&IbisObj))
     {
       printf("-E- Fail to ibsac_bind.\n");
@@ -592,6 +615,28 @@ extern char * ibisSourceVersion;
       memset(&ibsm_pkey_table_obj, 0, sizeof(ib_pkey_table_t));
       memset(&ibsm_sm_info_obj, 0, sizeof(ib_sm_info_t));

+      /* ------------------ IBCC ---------------------- */
+
+      gp_ibcc = ibcc_construct();
+
+      if (gp_ibcc == NULL) {
+          printf("-E- Error from ibcc_construct.\n");
+          exit(1);
+      }
+
+      /* Initialize global records */
+      memset(&ibcc_class_port_info_obj, 0, sizeof(ib_class_port_info_t));
+      memset(&ibcc_notice_obj, 0, sizeof(ib_mad_notice_attr_t));
+      memset(&ibcc_cong_info_obj, 0, sizeof(ib_cong_info_t));
+      memset(&ibcc_cong_key_info_obj, 0, sizeof(ib_cong_key_info_t));
+      memset(&ibcc_ca_cong_log_obj, 0, sizeof(ibcc_ca_cong_log_t));
+      memset(&ibcc_sw_cong_log_obj, 0, sizeof(ibcc_sw_cong_log_t));
+      memset(&ibcc_sw_cong_setting_obj, 0, sizeof(ib_sw_cong_setting_t));
+      memset(&ibcc_sw_port_cong_setting_obj, 0, sizeof(ib_sw_port_cong_setting_t));
+      memset(&ibcc_ca_cong_setting_obj, 0, sizeof(ib_ca_cong_setting_t));
+      memset(&ibcc_table_obj, 0, sizeof(ib_cc_tbl_t));
+      memset(&ibcc_time_stamp_obj, 0, sizeof(ib_time_stamp_t));
+
       /* ------------------ IBSAC ---------------------- */

       /* Initialize global records */
@@ -697,6 +742,9 @@ extern char * ibisSourceVersion;
 									 (ClientData)ibis_opt_p, 0);

     /* add commands for accessing the global query records */
+
+    /* ------------------ IBSM ---------------------- */
+
     Tcl_CreateObjCommand(interp,"smNodeInfoMad",
                          TclsmNodeInfoMethodCmd,
                          (ClientData)&ibsm_node_info_obj, 0);
@@ -745,6 +793,54 @@ extern char * ibisSourceVersion;
                          TclsmNoticeMethodCmd,
                          (ClientData)&ibsm_notice_obj, 0);

+    /* ------------------ IBCC ---------------------- */
+
+    Tcl_CreateObjCommand(interp,"ccClassPortInfoMad",
+                         TclccClassPortInfoMethodCmd,
+                         (ClientData)&ibcc_class_port_info_obj, 0);
+
+    Tcl_CreateObjCommand(interp,"ccNoticeMad",
+                         TclccNoticeMethodCmd,
+                         (ClientData)&ibcc_notice_obj, 0);
+
+    Tcl_CreateObjCommand(interp,"ccCongestionInfoMad",
+                         TclccCongestionInfoMethodCmd,
+                         (ClientData)&ibcc_cong_info_obj, 0);
+
+    Tcl_CreateObjCommand(interp,"ccCongestionKeyInfoMad",
+                         TclccCongestionKeyInfoMethodCmd,
+                         (ClientData)&ibcc_cong_key_info_obj, 0);
+
+    Tcl_CreateObjCommand(interp,"ccCACongestionLogMad",
+                         TclccCACongestionLogMethodCmd,
+                         (ClientData)&ibcc_ca_cong_log_obj, 0);
+
+    Tcl_CreateObjCommand(interp,"ccSWCongestionLogMad",
+                         TclccSWCongestionLogMethodCmd,
+                         (ClientData)&ibcc_sw_cong_log_obj, 0);
+
+    Tcl_CreateObjCommand(interp,"ccSWCongestionSettingMad",
+                         TclccSWCongestionSettingMethodCmd,
+                         (ClientData)&ibcc_sw_cong_setting_obj, 0);
+
+    Tcl_CreateObjCommand(interp,"ccSWPortCongestionSettingMad",
+                         TclccSWPortCongestionSettingMethodCmd,
+                         (ClientData)&ibcc_sw_port_cong_setting_obj, 0);
+
+    Tcl_CreateObjCommand(interp,"ccCACongestionSettingMad",
+                         TclccCACongestionSettingMethodCmd,
+                         (ClientData)&ibcc_ca_cong_setting_obj, 0);
+
+    Tcl_CreateObjCommand(interp,"ccTableMad",
+                         TclccTableMethodCmd,
+                         (ClientData)&ibcc_table_obj, 0);
+
+    Tcl_CreateObjCommand(interp,"ccTimeStampMad",
+                         TclccTimeStampMethodCmd,
+                         (ClientData)&ibcc_time_stamp_obj, 0);
+
+    /* ------------------ IBSAC --------------------- */
+
 	 Tcl_CreateObjCommand(interp,"sacNodeQuery",
 								 TclsacNodeRecMethodCmd,
 								 (ClientData)&ibsac_node_rec, 0);
-- 
1.5.1.4




More information about the general mailing list