aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Kiss <zoltan.kiss@linaro.org>2016-06-07 14:54:53 +0100
committerZoltan Kiss <zoltan.kiss@linaro.org>2016-06-07 16:59:30 +0100
commit098e814f82c3781f17443e85d00e3823aa848b9c (patch)
treeea69ed77192dd9ef33c259e4c89ddec61c591fd5
parentb8ae1737876d5eaef6e498fda332580e38f28df9 (diff)
downloadodp-ovs-098e814f82c3781f17443e85d00e3823aa848b9c.tar.gz
netdev-odp: use new init API
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
-rw-r--r--acinclude.m43
-rw-r--r--lib/dpif-netdev.c2
-rw-r--r--lib/netdev-odp.c5
-rw-r--r--lib/netdev-odp.h1
-rw-r--r--ofproto/ofproto-dpif-upcall.c2
5 files changed, 8 insertions, 5 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 3fd9a0e44..83f788ca3 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -366,7 +366,8 @@ AC_DEFUN([OVS_CHECK_ODP], [
LIBS="$ODP_LIB $extras $save_LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <odp.h>],
- [odp_init_global(NULL, NULL);])],
+ [odp_instance_t instance;],
+ [odp_init_global(&instance, NULL, NULL);])],
[found=true])
if $found; then
break
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 570532829..0fb37a656 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -2674,7 +2674,7 @@ reload:
* reloading the updated configuration. */
dp_netdev_pmd_reload_done(pmd);
#ifdef ODP_NETDEV
- if (odp_init_local(ODP_THREAD_WORKER)) {
+ if (odp_init_local(odp_instance, ODP_THREAD_WORKER)) {
ovs_abort(-1, "ODP init local failed\n");
}
#endif
diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
index fc09b707d..576038836 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c
@@ -59,6 +59,7 @@ static odp_pool_t struct_pool;
int odp_initialized = 0;
const odp_platform_init_t *platform_params = NULL;
+odp_instance_t odp_instance;
struct netdev_odp {
struct netdev up;
@@ -110,12 +111,12 @@ odp_init()
params.log_fn = &odp_override_log;
params.abort_fn = &odp_abort;
- result = odp_init_global(&params, platform_params);
+ result = odp_init_global(&odp_instance, &params, platform_params);
if (result)
ovs_abort(result, "Error: ODP global init failed\n");
/* Init this thread */
- result = odp_init_local(ODP_THREAD_CONTROL);
+ result = odp_init_local(odp_instance, ODP_THREAD_CONTROL);
if (result)
ovs_abort(result, "Error: ODP local init failed.\n");
}
diff --git a/lib/netdev-odp.h b/lib/netdev-odp.h
index ce2079adf..8f5aa00e7 100644
--- a/lib/netdev-odp.h
+++ b/lib/netdev-odp.h
@@ -11,6 +11,7 @@ extern int odp_initialized;
#include <odp/helper/ip.h>
extern const odp_platform_init_t *platform_params;
+extern odp_instance_t odp_instance;
/* This function is not exported, we need another way to deal with
creating a packet from an dp_packet */
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 621e9fffe..85dd4805e 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -819,7 +819,7 @@ udpif_revalidator(void *arg)
revalidator->id = ovsthread_id_self();
#ifdef ODP_NETDEV
- if (odp_initialized && odp_init_local(ODP_THREAD_WORKER)) {
+ if (odp_initialized && odp_init_local(odp_instance, ODP_THREAD_WORKER)) {
ovs_abort(-1, "ODP init local failed\n");
}
#endif