Code Review
/
deb_dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Imported Upstream version 16.11.1
[deb_dpdk.git]
/
examples
/
ip_pipeline
/
thread_fe.c
diff --git
a/examples/ip_pipeline/thread_fe.c
b/examples/ip_pipeline/thread_fe.c
index
4a435f7
..
4590c2b
100644
(file)
--- a/
examples/ip_pipeline/thread_fe.c
+++ b/
examples/ip_pipeline/thread_fe.c
@@
-5,10
+5,6
@@
#include <cmdline_parse.h>
#include <cmdline_parse_num.h>
#include <cmdline_parse_string.h>
#include <cmdline_parse.h>
#include <cmdline_parse_num.h>
#include <cmdline_parse_string.h>
-#include <cmdline_parse_ipaddr.h>
-#include <cmdline_parse_etheraddr.h>
-#include <cmdline_socket.h>
-#include <cmdline.h>
#include "thread.h"
#include "thread_fe.h"
#include "thread.h"
#include "thread_fe.h"
@@
-74,8
+70,7
@@
app_pipeline_enable(struct app_params *app,
core_id,
hyper_th_id);
core_id,
hyper_th_id);
- if ((thread_id < 0) ||
- ((app->core_mask & (1LLU << thread_id)) == 0))
+ if ((thread_id < 0) || !app_core_is_enabled(app, thread_id))
return -1;
if (app_pipeline_data(app, pipeline_id) == NULL)
return -1;
if (app_pipeline_data(app, pipeline_id) == NULL)
@@
-85,6
+80,9
@@
app_pipeline_enable(struct app_params *app,
p_params = &app->pipeline_params[pipeline_id];
p_type = app_pipeline_type_find(app, p_params->type);
p_params = &app->pipeline_params[pipeline_id];
p_type = app_pipeline_type_find(app, p_params->type);
+ if (p_type == NULL)
+ return -1;
+
if (p->enabled == 1)
return -1;
if (p->enabled == 1)
return -1;
@@
-135,8
+133,7
@@
app_pipeline_disable(struct app_params *app,
core_id,
hyper_th_id);
core_id,
hyper_th_id);
- if ((thread_id < 0) ||
- ((app->core_mask & (1LLU << thread_id)) == 0))
+ if ((thread_id < 0) || !app_core_is_enabled(app, thread_id))
return -1;
if (app_pipeline_data(app, pipeline_id) == NULL)
return -1;
if (app_pipeline_data(app, pipeline_id) == NULL)
@@
-189,8
+186,7
@@
app_thread_headroom(struct app_params *app,
core_id,
hyper_th_id);
core_id,
hyper_th_id);
- if ((thread_id < 0) ||
- ((app->core_mask & (1LLU << thread_id)) == 0))
+ if ((thread_id < 0) || !app_core_is_enabled(app, thread_id))
return -1;
req = app_msg_alloc(app);
return -1;
req = app_msg_alloc(app);
@@
-259,26
+255,26
@@
cmd_pipeline_enable_parsed(
printf("Command failed\n");
}
printf("Command failed\n");
}
-cmdline_parse_token_string_t cmd_pipeline_enable_t_string =
+
static
cmdline_parse_token_string_t cmd_pipeline_enable_t_string =
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_enable_result, t_string, "t");
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_enable_result, t_string, "t");
-cmdline_parse_token_string_t cmd_pipeline_enable_t_id_string =
+
static
cmdline_parse_token_string_t cmd_pipeline_enable_t_id_string =
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_enable_result, t_id_string,
NULL);
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_enable_result, t_id_string,
NULL);
-cmdline_parse_token_string_t cmd_pipeline_enable_pipeline_string =
+
static
cmdline_parse_token_string_t cmd_pipeline_enable_pipeline_string =
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_enable_result, pipeline_string,
"pipeline");
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_enable_result, pipeline_string,
"pipeline");
-cmdline_parse_token_num_t cmd_pipeline_enable_pipeline_id =
+
static
cmdline_parse_token_num_t cmd_pipeline_enable_pipeline_id =
TOKEN_NUM_INITIALIZER(struct cmd_pipeline_enable_result, pipeline_id,
UINT32);
TOKEN_NUM_INITIALIZER(struct cmd_pipeline_enable_result, pipeline_id,
UINT32);
-cmdline_parse_token_string_t cmd_pipeline_enable_enable_string =
+
static
cmdline_parse_token_string_t cmd_pipeline_enable_enable_string =
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_enable_result, enable_string,
"enable");
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_enable_result, enable_string,
"enable");
-cmdline_parse_inst_t cmd_pipeline_enable = {
+
static
cmdline_parse_inst_t cmd_pipeline_enable = {
.f = cmd_pipeline_enable_parsed,
.data = NULL,
.help_str = "Enable pipeline on specified core",
.f = cmd_pipeline_enable_parsed,
.data = NULL,
.help_str = "Enable pipeline on specified core",
@@
-333,26
+329,26
@@
cmd_pipeline_disable_parsed(
printf("Command failed\n");
}
printf("Command failed\n");
}
-cmdline_parse_token_string_t cmd_pipeline_disable_t_string =
+
static
cmdline_parse_token_string_t cmd_pipeline_disable_t_string =
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_disable_result, t_string, "t");
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_disable_result, t_string, "t");
-cmdline_parse_token_string_t cmd_pipeline_disable_t_id_string =
+
static
cmdline_parse_token_string_t cmd_pipeline_disable_t_id_string =
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_disable_result, t_id_string,
NULL);
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_disable_result, t_id_string,
NULL);
-cmdline_parse_token_string_t cmd_pipeline_disable_pipeline_string =
+
static
cmdline_parse_token_string_t cmd_pipeline_disable_pipeline_string =
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_disable_result,
pipeline_string, "pipeline");
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_disable_result,
pipeline_string, "pipeline");
-cmdline_parse_token_num_t cmd_pipeline_disable_pipeline_id =
+
static
cmdline_parse_token_num_t cmd_pipeline_disable_pipeline_id =
TOKEN_NUM_INITIALIZER(struct cmd_pipeline_disable_result, pipeline_id,
UINT32);
TOKEN_NUM_INITIALIZER(struct cmd_pipeline_disable_result, pipeline_id,
UINT32);
-cmdline_parse_token_string_t cmd_pipeline_disable_disable_string =
+
static
cmdline_parse_token_string_t cmd_pipeline_disable_disable_string =
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_disable_result, disable_string,
"disable");
TOKEN_STRING_INITIALIZER(struct cmd_pipeline_disable_result, disable_string,
"disable");
-cmdline_parse_inst_t cmd_pipeline_disable = {
+
static
cmdline_parse_inst_t cmd_pipeline_disable = {
.f = cmd_pipeline_disable_parsed,
.data = NULL,
.help_str = "Disable pipeline on specified core",
.f = cmd_pipeline_disable_parsed,
.data = NULL,
.help_str = "Disable pipeline on specified core",
@@
-405,19
+401,19
@@
cmd_thread_headroom_parsed(
printf("Command failed\n");
}
printf("Command failed\n");
}
-cmdline_parse_token_string_t cmd_thread_headroom_t_string =
+
static
cmdline_parse_token_string_t cmd_thread_headroom_t_string =
TOKEN_STRING_INITIALIZER(struct cmd_thread_headroom_result,
t_string, "t");
TOKEN_STRING_INITIALIZER(struct cmd_thread_headroom_result,
t_string, "t");
-cmdline_parse_token_string_t cmd_thread_headroom_t_id_string =
+
static
cmdline_parse_token_string_t cmd_thread_headroom_t_id_string =
TOKEN_STRING_INITIALIZER(struct cmd_thread_headroom_result,
t_id_string, NULL);
TOKEN_STRING_INITIALIZER(struct cmd_thread_headroom_result,
t_id_string, NULL);
-cmdline_parse_token_string_t cmd_thread_headroom_headroom_string =
+
static
cmdline_parse_token_string_t cmd_thread_headroom_headroom_string =
TOKEN_STRING_INITIALIZER(struct cmd_thread_headroom_result,
headroom_string, "headroom");
TOKEN_STRING_INITIALIZER(struct cmd_thread_headroom_result,
headroom_string, "headroom");
-cmdline_parse_inst_t cmd_thread_headroom = {
+
static
cmdline_parse_inst_t cmd_thread_headroom = {
.f = cmd_thread_headroom_parsed,
.data = NULL,
.help_str = "Display thread headroom",
.f = cmd_thread_headroom_parsed,
.data = NULL,
.help_str = "Display thread headroom",