This kernel module is based on KNI module, but this one is stripped
version of it and only for control messages, no data transfer
functionality provided.
This Linux kernel module helps userspace application create virtual
interfaces and when a control command issued into that virtual
interface, module pushes the command to the userspace and gets the
response back for the caller application.
The Linux tools like ethtool/ifconfig/ip can be used on virtual
interfaces but not ones for related data, like tcpdump.
In long term this patch intends to replace the KNI and KNI will be
depreciated.
Signed-off-by: Ferruh Yigit
---
v3:
* Devices are not up by default
* Add enable/disable promisc, allmulti support
* Increase timeout to 500ms and print log when a command timedout
v2:
* Use rtnetlink to create interfaces
* Fix ethtool get/set eeprom
* Remove commented out code
---
MAINTAINERS| 4 +
config/common_linuxapp | 6 +
lib/librte_eal/linuxapp/Makefile | 5 +-
lib/librte_eal/linuxapp/eal/Makefile | 3 +-
.../linuxapp/eal/include/exec-env/rte_kcp_common.h | 109
lib/librte_eal/linuxapp/kcp/Makefile | 57
lib/librte_eal/linuxapp/kcp/kcp_dev.h | 54
lib/librte_eal/linuxapp/kcp/kcp_ethtool.c | 300 +
lib/librte_eal/linuxapp/kcp/kcp_net.c | 225
lib/librte_eal/linuxapp/kcp/kcp_nl.c | 215 +++
10 files changed, 976 insertions(+), 2 deletions(-)
create mode 100644
lib/librte_eal/linuxapp/eal/include/exec-env/rte_kcp_common.h
create mode 100644 lib/librte_eal/linuxapp/kcp/Makefile
create mode 100644 lib/librte_eal/linuxapp/kcp/kcp_dev.h
create mode 100644 lib/librte_eal/linuxapp/kcp/kcp_ethtool.c
create mode 100644 lib/librte_eal/linuxapp/kcp/kcp_net.c
create mode 100644 lib/librte_eal/linuxapp/kcp/kcp_nl.c
diff --git a/MAINTAINERS b/MAINTAINERS
index 628bc05..6a77728 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -257,6 +257,10 @@ F: app/test/test_kni.c
F: examples/kni/
F: doc/guides/sample_app_ug/kernel_nic_interface.rst
+Linux KCP
+M: Ferruh Yigit
+F: lib/librte_eal/linuxapp/kcp/
+
Linux AF_PACKET
M: John W. Linville
F: drivers/net/af_packet/
diff --git a/config/common_linuxapp b/config/common_linuxapp
index 960dde4..0284fae 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -502,6 +502,12 @@ CONFIG_RTE_KNI_VHOST_DEBUG_TX=n
CONFIG_RTE_LIBRTE_ETHTOOL=y
#
+# Compile librte_ctrl_if
+#
+CONFIG_RTE_KCP_KMOD=y
+CONFIG_RTE_KCP_KO_DEBUG=n
+
+#
# Compile vhost library
# fuse-devel is needed to run vhost-cuse.
# fuse-devel enables user space char driver development
diff --git a/lib/librte_eal/linuxapp/Makefile b/lib/librte_eal/linuxapp/Makefile
index d9c5233..d1fa3a3 100644
--- a/lib/librte_eal/linuxapp/Makefile
+++ b/lib/librte_eal/linuxapp/Makefile
@@ -1,6 +1,6 @@
# BSD LICENSE
#
-# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+# Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -38,6 +38,9 @@ DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal
ifeq ($(CONFIG_RTE_KNI_KMOD),y)
DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += kni
endif
+ifeq ($(CONFIG_RTE_KCP_KMOD),y)
+DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += kcp
+endif
ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y)
DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += xen_dom0
endif
diff --git a/lib/librte_eal/linuxapp/eal/Makefile
b/lib/librte_eal/linuxapp/eal/Makefile
index 6e26250..f6a3a41 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -1,6 +1,6 @@
# BSD LICENSE
#
-# Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+# Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -121,6 +121,7 @@ CFLAGS_eal_thread.o += -Wno-return-type
endif
INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h
+INC += rte_kcp_common.h
SYMLINK-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP)-include/exec-env := \
$(addprefix include/exec-env/,$(INC))
diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kcp_common.h
b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kcp_common.h
new file mode 100644
index 000..988713e
--- /dev/null
+++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kcp_common.h
@@ -0,0 +1,109 @@
+/*-
+ * This file is provided under a dual BSD/LGPLv2 license. When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GNU LESSER GENERAL PUBLIC LICENSE
+ *
+ * Copyright(c) 2016 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2.1 of the GNU Lesser G