infiniband-diags: add config file option for Mellanox ExtPortInfo queries
PATCH 2/3 infiniband-diags: add config file option for Mellanox ExtPortInfo queries
In addition add a common option to specify an alternate config file.
Signed-off-by Ira Weiny <[email protected]>
--- etc/ibdiag.conf | 4 + include/ibdiag_common.h | 1 + libibnetdisc/include/infiniband/ibnetdisc.h | 6 +- libibnetdisc/src/ibnetdisc.c | 6 +- man/infiniband-diags.8.in | 10 ++- src/ibdiag_common.c | 113 ++++++++++++++++----------- src/iblinkinfo.c | 2 + src/ibqueryerrors.c | 2 + 8 files changed, 93 insertions(+), 51 deletions(-)
etc/ibdiag.conf +4 -0
@@ -11,3 +11,7 @@ # define a different default timeout #timeout=50 +# disable query of Mellanox Extended PortInfo on ibnetdiscover subnet sweeps +# Default = true +#MLX_EPI=false +
include/ibdiag_common.h +1 -0
@@ -49,6 +49,7 @@ extern int ibd_ca_port;extern enum MAD_DEST ibd_dest_type;extern ib_portid_t *ibd_sm_id;extern int ibd_timeout; +extern uint32_t ibd_ibnetdisc_flags;/*========================================================*/ /* External interface */
libibnetdisc/include/infiniband/ibnetdisc.h +5 -1
@@ -140,6 +140,9 @@ typedef struct ibnd_chassis {#define HTSZ 137 +/* define config flags */ +#define IBND_CONFIG_MLX_EPI (1 << 0) + typedef struct ibnd_config { unsigned max_smps; unsigned show_progress;
@@ -147,7 +150,8 @@ typedef struct ibnd_config {unsigned debug;unsigned timeout_ms;unsigned retries; -uint8_t pad[56 ]; +uint32_t flags; +uint8_t pad[52 ]; } ibnd_config_t;/** =========================================================================
libibnetdisc/src/ibnetdisc.c +4 -2
@@ -318,7 +318,8 @@ static int query_mlnx_ext_port_info(smp_engine_t * engine, ib_portid_t * portid,static int recv_port_info (smp_engine_t * engine,ibnd_smp_t * smp,uint8_t * mad,void *cb_data) { -ibnd_fabric_t *fabric = ((ibnd_scan_t *) engine->user_data)->fabric; +ibnd_scan_t *scan = (ibnd_scan_t *)engine->user_data; +ibnd_fabric_t *fabric = scan->fabric;ibnd_node_t *node = cb_data;ibnd_port_t *port;uint8_t *port_info = mad +IB_SMP_DATA_OFFS ;
@@ -360,7 +361,8 @@ static int recv_port_info(smp_engine_t * engine, ibnd_smp_t * smp,add_to_portguid_hash (port, fabric->portstbl); -if (is_mlnx_ext_port_info_supported (port)) { +if ((scan->cfg->flags &IBND_CONFIG_MLX_EPI ) + &&is_mlnx_ext_port_info_supported (port)) { phystate =mad_get_field (port->info,0 ,IB_PORT_PHYS_STATE_F ); ispeed =mad_get_field (port->info,0 ,IB_PORT_LINK_SPEED_ACTIVE_F );if (port->node->type ==IB_NODE_SWITCH )
man/infiniband-diags.8.in +9 -1
@@ -84,12 +84,20 @@ using "<util_name> -h". .PP \-V show the version info. +.TP +\fB# Configuration flags\fR +.PP +\-\-config \-z <config_file> + Specify alternate config file. + Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf + .SH FILES @IBDIAG_CONFIG_PATH@/ibdiag.conf A global config file is provided to set some of the common options for all -tools. +tools. See supplied config file for details. + .SH NODE NAME MAP FILE FORMAT Most utilities use the optional node name map file supported by libosmcomp to
src/ibdiag_common.c +66 -47
158 lines not on this page · raw message
src/iblinkinfo.c +2 -0
@@ -637,6 +637,8 @@ int main(int argc, char **argv) config.timeout_ms = ibd_timeout; } + config.flags = ibd_ibnetdisc_flags; + node_name_map =open_node_name_map (node_name_map_file);if (dr_path && load_cache_file) {
src/ibqueryerrors.c +2 -0
@@ -919,6 +919,8 @@ int main(int argc, char **argv) config.timeout_ms = ibd_timeout; } + config.flags = ibd_ibnetdisc_flags; + node_name_map =open_node_name_map (node_name_map_file);if (dr_path && load_cache_file) {
Signature · 6 lines
1.7.1 -- 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