From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id E20871B526 for ; Thu, 11 Oct 2018 21:46:35 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id l6-v6so10570817wrt.1 for ; Thu, 11 Oct 2018 12:46:35 -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:mime-version :content-transfer-encoding; bh=Obc4BQt1xGFaO+jkNsbxIBSbrEQJ+bsv7cVxoBp3N/s=; b=ZMEWI5hReL+Amkg2SSqAZebklwlIhKhcJ0LEjzsmXXO/GSI+DGlz+FUBxHI2xUDL1k uP+9iWLTkO2tlcezx9eSL7ofAGDnx94l3kZQmH04drGn1ZFOCPH5aPIiJ6yffR+ONYAa bpLjG2uMRY2cCabm1pgLDHyMkTq30n6778wVzezsnAkMjTO43W/46DOPp1sKIfrA7Aej DJJRrxIL55JVIfaPBFRj8aT0QGG1bsk/XlvHGMQ1qZ8YzNmvtVJ8oYmeF4sP9YE5t0wc gO0qf3+AweDaJZbVgrAj/FXzu7TWKFHJ0+nY0VKR8ZoZQRxqPyKRGYisywVBDO8Aiqm1 GIrQ== X-Gm-Message-State: ABuFfohRx8Wbga0gjgZhdb+MHepZnfKVxE3NnnADOKkKP1K98rSV3nG7 mPSyrkwxfkbfFsjPTcgZmwCI6emv X-Google-Smtp-Source: ACcGV62HimZVEZT9JofX6LiQXh/dWcAAIoPmBlwYEdHuNjrzfBuTVXmsItzVmXD3bP+m4jVUnCZDGg== X-Received: by 2002:adf:d841:: with SMTP id k1-v6mr2866451wrl.26.1539287195018; Thu, 11 Oct 2018 12:46:35 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id c18-v6sm8425682wrr.74.2018.10.11.12.46.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Oct 2018 12:46:33 -0700 (PDT) From: Luca Boccassi To: dev@dpdk.org Cc: bruce.richardson@intel.com, ferruh.yigit@intel.com, Luca Boccassi Date: Thu, 11 Oct 2018 20:46:29 +0100 Message-Id: <20181011194629.4699-1-bluca@debian.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] 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: Thu, 11 Oct 2018 19:46:36 -0000 A Kbuild is also included to allow users to use DKMS natively without additional code. Signed-off-by: Luca Boccassi --- build-tested on debian sid am64 kernel/linux/kni/Kbuild | 8 ++++++ kernel/linux/kni/meson.build | 51 ++++++++++++++++++++++++++++++++++++ kernel/linux/meson.build | 2 +- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 kernel/linux/kni/Kbuild 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/meson.build b/kernel/linux/kni/meson.build new file mode 100644 index 0000000000..cf881b1c1f --- /dev/null +++ b/kernel/linux/kni/meson.build @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Luca Boccassi + +kni_mkfile = custom_target('rte_kni_makefile', + output: 'Makefile', + command: ['touch', '@OUTPUT@']) + +kni_sources = [ + 'kni_ethtool.c', + 'kni_misc.c', + 'kni_net.c', + 'ethtool/igb/e1000_82575.c', + 'ethtool/igb/e1000_api.c', + 'ethtool/igb/e1000_i210.c', + 'ethtool/igb/e1000_mac.c', + 'ethtool/igb/e1000_manage.c', + 'ethtool/igb/e1000_mbx.c', + 'ethtool/igb/e1000_nvm.c', + 'ethtool/igb/e1000_phy.c', + 'ethtool/igb/igb_ethtool.c', + 'ethtool/igb/igb_main.c', + 'ethtool/igb/igb_param.c', + 'ethtool/igb/igb_vmdq.c', + 'ethtool/ixgbe/ixgbe_82598.c', + 'ethtool/ixgbe/ixgbe_82599.c', + 'ethtool/ixgbe/ixgbe_api.c', + 'ethtool/ixgbe/ixgbe_common.c', + 'ethtool/ixgbe/ixgbe_ethtool.c', + 'ethtool/ixgbe/ixgbe_main.c', + 'ethtool/ixgbe/ixgbe_phy.c', + 'ethtool/ixgbe/ixgbe_x540.c', + 'ethtool/ixgbe/kcompat.c', + 'Kbuild'] + +custom_target('rte_kni', + input: kni_sources, + output: 'rte_kni.ko', + command: ['make', '-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() + '/ethtool/ixgbe' + + ' -I' + meson.current_source_dir() + '/ethtool/igb', + 'modules'], + depends: kni_mkfile, + 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