VNFs: rte_eth_dev is deprecated in DPDK version 16.11 and onwards 15/35515/4
authorAnand B Jyoti <anand.b.jyoti@intel.com>
Mon, 29 May 2017 22:04:44 +0000 (03:34 +0530)
committerAnand B Jyoti <anand.b.jyoti@intel.com>
Tue, 27 Jun 2017 03:28:58 +0000 (08:58 +0530)
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>
VNFs/vACL/init.c
VNFs/vCGNAPT/init.c
VNFs/vFW/init.c

index 6eb39bf..42a1e43 100644 (file)
@@ -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"
@@ -512,6 +513,8 @@ app_link_filter_sctp_del(struct app_link_params *l1, struct app_link_params *l2)
                &filter);
 }
 
+/* rte_eth_dev is removed in DPDK version 16.11 and onwards */
+#if RTE_VERSION < 0x100b0000
 static int
 app_link_is_virtual(struct app_link_params *p)
 {
@@ -523,6 +526,7 @@ app_link_is_virtual(struct app_link_params *p)
 
        return 0;
 }
+#endif
 
 void
 app_link_up_internal(struct app_params *app, struct app_link_params *cp)
@@ -534,13 +538,14 @@ app_link_up_internal(struct app_params *app, struct app_link_params *cp)
         if(app == NULL || cp == NULL)
                 printf("NULL Pointers");
 
+#if RTE_VERSION < 0x100b0000
        if (app_link_is_virtual(cp)) {
                cp->state = 1;
                return;
        }
-
+#endif
        ifm_update_linkstatus(cp->pmd_id, IFM_ETH_LINK_UP);
-        
+
         /* Mark link as UP */
         cp->state = 1;
 
@@ -555,11 +560,13 @@ app_link_down_internal(struct app_params *app, struct app_link_params *cp)
 
         if(app == NULL || cp == NULL)
                 printf("NULL Pointers");
-       
+
+#if RTE_VERSION < 0x100b0000
        if (app_link_is_virtual(cp)) {
                cp->state = 0;
                return;
        }
+#endif
 
        ifm_update_linkstatus(cp->pmd_id, IFM_ETH_LINK_DOWN);
 
index f4d4588..aa3868d 100644 (file)
@@ -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 */
index 5414377..979e105 100644 (file)
@@ -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"
@@ -536,6 +537,8 @@ app_link_filter_sctp_del(struct app_link_params *l1, struct app_link_params *l2)
                &filter);
 }
 
+/* rte_eth_dev is removed in DPDK version 16.11 and onwards */
+#if RTE_VERSION < 0x100b0000
 static int
 app_link_is_virtual(struct app_link_params *p)
 {
@@ -547,7 +550,7 @@ app_link_is_virtual(struct app_link_params *p)
 
         return 0;
 }
-
+#endif
 
 void
 app_link_up_internal(__rte_unused struct app_params *app,
@@ -556,11 +559,12 @@ app_link_up_internal(__rte_unused struct app_params *app,
        if(app == NULL || cp == NULL)
                printf("NULL Pointers");
 
+#if RTE_VERSION < 0x100b0000
         if (app_link_is_virtual(cp)) {
                 cp->state = 1;
                 return;
         }
-
+#endif
        ifm_update_linkstatus(cp->pmd_id, IFM_ETH_LINK_UP);
 
        /* Mark link as UP */
@@ -574,11 +578,12 @@ app_link_down_internal(__rte_unused struct app_params *app,
        if(app == NULL || cp == NULL)
                printf("NULL Pointers");
 
+#if RTE_VERSION < 0x100b0000
         if (app_link_is_virtual(cp)) {
                 cp->state = 0;
                 return;
         }
-
+#endif
        ifm_update_linkstatus(cp->pmd_id, IFM_ETH_LINK_DOWN);
        /* Mark link as DOWN */
        cp->state = 0;