summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-12-25 02:02:59 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2017-01-01 03:00:28 +0200
commit7b8fd5a8e29202f21edfcb4f463ff920a0464ddb (patch)
tree9324ba5a0c12f298073d24e192bf76e1cfad0cd7 /src
parenta56ae96bdbfe53894aad17192cd21d43c6e8a289 (diff)
Max number of ports: 16
Change-Id: I93e2efe542578b0745d2f40adb2bcf35ffdff31b Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/main_dpdk.cpp2
-rwxr-xr-xsrc/platform_cfg.cpp5
-rwxr-xr-xsrc/platform_cfg.h1
-rw-r--r--src/trex_defs.h2
4 files changed, 8 insertions, 2 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index 9cc0e612..4e921954 100644
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -122,7 +122,7 @@ static inline int get_is_rx_thread_enabled() {
struct port_cfg_t;
-#define MAX_DPDK_ARGS 40
+#define MAX_DPDK_ARGS 50
static CPlatformYamlInfo global_platform_cfg_info;
static int global_dpdk_args_num ;
static char * global_dpdk_args[MAX_DPDK_ARGS];
diff --git a/src/platform_cfg.cpp b/src/platform_cfg.cpp
index 575c4c72..6aae450b 100755
--- a/src/platform_cfg.cpp
+++ b/src/platform_cfg.cpp
@@ -344,6 +344,11 @@ void operator >> (const YAML::Node& node, CPlatformYamlInfo & plat_info) {
/* must have interfaces */
const YAML::Node& interfaces = node["interfaces"];
+ if ( interfaces.size() > TREX_MAX_PORTS ) {
+ printf("ERROR: Maximal number of interfaces is: %d, and you have specified: %d.\n",
+ TREX_MAX_PORTS, (int) interfaces.size());
+ exit(-1);
+ }
for(unsigned i=0;i<interfaces.size();i++) {
std::string fi;
const YAML::Node & node = interfaces;
diff --git a/src/platform_cfg.h b/src/platform_cfg.h
index c839bd96..b921c9c7 100755
--- a/src/platform_cfg.h
+++ b/src/platform_cfg.h
@@ -28,6 +28,7 @@ limitations under the License.
#include <vector>
#include <string>
#include "tw_cfg.h"
+#include "trex_defs.h"
#define CONST_NB_MBUF_2_10G (16380/2)
diff --git a/src/trex_defs.h b/src/trex_defs.h
index 8a4bf664..60a60df9 100644
--- a/src/trex_defs.h
+++ b/src/trex_defs.h
@@ -21,7 +21,7 @@ limitations under the License.
#ifndef __TREX_DEFS_H__
#define __TREX_DEFS_H__
-#define TREX_MAX_PORTS 12
+#define TREX_MAX_PORTS 16
// maximum number of IP ID type flow stats we support
#define MAX_FLOW_STATS 127