Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/86608/?format=api
http://patchwork.dpdk.org/api/patches/86608/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210114110606.21142-18-bruce.richardson@intel.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20210114110606.21142-18-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210114110606.21142-18-bruce.richardson@intel.com", "date": "2021-01-14T11:06:03", "name": "[17/20] app/chkincs: add chkincs app to verify headers", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "d7b8cc594e2cf7978666c86358bfb388837f0aea", "submitter": { "id": 20, "url": "http://patchwork.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@intel.com" }, "delegate": { "id": 24651, "url": "http://patchwork.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210114110606.21142-18-bruce.richardson@intel.com/mbox/", "series": [ { "id": 14751, "url": "http://patchwork.dpdk.org/api/series/14751/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=14751", "date": "2021-01-14T11:05:46", "name": "ensure headers have correct includes", "version": 1, "mbox": "http://patchwork.dpdk.org/series/14751/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/86608/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/86608/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 9F402A0A02;\n\tThu, 14 Jan 2021 12:08:51 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 43F9D1411CA;\n\tThu, 14 Jan 2021 12:06:43 +0100 (CET)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 3157F14119E\n for <dev@dpdk.org>; Thu, 14 Jan 2021 12:06:33 +0100 (CET)", "from orsmga005.jf.intel.com ([10.7.209.41])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 Jan 2021 03:06:33 -0800", "from silpixa00399126.ir.intel.com ([10.237.222.4])\n by orsmga005.jf.intel.com with ESMTP; 14 Jan 2021 03:06:32 -0800" ], "IronPort-SDR": [ "\n 04FYuqNgwobCTo+5G5lCO435W+nI5b+ZS39qyvgN2QuzRJJes/m0+0Abetp2hwPve0PSOakPDU\n P8WK96HbPSEA==", "\n PAp7yZseEWwd7H16p9K8o1YXm2OzQUDOW4bIjTAoS5/+qsTBWkYsn3FLdZxxAUi3r6/bYuCPej\n dexYsykvUGWA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9863\"; a=\"178498555\"", "E=Sophos;i=\"5.79,347,1602572400\"; d=\"scan'208\";a=\"178498555\"", "E=Sophos;i=\"5.79,347,1602572400\"; d=\"scan'208\";a=\"568139896\"" ], "X-ExtLoop1": "1", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Cc": "Bruce Richardson <bruce.richardson@intel.com>", "Date": "Thu, 14 Jan 2021 11:06:03 +0000", "Message-Id": "<20210114110606.21142-18-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20210114110606.21142-1-bruce.richardson@intel.com>", "References": "<20210114110606.21142-1-bruce.richardson@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH 17/20] app/chkincs: add chkincs app to verify\n headers", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "To verify that all DPDK headers are ok for inclusion directly in a C\nfile, and are not missing any other pre-requisite headers, we can\nauto-generate for each header an empty C file that includes that header.\nCompiling these files will throw errors if any header has unmet\ndependencies.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n app/chkincs/gen_c_file_for_header.py | 49 ++++++++++++++++++++++++++++\n app/chkincs/main.c | 4 +++\n app/chkincs/meson.build | 28 ++++++++++++++++\n app/meson.build | 1 +\n lib/meson.build | 1 +\n meson.build | 1 +\n meson_options.txt | 2 ++\n 7 files changed, 86 insertions(+)\n create mode 100755 app/chkincs/gen_c_file_for_header.py\n create mode 100644 app/chkincs/main.c\n create mode 100644 app/chkincs/meson.build\n\n--\n2.27.0", "diff": "diff --git a/app/chkincs/gen_c_file_for_header.py b/app/chkincs/gen_c_file_for_header.py\nnew file mode 100755\nindex 0000000000..f92f2b412c\n--- /dev/null\n+++ b/app/chkincs/gen_c_file_for_header.py\n@@ -0,0 +1,49 @@\n+#! /usr/bin/env python3\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2020 Intel Corporation\n+\n+from sys import argv\n+from os.path import abspath\n+\n+empty_contents = 'static const char *empty __attribute__((unused)) = \"empty\";'\n+# files which are not used directly, but included via others\n+exceptions = [\n+ 'rte_cmp_arm64.h',\n+ 'rte_cmp_x86.h',\n+ 'rte_crc_arm64.h',\n+ 'rte_eal_interrupts.h',\n+ 'rte_eth_ctrl.h',\n+ 'rte_ethdev_core.h',\n+ 'rte_ipsec_group.h',\n+ 'rte_lpm_altivec.h',\n+ 'rte_lpm_neon.h',\n+ 'rte_lpm_sse.h',\n+ 'rte_lpm_x86.h',\n+ 'rte_lru_arm64.h',\n+ 'rte_lru_x86.h',\n+ 'rte_regexdev_core.h',\n+ 'rte_ring_core.h',\n+ 'rte_ring_generic.h',\n+ 'rte_ring_hts_c11_mem.h',\n+ 'rte_ring_hts.h',\n+ 'rte_ring_peek_c11_mem.h',\n+ 'rte_ring_peek.h',\n+ 'rte_ring_peek_zc.h',\n+ 'rte_ring_rts_c11_mem.h',\n+ 'rte_ring_rts.h',\n+ 'rte_stack_lf_c11.h',\n+ 'rte_stack_lf_generic.h',\n+ 'rte_stack_lf.h',\n+ 'rte_stack_std.h',\n+ 'rte_table_hash_func_arm64.h',\n+ ]\n+\n+(h_file, c_file) = argv[1:]\n+\n+contents = '#include \"' + abspath(h_file) + '\"'\n+for ex in exceptions:\n+ if h_file.endswith(ex):\n+ contents = empty_contents\n+\n+with open(c_file, 'w') as cf:\n+ cf.write(contents)\ndiff --git a/app/chkincs/main.c b/app/chkincs/main.c\nnew file mode 100644\nindex 0000000000..ecdf641954\n--- /dev/null\n+++ b/app/chkincs/main.c\n@@ -0,0 +1,4 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2020 Intel Corporation\n+ */\n+int main(void) { return 0; }\ndiff --git a/app/chkincs/meson.build b/app/chkincs/meson.build\nnew file mode 100644\nindex 0000000000..c16ca1f4fe\n--- /dev/null\n+++ b/app/chkincs/meson.build\n@@ -0,0 +1,28 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2020 Intel Corporation\n+\n+if not get_option('test_includes')\n+\tbuild = false\n+\tsubdir_done()\n+endif\n+\n+if is_windows\n+\t# for windows, the shebang line in the script won't work.\n+\terror('option \"test_includes\" is not supported on windows')\n+endif\n+\n+gen_c_file_for_header = find_program('gen_c_file_for_header.py')\n+gen_c_files = generator(gen_c_file_for_header,\n+\toutput: '@BASENAME@.c',\n+\targuments: ['@INPUT@', '@OUTPUT@'])\n+\n+cflags += '-Wno-unused-function' # needed if we include generic headers\n+\n+# some ethdev headers depend on bus headers\n+includes += include_directories('../../drivers/bus/pci',\n+\t'../../drivers/bus/vdev')\n+\n+sources += files('main.c')\n+sources += gen_c_files.process(dpdk_headers)\n+\n+deps = enabled_libs\ndiff --git a/app/meson.build b/app/meson.build\nindex b6f2a6f56e..8832ba8b17 100644\n--- a/app/meson.build\n+++ b/app/meson.build\n@@ -6,6 +6,7 @@ if is_windows\n endif\n\n apps = [\n+\t'chkincs',\n \t'pdump',\n \t'proc-info',\n \t'test-acl',\ndiff --git a/lib/meson.build b/lib/meson.build\nindex ed00f89146..7698e6749c 100644\n--- a/lib/meson.build\n+++ b/lib/meson.build\n@@ -103,6 +103,7 @@ foreach l:libraries\n \t\tdpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1) #old macro\n \t\tdpdk_conf.set('RTE_LIB_' + name.to_upper(), 1) # new macro\n \t\tinstall_headers(headers)\n+\t\tdpdk_headers += headers\n\n \t\tlibname = 'rte_' + name\n \t\tincludes += include_directories(dir_name)\ndiff --git a/meson.build b/meson.build\nindex 45d974cd2c..5c612fe93a 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -16,6 +16,7 @@ cc = meson.get_compiler('c')\n dpdk_conf = configuration_data()\n dpdk_libraries = []\n dpdk_static_libraries = []\n+dpdk_headers = []\n dpdk_driver_classes = []\n dpdk_drivers = []\n dpdk_extra_ldflags = []\ndiff --git a/meson_options.txt b/meson_options.txt\nindex e384e6dbb2..9214219444 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -32,5 +32,7 @@ option('enable_trace_fp', type: 'boolean', value: false,\n \tdescription: 'enable fast path trace points.')\n option('tests', type: 'boolean', value: true,\n \tdescription: 'build unit tests')\n+option('test_includes', type: 'boolean', value: false,\n+\tdescription: 'build \"chkincs\" to verify each header file can compile alone')\n option('use_hpet', type: 'boolean', value: false,\n \tdescription: 'use HPET timer in EAL')\n", "prefixes": [ "17/20" ] }{ "id": 86608, "url": "