summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFerruh Yigit <ferruh.yigit@intel.com>2016-06-01 18:30:01 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2016-07-27 13:50:48 +0100
commitffabd5ce06a43050120f3a5ccd0f5aa9fbc415c0 (patch)
treecb4e65d6026f0f92ee84066cc51490682c2fcdab
parentc52c9f9e9a054c13a39d6c4960a68c401ec2914e (diff)
downloadspp-ffabd5ce06a43050120f3a5ccd0f5aa9fbc415c0.zip
spp-ffabd5ce06a43050120f3a5ccd0f5aa9fbc415c0.tar.gz
spp-ffabd5ce06a43050120f3a5ccd0f5aa9fbc415c0.tar.xz
spp_vm: replace num_clients with client_id
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Sy Jong Choi <sy.jong.choi@intel.com>
-rw-r--r--examples/multi_process/patch_panel/vm/args.c8
-rw-r--r--examples/multi_process/patch_panel/vm/args.h2
-rw-r--r--examples/multi_process/patch_panel/vm/init.c6
-rw-r--r--examples/multi_process/patch_panel/vm/main.c2
4 files changed, 9 insertions, 9 deletions
diff --git a/examples/multi_process/patch_panel/vm/args.c b/examples/multi_process/patch_panel/vm/args.c
index d67af9f..dc11d77 100644
--- a/examples/multi_process/patch_panel/vm/args.c
+++ b/examples/multi_process/patch_panel/vm/args.c
@@ -40,7 +40,7 @@
#include "init.h"
/* global var for number of clients - extern in header */
-uint8_t num_clients;
+uint8_t client_id;
char *server_ip;
int server_port;
@@ -53,9 +53,9 @@ static void
usage(void)
{
RTE_LOG(INFO, APP,
- "%s [EAL options] -- -p PORTMASK -n NUM_CLIENTS [-s NUM_SOCKETS]\n"
+ "%s [EAL options] -- -p PORTMASK -n CLIENT_ID [-s NUM_SOCKETS]\n"
" -p PORTMASK: hexadecimal bitmask of ports to use\n"
- " -n NUM_CLIENTS: number of client processes to use\n"
+ " -n CLIENT_ID: the requested if of current client\n"
, progname);
}
@@ -85,7 +85,7 @@ parse_app_args(uint8_t max_ports, int argc, char *argv[])
}
break;
case 'n':
- if (parse_num_clients(&num_clients, optarg) != 0) {
+ if (parse_num_clients(&client_id, optarg) != 0) {
usage();
return -1;
}
diff --git a/examples/multi_process/patch_panel/vm/args.h b/examples/multi_process/patch_panel/vm/args.h
index 73e1f82..ecaebd2 100644
--- a/examples/multi_process/patch_panel/vm/args.h
+++ b/examples/multi_process/patch_panel/vm/args.h
@@ -36,7 +36,7 @@
#include <stdint.h>
-extern uint8_t num_clients;
+extern uint8_t client_id;
extern char *server_ip;
extern int server_port;
diff --git a/examples/multi_process/patch_panel/vm/init.c b/examples/multi_process/patch_panel/vm/init.c
index 9d8a5f9..40b0ffe 100644
--- a/examples/multi_process/patch_panel/vm/init.c
+++ b/examples/multi_process/patch_panel/vm/init.c
@@ -54,8 +54,10 @@ struct port_info *ports;
static int
init_mbuf_pools(int total_ports)
{
- const unsigned int num_mbufs = (num_clients * MBUFS_PER_CLIENT)
- + (total_ports * MBUFS_PER_PORT);
+ const unsigned int num_mbufs = total_ports * MBUFS_PER_PORT;
+
+ if (num_mbufs == 0)
+ return 0;
/*
* don't pass single-producer/single-consumer flags to mbuf create as
diff --git a/examples/multi_process/patch_panel/vm/main.c b/examples/multi_process/patch_panel/vm/main.c
index da0d73e..a1c4fac 100644
--- a/examples/multi_process/patch_panel/vm/main.c
+++ b/examples/multi_process/patch_panel/vm/main.c
@@ -49,8 +49,6 @@ static struct port_map port_map[RTE_MAX_ETHPORTS];
static struct port ports_fwd_array[RTE_MAX_ETHPORTS];
-static uint8_t client_id;
-
static void
forward(void)
{