diff options
author | Rui Cai <rucai@microsoft.com> | 2018-05-11 23:38:41 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-06-07 14:35:51 +0000 |
commit | 041881b11a979d680b916fbfff04f8c664f8b0b0 (patch) | |
tree | 52c4f54a2403f33e59047d59c2c28f1f9e1b7dda /src/plugins/dpdk/device/init.c | |
parent | daff1784037376f4a5caec2f5975f9b5fc23d5a4 (diff) |
dpdk: failsafe PMD initialization code
Added code to initialize failsafe PMD
This is part of initial effort to enable vpp running over
dpdk on failsafe PMD in Microsoft Azure(4/4).
Change-Id: Ia2469c7087ca4b5c7881dfb11ec5c4fcebaa1d04
Signed-off-by: Rui Cai <rucai@microsoft.com>
Diffstat (limited to 'src/plugins/dpdk/device/init.c')
-rw-r--r-- | src/plugins/dpdk/device/init.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index 2232b89e1b3..5bdb493d086 100644 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -503,6 +503,11 @@ dpdk_lib_init (dpdk_main_t * dm) xd->port_type = VNET_DPDK_PORT_TYPE_ETH_VF; break; + case VNET_DPDK_PMD_FAILSAFE: + xd->port_type = VNET_DPDK_PORT_TYPE_FAILSAFE; + xd->port_conf.intr_conf.lsc = 1; + break; + default: xd->port_type = VNET_DPDK_PORT_TYPE_UNKNOWN; } @@ -632,6 +637,26 @@ dpdk_lib_init (dpdk_main_t * dm) } } } + + if (xd->pmd == VNET_DPDK_PMD_FAILSAFE) + { + /* failsafe device numerables are reported with active device only, + * need to query the mtu for current device setup to overwrite + * reported value. + */ + uint16_t dev_mtu; + if (!rte_eth_dev_get_mtu (i, &dev_mtu)) + { + mtu = dev_mtu; + max_rx_frame = mtu + sizeof (ethernet_header_t); + + if (xd->port_conf.rxmode.hw_strip_crc) + { + max_rx_frame += 4; + } + } + } + /*Set port rxmode config */ xd->port_conf.rxmode.max_rx_pkt_len = max_rx_frame; |