From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D863A567E for ; Fri, 30 Jun 2017 18:52:03 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jun 2017 09:51:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,287,1496127600"; d="scan'208";a="103233218" Received: from silpixa00372839.ir.intel.com (HELO silpixa00372839.ger.corp.intel.com) ([10.237.222.154]) by orsmga004.jf.intel.com with ESMTP; 30 Jun 2017 09:51:54 -0700 From: Ferruh Yigit To: dev@dpdk.org Cc: Ferruh Yigit , Stephen Hemminger , Bruce Richardson , Anatoly Burakov Date: Fri, 30 Jun 2017 17:51:28 +0100 Message-Id: <20170630165140.59594-9-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170630165140.59594-1-ferruh.yigit@intel.com> References: <20170621110651.75299-1-ferruh.yigit@intel.com> <20170630165140.59594-1-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v9 08/20] unci: add module skeleton X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2017 16:52:05 -0000 Base files to have a new kernel module, without actual source code. Signed-off-by: Ferruh Yigit --- 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 F: lib/librte_ethtool/ +Linux Userspace Network Control Interface (UNCI) +M: Ferruh Yigit +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 + +#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 + +#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