summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/bp_sim.h8
-rw-r--r--src/main_dpdk.cpp13
2 files changed, 21 insertions, 0 deletions
diff --git a/src/bp_sim.h b/src/bp_sim.h
index 24681d4b..d8f620ed 100755
--- a/src/bp_sim.h
+++ b/src/bp_sim.h
@@ -654,6 +654,14 @@ public:
return (btGetMaskBit32(m_flags1, 11, 11) ? true : false);
}
+ void set_mlx4_so_mode(bool enable) {
+ btSetMaskBit32(m_flags1, 12, 12, (enable ? 1 : 0) );
+ }
+
+ bool get_mlx4_so_mode() {
+ return (btGetMaskBit32(m_flags1, 12, 12) ? true : false);
+ }
+
public:
void Dump(FILE *fd);
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index 89c6b654..ecd1ca96 100644
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -121,6 +121,7 @@ static char global_prefix_str[100];
static char global_loglevel_str[20];
static char global_master_id_str[10];
static char global_mlx5_so_id_str[50];
+static char global_mlx4_so_id_str[50];
static char global_image_postfix[10];
#define TREX_NAME "_t-rex-64"
@@ -730,6 +731,7 @@ enum { OPT_HELP,
OPT_NO_SCAPY_SERVER,
OPT_ACTIVE_FLOW,
OPT_RT,
+ OPT_MLX4_SO,
OPT_MLX5_SO
};
@@ -790,6 +792,7 @@ static CSimpleOpt::SOption parser_options[] =
{ OPT_CHECKSUM_OFFLOAD, "--checksum-offload", SO_NONE },
{ OPT_ACTIVE_FLOW, "--active-flows", SO_REQ_SEP },
{ OPT_MLX5_SO, "--mlx5-so", SO_NONE },
+ { OPT_MLX4_SO, "--mlx4-so", SO_NONE },
{ OPT_CLOSE, "--close-at-end", SO_NONE },
{ OPT_ARP_REF_PER, "--arp-refresh-period", SO_REQ_SEP },
{ OPT_NO_OFED_CHECK, "--no-ofed-check", SO_NONE },
@@ -987,6 +990,10 @@ static int parse_options(int argc, char *argv[], CParserOption* po, bool first_t
po->preview.set_mlx5_so_mode(true);
break;
+ case OPT_MLX4_SO:
+ po->preview.set_mlx4_so_mode(true);
+ break;
+
case OPT_LEARN :
po->m_learn_mode = CParserOption::LEARN_MODE_IP_OPTION;
break;
@@ -5566,6 +5573,12 @@ int update_dpdk_args(void){
global_dpdk_args[global_dpdk_args_num++]=(char *)global_mlx5_so_id_str;
}
+ if ( CGlobalInfo::m_options.preview.get_mlx4_so_mode() ){
+ global_dpdk_args[global_dpdk_args_num++]=(char *)"-d";
+ snprintf(global_mlx4_so_id_str, sizeof(global_mlx4_so_id_str), "libmlx4-64%s.so",global_image_postfix );
+ global_dpdk_args[global_dpdk_args_num++]=(char *)global_mlx4_so_id_str;
+ }
+
global_dpdk_args[global_dpdk_args_num++]=(char *)"-c";
global_dpdk_args[global_dpdk_args_num++]=(char *)global_cores_str;
global_dpdk_args[global_dpdk_args_num++]=(char *)"-n";