aboutsummaryrefslogtreecommitdiffstats
path: root/examples/ip_pipeline/parser.c
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2018-08-14 18:52:30 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2018-08-14 18:53:17 +0100
commitb63264c8342e6a1b6971c79550d2af2024b6a4de (patch)
tree83114aac64286fe616506c0b3dfaec2ab86ef835 /examples/ip_pipeline/parser.c
parentca33590b6af032bff57d9cc70455660466a654b2 (diff)
New upstream version 18.08upstream/18.08
Change-Id: I32fdf5e5016556d9c0a6d88ddaf1fc468961790a Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'examples/ip_pipeline/parser.c')
-rw-r--r--examples/ip_pipeline/parser.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/examples/ip_pipeline/parser.c b/examples/ip_pipeline/parser.c
index 0901e9c6..ffcdeb3a 100644
--- a/examples/ip_pipeline/parser.c
+++ b/examples/ip_pipeline/parser.c
@@ -36,10 +36,8 @@
#include <sys/wait.h>
#include <rte_errno.h>
-#include <rte_cfgfile.h>
#include <rte_string_fns.h>
-#include "app.h"
#include "parser.h"
static uint32_t
@@ -596,10 +594,8 @@ parse_mac_addr(const char *token, struct ether_addr *addr)
}
int
-parse_pipeline_core(uint32_t *socket,
- uint32_t *core,
- uint32_t *ht,
- const char *entry)
+parse_cpu_core(const char *entry,
+ struct cpu_core_params *p)
{
size_t num_len;
char num[8];
@@ -609,6 +605,9 @@ parse_pipeline_core(uint32_t *socket,
const char *next = skip_white_spaces(entry);
char type;
+ if (p == NULL)
+ return -EINVAL;
+
/* Expect <CORE> or [sX][cY][h]. At least one parameter is required. */
while (*next != '\0') {
/* If everything parsed nothing should left */
@@ -682,8 +681,8 @@ parse_pipeline_core(uint32_t *socket,
}
}
- *socket = s;
- *core = c;
- *ht = h;
+ p->socket_id = s;
+ p->core_id = c;
+ p->thread_id = h;
return 0;
}