aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRui Cai <rucai@microsoft.com>2018-05-11 23:38:41 +0000
committerDamjan Marion <dmarion@me.com>2018-06-07 14:35:51 +0000
commit041881b11a979d680b916fbfff04f8c664f8b0b0 (patch)
tree52c4f54a2403f33e59047d59c2c28f1f9e1b7dda /src
parentdaff1784037376f4a5caec2f5975f9b5fc23d5a4 (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')
-rw-r--r--src/plugins/dpdk/device/format.c2
-rw-r--r--src/plugins/dpdk/device/init.c25
2 files changed, 26 insertions, 1 deletions
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c
index 4b8e3be5240..546f6cf56aa 100644
--- a/src/plugins/dpdk/device/format.c
+++ b/src/plugins/dpdk/device/format.c
@@ -373,7 +373,7 @@ format_dpdk_device_type (u8 * s, va_list * args)
break;
case VNET_DPDK_PMD_FAILSAFE:
- dev_type = "Failsafe Ethernet";
+ dev_type = "FailsafeEthernet";
break;
case VNET_DPDK_PMD_LIOVF_ETHER:
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;