From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 3F8FE1BAFD for ; Fri, 12 Oct 2018 19:05:22 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id r63-v6so12992704wma.4 for ; Fri, 12 Oct 2018 10:05:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4mcz1cqIdeHMn//y2RuLhWJsbGvoRtVRyyn51bVuqRM=; b=ksEBZlJ+QHmEwj/Y5gpI0tafrkdcN4Q07VLQIRXxoaA7hxuQYO1qc2XLZ/iqOmt8FP NN+mrttLGgGyYpYEO2qNoID5wsL3vk2D9kC160/xImephywgbC6SP6Su7pLzu8yFoxU+ RceAnGsY9ClZVffvMRIbUzsFxa3O2REcp3ZAQxejQZFx/zJhHNN4MUYOGfuoB6wLoN2J Z3WHjldj0VAi4Ra49/3Nn6I5PeBtvMJZm9mUoTqSeTVaZ4bxrDSVvNGDWAUwzNBcyK4p Pg55tT7ZW9yPR1J4gGeHrQ7ZzWCtv/ZNfHSpEBpJFPAIfSNqdhPp/8xjP1bUzlfjnVsy k/wQ== X-Gm-Message-State: ABuFfoi7suGK1JC5L75BeFLn8W8ub0RFBO3c+Tij6DWcSsn622YgRmMe JJuNpLchuOb8pjfWijZp56hzTF78 X-Google-Smtp-Source: ACcGV63pytyGTQvVlswDjj7DBo6V8oF7FRdiys2Y0JmnVyRoowLNlcu89/5P0Eh2LVzpaOohpRGI0A== X-Received: by 2002:a1c:ed07:: with SMTP id l7-v6mr5782110wmh.47.1539363921386; Fri, 12 Oct 2018 10:05:21 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id h78-v6sm2283133wmd.4.2018.10.12.10.05.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Oct 2018 10:05:20 -0700 (PDT) From: Luca Boccassi To: dev@dpdk.org Cc: bruce.richardson@intel.com, ferruh.yigit@intel.com, Luca Boccassi Date: Fri, 12 Oct 2018 18:05:17 +0100 Message-Id: <20181012170517.12160-1-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181011194629.4699-1-bluca@debian.org> References: <20181011194629.4699-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3] build: add meson.build for kni kernel module 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, 12 Oct 2018 17:05:22 -0000 A Kbuild is also included to allow users to use DKMS natively without additional code. Signed-off-by: Luca Boccassi Tested-by: Bruce Richardson Acked-by: Bruce Richardson --- v2: add local directory to -I and build sources list recursively to fix build on Fedora v3: add console: true so that output is not buffered, given it takes a few seconds to build, and -j4 to the make call, given there are more than a few source files. kernel/linux/kni/Kbuild | 8 +++++ kernel/linux/kni/ethtool/igb/meson.build | 16 ++++++++++ kernel/linux/kni/ethtool/ixgbe/meson.build | 13 +++++++++ kernel/linux/kni/ethtool/meson.build | 5 ++++ kernel/linux/kni/meson.build | 34 ++++++++++++++++++++++ kernel/linux/meson.build | 2 +- 6 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 kernel/linux/kni/Kbuild create mode 100644 kernel/linux/kni/ethtool/igb/meson.build create mode 100644 kernel/linux/kni/ethtool/ixgbe/meson.build create mode 100644 kernel/linux/kni/ethtool/meson.build create mode 100644 kernel/linux/kni/meson.build diff --git a/kernel/linux/kni/Kbuild b/kernel/linux/kni/Kbuild new file mode 100644 index 0000000000..de5c27f328 --- /dev/null +++ b/kernel/linux/kni/Kbuild @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Luca Boccassi + +ccflags-y := $(MODULE_CFLAGS) +obj-m := rte_kni.o +rte_kni-y := $(patsubst $(src)/%.c,%.o,$(wildcard $(src)/*.c)) \ + $(patsubst $(src)/%.c,%.o,$(wildcard $(src)/ethtool/ixgbe/*.c)) \ + $(patsubst $(src)/%.c,%.o,$(wildcard $(src)/ethtool/igb/*.c)) diff --git a/kernel/linux/kni/ethtool/igb/meson.build b/kernel/linux/kni/ethtool/igb/meson.build new file mode 100644 index 0000000000..2f796ac0b2 --- /dev/null +++ b/kernel/linux/kni/ethtool/igb/meson.build @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Luca Boccassi + +kni_igb_sources = files( + 'e1000_82575.c', + 'e1000_api.c', + 'e1000_i210.c', + 'e1000_mac.c', + 'e1000_manage.c', + 'e1000_mbx.c', + 'e1000_nvm.c', + 'e1000_phy.c', + 'igb_ethtool.c', + 'igb_main.c', + 'igb_param.c', + 'igb_vmdq.c') diff --git a/kernel/linux/kni/ethtool/ixgbe/meson.build b/kernel/linux/kni/ethtool/ixgbe/meson.build new file mode 100644 index 0000000000..73248b13e4 --- /dev/null +++ b/kernel/linux/kni/ethtool/ixgbe/meson.build @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Luca Boccassi + +kni_ixgbe_sources = files( + 'ixgbe_82598.c', + 'ixgbe_82599.c', + 'ixgbe_api.c', + 'ixgbe_common.c', + 'ixgbe_ethtool.c', + 'ixgbe_main.c', + 'ixgbe_phy.c', + 'ixgbe_x540.c', + 'kcompat.c') diff --git a/kernel/linux/kni/ethtool/meson.build b/kernel/linux/kni/ethtool/meson.build new file mode 100644 index 0000000000..7a8458ddcd --- /dev/null +++ b/kernel/linux/kni/ethtool/meson.build @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Luca Boccassi + +subdir('igb') +subdir('ixgbe') diff --git a/kernel/linux/kni/meson.build b/kernel/linux/kni/meson.build new file mode 100644 index 0000000000..a09af5aa5f --- /dev/null +++ b/kernel/linux/kni/meson.build @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Luca Boccassi + +subdir('ethtool') + +kni_mkfile = custom_target('rte_kni_makefile', + output: 'Makefile', + command: ['touch', '@OUTPUT@']) + +kni_sources = files( + 'kni_ethtool.c', + 'kni_misc.c', + 'kni_net.c', + 'Kbuild') + +custom_target('rte_kni', + input: kni_sources + kni_igb_sources + kni_ixgbe_sources, + output: 'rte_kni.ko', + command: ['make', '-j4', '-C', kernel_dir, + 'M=' + meson.current_build_dir(), + 'src=' + meson.current_source_dir(), + 'MODULE_CFLAGS=-include ' + meson.source_root() + '/config/rte_config.h' + + ' -I' + meson.source_root() + '/lib/librte_eal/common/include' + + ' -I' + meson.source_root() + '/lib/librte_eal/linuxapp/eal/include' + + ' -I' + meson.build_root() + + ' -I' + meson.current_source_dir() + + ' -I' + meson.current_source_dir() + '/ethtool/ixgbe' + + ' -I' + meson.current_source_dir() + '/ethtool/igb', + 'modules'], + depends: kni_mkfile, + console: true, + install: true, + install_dir: kernel_dir + '/../extra/dpdk', + build_by_default: get_option('enable_kmods')) diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build index a924c7b6fb..5b7ec06e1d 100644 --- a/kernel/linux/meson.build +++ b/kernel/linux/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation -subdirs = ['igb_uio'] +subdirs = ['igb_uio', 'kni'] WARN_CROSS_COMPILE='Need "kernel_dir" option for kmod compilation when cross-compiling' WARN_NO_HEADERS='Cannot compile kernel modules as requested - are kernel headers installed?' -- 2.19.1