Moving the current docs to userguide
[samplevnf.git] / VNFs / vCGNAPT / init.c
index f4d4588..76621d5 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 */
@@ -984,16 +993,11 @@ app_init_link(struct app_params *app)
                        My_local_conf->rxmode.mq_mode = ETH_MQ_RX_RSS;
                        My_local_conf->rx_adv_conf.rss_conf.rss_key = NULL;
                        My_local_conf->rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP;
-                       //My_local_conf->rx_adv_conf.rss_conf.rss_hf |= ETH_RSS_UDP;
-                       //My_local_conf->rx_adv_conf.rss_conf.rss_hf |= ETH_RSS_IP;
-                       // My_local_conf->rx_adv_conf.rss_conf.rss_hf = ETH_RSS_TCP;
-               }
-               //#else /*for FDIR Filter*/
-               else
-               {/* disable-rss */
-                       My_local_conf->rx_adv_conf.rss_conf.rss_hf = 0;
                        /* pkt-filter-mode is perfect */
                        My_local_conf->fdir_conf.mode = RTE_FDIR_MODE_PERFECT;
+               } else {
+                       /* disable-rss */
+                       My_local_conf->rx_adv_conf.rss_conf.rss_hf = 0;
                }
 
                 /* Set the hardware CRC stripping to avoid double stripping of FCS in VM */
@@ -1720,11 +1724,13 @@ int app_init(struct app_params *app)
        app_init_pipelines(app);
        app_init_threads(app);
 
+       #ifdef L3_STACK_SUPPORT
         l3fwd_init();
         create_arp_table();
         create_nd_table();
         populate_lpm_routes();
         print_interface_details();
+       #endif
 
        return 0;
 }