#include <rte_ip.h>
#include <rte_eal.h>
#include <rte_malloc.h>
+#include <rte_version.h>
#include "app.h"
#include "pipeline.h"
&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)
{
return 0;
}
+#endif
void
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;
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);
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;
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);
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;
}