Base files to have a new kernel module, without actual source code. Signed-off-by: Ferruh Yigit <ferruh.yi...@intel.com> --- MAINTAINERS | 4 +++ config/common_base | 5 ++++ config/common_linuxapp | 1 + lib/librte_eal/linuxapp/Makefile | 4 ++- lib/librte_eal/linuxapp/unci/Makefile | 52 +++++++++++++++++++++++++++++++++ lib/librte_eal/linuxapp/unci/unci_dev.h | 36 +++++++++++++++++++++++ lib/librte_eal/linuxapp/unci/unci_net.c | 42 ++++++++++++++++++++++++++ 7 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 lib/librte_eal/linuxapp/unci/Makefile create mode 100644 lib/librte_eal/linuxapp/unci/unci_dev.h create mode 100644 lib/librte_eal/linuxapp/unci/unci_net.c
diff --git a/MAINTAINERS b/MAINTAINERS index b2cf83c8e..9adca546a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -758,6 +758,10 @@ Ethtool M: Remy Horton <remy.hor...@intel.com> F: lib/librte_ethtool/ +Linux Userspace Network Control Interface (UNCI) +M: Ferruh Yigit <ferruh.yi...@intel.com> +F: lib/librte_eal/linuxapp/unci/ + Test Applications ----------------- diff --git a/config/common_base b/config/common_base index c767b1090..af92d1932 100644 --- a/config/common_base +++ b/config/common_base @@ -704,6 +704,11 @@ CONFIG_RTE_LIBRTE_PDUMP=y CONFIG_RTE_LIBRTE_ETHTOOL=n # +# Compile Userspace Network Control Interface (UNCI) kernel module +# +CONFIG_RTE_UNCI_KMOD=n + +# # Compile vhost user library # CONFIG_RTE_LIBRTE_VHOST=n diff --git a/config/common_linuxapp b/config/common_linuxapp index 33ed11b37..4deab42c3 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -41,6 +41,7 @@ CONFIG_RTE_KNI_KMOD=y CONFIG_RTE_LIBRTE_KNI=y CONFIG_RTE_LIBRTE_PMD_KNI=y CONFIG_RTE_LIBRTE_ETHTOOL=y +CONFIG_RTE_UNCI_KMOD=y CONFIG_RTE_LIBRTE_VHOST=y CONFIG_RTE_LIBRTE_PMD_VHOST=y CONFIG_RTE_LIBRTE_PMD_AF_PACKET=y diff --git a/lib/librte_eal/linuxapp/Makefile b/lib/librte_eal/linuxapp/Makefile index 4794696b6..2d293f1a6 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-2017 Intel Corporation. All rights reserved. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -35,6 +35,8 @@ DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal DIRS-$(CONFIG_RTE_EAL_IGB_UIO) += igb_uio DIRS-$(CONFIG_RTE_KNI_KMOD) += kni DEPDIRS-kni := eal +DIRS-$(CONFIG_RTE_UNCI_KMOD) += unci +DEPDIRS-unci := eal DIRS-$(CONFIG_RTE_LIBRTE_XEN_DOM0) += xen_dom0 DEPDIRS-xen_dom0 := eal diff --git a/lib/librte_eal/linuxapp/unci/Makefile b/lib/librte_eal/linuxapp/unci/Makefile new file mode 100644 index 000000000..02e354814 --- /dev/null +++ b/lib/librte_eal/linuxapp/unci/Makefile @@ -0,0 +1,52 @@ +# BSD LICENSE +# +# Copyright(c) 2017 Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# module name and path +# +MODULE = rte_unci + +# +# CFLAGS +# +MODULE_CFLAGS += -I$(SRCDIR) +MODULE_CFLAGS += -I$(RTE_OUTPUT)/include +MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h +MODULE_CFLAGS += -Wall -Werror + +# +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_UNCI_KMOD) := unci_net.c + +include $(RTE_SDK)/mk/rte.module.mk diff --git a/lib/librte_eal/linuxapp/unci/unci_dev.h b/lib/librte_eal/linuxapp/unci/unci_dev.h new file mode 100644 index 000000000..0337fa82b --- /dev/null +++ b/lib/librte_eal/linuxapp/unci/unci_dev.h @@ -0,0 +1,36 @@ +/*- + * GPL LICENSE SUMMARY + * + * Copyright(c) 2017 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; + * + * The full GNU General Public License is included in this distribution + * in the file called LICENSE.GPL. + * + * Contact Information: + * Intel Corporation + */ + +#ifndef _UNCI_DEV_H_ +#define _UNCI_DEV_H_ + +#include <linux/netdevice.h> + +#ifdef pr_fmt +#undef pr_fmt +#endif +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + + +#endif /* _UNCI_DEV_H_ */ diff --git a/lib/librte_eal/linuxapp/unci/unci_net.c b/lib/librte_eal/linuxapp/unci/unci_net.c new file mode 100644 index 000000000..b8ef409d3 --- /dev/null +++ b/lib/librte_eal/linuxapp/unci/unci_net.c @@ -0,0 +1,42 @@ +/*- + * GPL LICENSE SUMMARY + * + * Copyright(c) 2017 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; + * + * The full GNU General Public License is included in this distribution + * in the file called LICENSE.GPL. + * + * Contact Information: + * Intel Corporation + */ + +#include <linux/module.h> + +#include "unci_dev.h" + +static int __init unci_init(void) +{ + return 0; +} +module_init(unci_init); + +static void __exit unci_exit(void) +{ +} +module_exit(unci_exit); + +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_AUTHOR("Intel Corporation"); +MODULE_DESCRIPTION("Kernel Module for managing unci devices"); -- 2.13.0