[v10,5/5] kni: modify IOVA mode checks to support VA
Checks
Commit Message
From: Vamsi Attunuru <vattunuru@marvell.com>
Patch addresses checks in KNI and eal that enforce IOVA=PA when
IOVA=VA mode is enabled, since KNI kernel module supports VA
mode for kernel versions >= 4.4.0.
Updated KNI documentation with above details.
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
---
doc/guides/prog_guide/kernel_nic_interface.rst | 8 ++++++++
lib/librte_eal/linux/eal/eal.c | 4 +++-
lib/librte_kni/rte_kni.c | 5 -----
3 files changed, 11 insertions(+), 6 deletions(-)
@@ -291,6 +291,14 @@ The sk_buff is then freed and the mbuf sent in the tx_q FIFO.
The DPDK TX thread dequeues the mbuf and sends it to the PMD via ``rte_eth_tx_burst()``.
It then puts the mbuf back in the cache.
+IOVA = VA: Support
+------------------
+
+KNI can be operated in IOVA as VA scheme when following criteria are fullfilled
+
+- LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
+- eal param `--iova-mode va` is passed or bus IOVA scheme is set to RTE_IOVA_VA
+
Ethtool
-------
@@ -1114,12 +1114,14 @@ rte_eal_init(int argc, char **argv)
/* Workaround for KNI which requires physical address to work */
if (iova_mode == RTE_IOVA_VA &&
rte_eal_check_module("rte_kni") == 1) {
+#if KERNEL_VERSION(4, 4, 0) > LINUX_VERSION_CODE
if (phys_addrs) {
iova_mode = RTE_IOVA_PA;
- RTE_LOG(WARNING, EAL, "Forcing IOVA as 'PA' because KNI module is loaded\n");
+ RTE_LOG(WARNING, EAL, "Forcing IOVA as 'PA' because KNI module does not support VA\n");
} else {
RTE_LOG(DEBUG, EAL, "KNI can not work since physical addresses are unavailable\n");
}
+#endif
}
#endif
rte_eal_get_configuration()->iova_mode = iova_mode;
@@ -99,11 +99,6 @@ static volatile int kni_fd = -1;
int
rte_kni_init(unsigned int max_kni_ifaces __rte_unused)
{
- if (rte_eal_iova_mode() != RTE_IOVA_PA) {
- RTE_LOG(ERR, KNI, "KNI requires IOVA as PA\n");
- return -1;
- }
-
/* Check FD and open */
if (kni_fd < 0) {
kni_fd = open("/dev/" KNI_DEVICE, O_RDWR);