summaryrefslogtreecommitdiffstats
path: root/examples/ip_pipeline/init.c
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2017-03-02 16:15:51 +0100
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2017-03-03 14:41:36 +0100
commitce3d555e43e3795b5d9507fcfc76b7a0a92fd0d6 (patch)
tree3a9e9f8f6a62c7146fb391eae34481b2af4f7ff2 /examples/ip_pipeline/init.c
parent6b3e017e5d25f15da73f7700f7f2ac553ef1a2e9 (diff)
Imported Upstream version 16.11.1
Change-Id: I1e965265578efaaf08e5628607f53d2386d2df9f Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'examples/ip_pipeline/init.c')
-rw-r--r--examples/ip_pipeline/init.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c
index 3b36b53a..d46bd365 100644
--- a/examples/ip_pipeline/init.c
+++ b/examples/ip_pipeline/init.c
@@ -78,11 +78,14 @@ app_init_core_map(struct app_params *app)
cpu_core_map_print(app->core_map);
}
+/* Core Mask String in Hex Representation */
+#define APP_CORE_MASK_STRING_SIZE ((64 * APP_CORE_MASK_SIZE) / 8 * 2 + 1)
+
static void
app_init_core_mask(struct app_params *app)
{
- uint64_t mask = 0;
uint32_t i;
+ char core_mask_str[APP_CORE_MASK_STRING_SIZE];
for (i = 0; i < app->n_pipelines; i++) {
struct app_pipeline_params *p = &app->pipeline_params[i];
@@ -96,17 +99,18 @@ app_init_core_mask(struct app_params *app)
if (lcore_id < 0)
rte_panic("Cannot create CPU core mask\n");
- mask |= 1LLU << lcore_id;
+ app_core_enable_in_core_mask(app, lcore_id);
}
- app->core_mask = mask;
- APP_LOG(app, HIGH, "CPU core mask = 0x%016" PRIx64, app->core_mask);
+ app_core_build_core_mask_string(app, core_mask_str);
+ APP_LOG(app, HIGH, "CPU core mask = 0x%s", core_mask_str);
}
static void
app_init_eal(struct app_params *app)
{
char buffer[256];
+ char core_mask_str[APP_CORE_MASK_STRING_SIZE];
struct app_eal_params *p = &app->eal_params;
uint32_t n_args = 0;
uint32_t i;
@@ -114,7 +118,8 @@ app_init_eal(struct app_params *app)
app->eal_argv[n_args++] = strdup(app->app_name);
- snprintf(buffer, sizeof(buffer), "-c%" PRIx64, app->core_mask);
+ app_core_build_core_mask_string(app, core_mask_str);
+ snprintf(buffer, sizeof(buffer), "-c%s", core_mask_str);
app->eal_argv[n_args++] = strdup(buffer);
if (p->coremap) {