summaryrefslogtreecommitdiffstats
path: root/VNFs/vCGNAPT
diff options
context:
space:
mode:
authorAnand B Jyoti <anand.b.jyoti@intel.com>2017-05-30 03:34:44 +0530
committerAnand B Jyoti <anand.b.jyoti@intel.com>2017-06-27 08:58:58 +0530
commita25ebbda95517a2eddb1c8291c258e8e4f167af7 (patch)
tree40b411fc6cd42f2b77ca284fef41e69c40ccfc03 /VNFs/vCGNAPT
parentb8351286a53658bee2471430aaafac4eb72bdfde (diff)
VNFs: rte_eth_dev is deprecated in DPDK version 16.11 and onwards
JIRA: SAMPLEVNF-17 rte_eth_dev is removed in DPDK version 16.11 and onwards. The corresponding error handling is fixed through samplevnf gerrit 34667. This patch is required for migration of VNFs to DPDK ver 17.05. Change-Id: I088b705e3261227bcba7332aeb5a2a236e77a33e Signed-off-by: Anand B Jyoti <anand.b.jyoti@intel.com>
Diffstat (limited to 'VNFs/vCGNAPT')
-rw-r--r--VNFs/vCGNAPT/init.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/VNFs/vCGNAPT/init.c b/VNFs/vCGNAPT/init.c
index f4d4588b..aa3868d8 100644
--- a/VNFs/vCGNAPT/init.c
+++ b/VNFs/vCGNAPT/init.c
@@ -24,6 +24,7 @@
#include <rte_ip.h>
#include <rte_eal.h>
#include <rte_malloc.h>
+#include <rte_version.h>
#include "app.h"
#include "pipeline.h"
@@ -600,6 +601,8 @@ app_link_set_tcp_syn_filter(struct app_params *app, struct app_link_params *cp)
}
}
+/* rte_eth_dev is removed in DPDK version 16.11 and onwards */
+#if RTE_VERSION < 0x100b0000
static int
app_link_is_virtual(__rte_unused struct app_link_params *p)
{
@@ -611,6 +614,8 @@ app_link_is_virtual(__rte_unused struct app_link_params *p)
}
#endif
+#endif
+
void
app_link_up_internal(__rte_unused struct app_params *app, struct app_link_params *cp)
{
@@ -619,11 +624,12 @@ app_link_up_internal(__rte_unused struct app_params *app, struct app_link_params
int status;
struct rte_eth_link link;
+#if RTE_VERSION < 0x100b0000
if (app_link_is_virtual(cp)) {
cp->state = 1;
return;
}
-
+#endif
/* For each link, add filters for IP of current link */
if (cp->ip != 0) {
@@ -739,10 +745,13 @@ app_link_down_internal(__rte_unused struct app_params *app, struct app_link_para
int status;
struct rte_eth_link link;
+#if RTE_VERSION < 0x100b0000
if (app_link_is_virtual(cp)) {
cp->state = 0;
return;
}
+#endif
+
rte_eth_link_get(cp->pmd_id, &link);
if (link.link_status) {
/* PMD link down */