X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=VNFs%2FvACL%2Finit.c;h=dda6277e8415a40d597c7582bed8fa5e572ac41e;hb=98b9571f6720a0da06b1d430e7338a0734023232;hp=e85dc297b86e1e98455c72148581220c199e7a6a;hpb=8a4e9e534fcb1ef718ed5c1089fdc8698b13fb7f;p=samplevnf.git diff --git a/VNFs/vACL/init.c b/VNFs/vACL/init.c index e85dc297..dda6277e 100644 --- a/VNFs/vACL/init.c +++ b/VNFs/vACL/init.c @@ -24,6 +24,7 @@ #include #include #include +#include #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); @@ -699,11 +706,12 @@ 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; - } 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 */ p_link->conf.rxmode.hw_strip_crc = 1; @@ -733,11 +741,15 @@ app_init_link(struct app_params *app) port_config[i].tx_conf.txq_flags &= ~(ETH_TXQ_FLAGS_NOXSUMTCP|ETH_TXQ_FLAGS_NOXSUMUDP); } - - if (ifm_port_setup (p_link->pmd_id, &port_config[i])) { - rte_panic ("Port Setup Failed: %s - %"PRIu32"\n", - p_link->name, p_link->pmd_id); - } + if (ifm_port_setup(p_link->pmd_id, &port_config[i])) { + printf("Failed to configure port %s - %"PRIu32 + ".\n", p_link->name, p_link->pmd_id); + printf("Try again with offload disabled....\n"); + port_config[i].tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOOFFLOADS; + if (ifm_port_setup (p_link->pmd_id, &port_config[i])) + rte_panic("Port Setup Failed: %s - %" PRIu32 + "\n", p_link->name, p_link->pmd_id); + } /* LINK UP */ app_link_up_internal(app, p_link); @@ -1288,11 +1300,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; }