get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/86682/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 86682,
    "url": "https://patches.dpdk.org/api/patches/86682/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210115111052.16437-17-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.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": "<20210115111052.16437-17-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210115111052.16437-17-bruce.richardson@intel.com",
    "date": "2021-01-15T11:10:48",
    "name": "[v2,16/19] app/chkincs: add chkincs app to verify headers",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0953b59d499255cd9254b71bd16b81f5bf8452bf",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 24651,
        "url": "https://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210115111052.16437-17-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 14778,
            "url": "https://patches.dpdk.org/api/series/14778/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14778",
            "date": "2021-01-15T11:10:32",
            "name": "ensure headers have correct includes",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/14778/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/86682/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/86682/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 20C37A0A02;\n\tFri, 15 Jan 2021 12:13:29 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6AC0E140F74;\n\tFri, 15 Jan 2021 12:12:18 +0100 (CET)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id 742B1140F74\n for <dev@dpdk.org>; Fri, 15 Jan 2021 12:12:16 +0100 (CET)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 15 Jan 2021 03:12:15 -0800",
            "from silpixa00399126.ir.intel.com ([10.237.222.4])\n by fmsmga002.fm.intel.com with ESMTP; 15 Jan 2021 03:12:12 -0800"
        ],
        "IronPort-SDR": [
            "\n jjMSg1UlXEu29KkXq1E8S2YVXPmJXAZX3SwJNIhxcN3Y0po2djLpurnThHThRH0M6K24Ci4bLZ\n pRtzxyjIwE8g==",
            "\n sOwLj9XBjlai4WERLNbRonDsSFZddBVN2cLVZBV1Id9f+YJ6x2tm3ybKfOq9Wsj23McRavP9Du\n 3kRoE5B3RPBA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9864\"; a=\"175954165\"",
            "E=Sophos;i=\"5.79,349,1602572400\"; d=\"scan'208\";a=\"175954165\"",
            "E=Sophos;i=\"5.79,349,1602572400\"; d=\"scan'208\";a=\"401253011\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "david.marchand@redhat.com, Bruce Richardson <bruce.richardson@intel.com>,\n Thomas Monjalon <thomas@monjalon.net>,\n Ferruh Yigit <ferruh.yigit@intel.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Yipeng Wang <yipeng1.wang@intel.com>,\n Sameh Gobriel <sameh.gobriel@intel.com>,\n Konstantin Ananyev <konstantin.ananyev@intel.com>,\n Bernard Iremonger <bernard.iremonger@intel.com>,\n Vladimir Medvedkin <vladimir.medvedkin@intel.com>,\n Ori Kam <orika@nvidia.com>,\n Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,\n Olivier Matz <olivier.matz@6wind.com>,\n Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "Date": "Fri, 15 Jan 2021 11:10:48 +0000",
        "Message-Id": "<20210115111052.16437-17-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20210115111052.16437-1-bruce.richardson@intel.com>",
        "References": "<20210114110606.21142-1-bruce.richardson@intel.com>\n <20210115111052.16437-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 16/19] 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\nThe list of headers to check is based of the \"headers\" value returned from\neach library's meson.build file. However, since not all headers are for\ndirect inclusion, add a build variable \"headers_no_chkincs\" to list those\nheaders and skip checking them.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n\nv2:\n* add maintainers entry\n* distribute exception list among meson.build files.\n\n MAINTAINERS                              |  4 ++++\n app/chkincs/gen_c_file_for_header.py     | 12 ++++++++++\n app/chkincs/main.c                       |  4 ++++\n app/chkincs/meson.build                  | 28 ++++++++++++++++++++++++\n app/meson.build                          |  1 +\n doc/guides/contributing/coding_style.rst | 12 ++++++++++\n lib/librte_eal/include/meson.build       |  2 +-\n lib/librte_ethdev/meson.build            |  4 ++--\n lib/librte_hash/meson.build              |  4 ++--\n lib/librte_ipsec/meson.build             |  3 ++-\n lib/librte_lpm/meson.build               |  2 +-\n lib/librte_regexdev/meson.build          |  2 +-\n lib/librte_ring/meson.build              |  4 +++-\n lib/librte_stack/meson.build             |  4 +++-\n lib/librte_table/meson.build             |  7 +++---\n lib/meson.build                          |  3 +++\n meson.build                              |  1 +\n meson_options.txt                        |  2 ++\n 18 files changed, 85 insertions(+), 14 deletions(-)\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/MAINTAINERS b/MAINTAINERS\nindex 76ed473e44..49bb2aab2c 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -1561,6 +1561,10 @@ F: app/test/test_resource.c\n F: app/test/virtual_pmd.c\n F: app/test/virtual_pmd.h\n\n+Header build sanity checking\n+M: Bruce Richardson <bruce.richardson@intel.com>\n+F: app/chkincs/\n+\n Sample packet helper functions for unit test\n M: Reshma Pattan <reshma.pattan@intel.com>\n F: app/test/sample_packet_forward.c\ndiff --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..124cf96917\n--- /dev/null\n+++ b/app/chkincs/gen_c_file_for_header.py\n@@ -0,0 +1,12 @@\n+#! /usr/bin/env python3\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2020-2021 Intel Corporation\n+\n+from sys import argv\n+from os.path import abspath\n+\n+(h_file, c_file) = argv[1:]\n+\n+contents = '#include \"' + abspath(h_file) + '\"'\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-2021 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..7fea11c506\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-2021 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_chkinc_headers)\n+\n+deps = enabled_libs\ndiff --git a/app/meson.build b/app/meson.build\nindex 87fc195dbf..b8ee6d2e97 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/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst\nindex bb3f3efcbc..041a3998ff 100644\n--- a/doc/guides/contributing/coding_style.rst\n+++ b/doc/guides/contributing/coding_style.rst\n@@ -891,6 +891,18 @@ headers\n \tinstalled to $PREFIX/include when ``ninja install`` is run. As with\n \tsource files, these should be specified using the meson ``files()``\n \tfunction.\n+\tWhen ``test_headers`` build option is set to ``true``, each header file\n+\thas additional checks performed on it, for example to ensure that it is\n+\tnot missing any include statements for dependent headers. These build\n+\tchecks are done by the build of the ``dpdk-chkincs`` application, and\n+\tfor header files which are public, but only included indirectly in\n+\tapplications, these checks can be skipped by using the ``headers_no_chkincs``\n+\tvariable rather than ``headers``.\n+\n+headers_no_chkincs\n+\t**Default Value = []**.\n+\tAs with ``headers`` option above, except that the files are not checked\n+\tas part of the build of the ``dpdk-chkincs`` binary.\n\n includes:\n \t**Default Value = []**.\ndiff --git a/lib/librte_eal/include/meson.build b/lib/librte_eal/include/meson.build\nindex 0dea342e1d..449740e510 100644\n--- a/lib/librte_eal/include/meson.build\n+++ b/lib/librte_eal/include/meson.build\n@@ -16,7 +16,6 @@ headers += files(\n \t'rte_dev.h',\n \t'rte_devargs.h',\n \t'rte_eal.h',\n-\t'rte_eal_interrupts.h',\n \t'rte_eal_memconfig.h',\n \t'rte_eal_trace.h',\n \t'rte_errno.h',\n@@ -49,6 +48,7 @@ headers += files(\n \t'rte_version.h',\n \t'rte_vfio.h',\n )\n+headers_no_chkincs += files('rte_eal_interrupts.h')\n\n # special case install the generic headers, since they go in a subdir\n generic_headers = files(\ndiff --git a/lib/librte_ethdev/meson.build b/lib/librte_ethdev/meson.build\nindex e4b610246f..ab84869ea8 100644\n--- a/lib/librte_ethdev/meson.build\n+++ b/lib/librte_ethdev/meson.build\n@@ -12,12 +12,10 @@ sources = files('ethdev_private.c',\n\n headers = files('rte_ethdev.h',\n \t'rte_ethdev_driver.h',\n-\t'rte_ethdev_core.h',\n \t'rte_ethdev_pci.h',\n \t'rte_ethdev_trace.h',\n \t'rte_ethdev_trace_fp.h',\n \t'rte_ethdev_vdev.h',\n-\t'rte_eth_ctrl.h',\n \t'rte_dev_info.h',\n \t'rte_flow.h',\n \t'rte_flow_driver.h',\n@@ -25,5 +23,7 @@ headers = files('rte_ethdev.h',\n \t'rte_mtr_driver.h',\n \t'rte_tm.h',\n \t'rte_tm_driver.h')\n+headers_no_chkincs += files('rte_eth_ctrl.h',\n+\t'rte_ethdev_core.h')\n\n deps += ['net', 'kvargs', 'meter', 'telemetry']\ndiff --git a/lib/librte_hash/meson.build b/lib/librte_hash/meson.build\nindex 0977a63fd2..b3ebc8b078 100644\n--- a/lib/librte_hash/meson.build\n+++ b/lib/librte_hash/meson.build\n@@ -1,12 +1,12 @@\n # SPDX-License-Identifier: BSD-3-Clause\n # Copyright(c) 2017 Intel Corporation\n\n-headers = files('rte_crc_arm64.h',\n-\t'rte_fbk_hash.h',\n+headers = files('rte_fbk_hash.h',\n \t'rte_hash_crc.h',\n \t'rte_hash.h',\n \t'rte_jhash.h',\n \t'rte_thash.h')\n+headers_no_chkincs += files('rte_crc_arm64.h')\n\n sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c')\n deps += ['ring']\ndiff --git a/lib/librte_ipsec/meson.build b/lib/librte_ipsec/meson.build\nindex fc69970ec5..e24e6ed22b 100644\n--- a/lib/librte_ipsec/meson.build\n+++ b/lib/librte_ipsec/meson.build\n@@ -3,6 +3,7 @@\n\n sources = files('esp_inb.c', 'esp_outb.c', 'sa.c', 'ses.c', 'ipsec_sad.c')\n\n-headers = files('rte_ipsec.h', 'rte_ipsec_group.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h')\n+headers = files('rte_ipsec.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h')\n+headers_no_chkincs += files('rte_ipsec_group.h')\n\n deps += ['mbuf', 'net', 'cryptodev', 'security', 'hash']\ndiff --git a/lib/librte_lpm/meson.build b/lib/librte_lpm/meson.build\nindex f93c866409..3d3d515a4d 100644\n--- a/lib/librte_lpm/meson.build\n+++ b/lib/librte_lpm/meson.build\n@@ -5,6 +5,6 @@ sources = files('rte_lpm.c', 'rte_lpm6.c')\n headers = files('rte_lpm.h', 'rte_lpm6.h')\n # since header files have different names, we can install all vector headers\n # without worrying about which architecture we actually need\n-headers += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h', 'rte_lpm_sve.h')\n+headers_no_chkincs += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h', 'rte_lpm_sve.h')\n deps += ['hash']\n deps += ['rcu']\ndiff --git a/lib/librte_regexdev/meson.build b/lib/librte_regexdev/meson.build\nindex c417b9caf0..1ab21bd4d8 100644\n--- a/lib/librte_regexdev/meson.build\n+++ b/lib/librte_regexdev/meson.build\n@@ -3,6 +3,6 @@\n\n sources = files('rte_regexdev.c')\n headers = files('rte_regexdev.h',\n-\t'rte_regexdev_core.h',\n \t'rte_regexdev_driver.h')\n+headers_no_chkincs += files('rte_regexdev_core.h')\n deps += ['mbuf']\ndiff --git a/lib/librte_ring/meson.build b/lib/librte_ring/meson.build\nindex 36fdcb6a57..1a95dae9e5 100644\n--- a/lib/librte_ring/meson.build\n+++ b/lib/librte_ring/meson.build\n@@ -2,7 +2,9 @@\n # Copyright(c) 2017 Intel Corporation\n\n sources = files('rte_ring.c')\n-headers = files('rte_ring.h',\n+headers = files('rte_ring.h')\n+# most sub-headers are not for direct inclusion\n+headers_no_chkincs += files (\n \t\t'rte_ring_core.h',\n \t\t'rte_ring_elem.h',\n \t\t'rte_ring_c11_mem.h',\ndiff --git a/lib/librte_stack/meson.build b/lib/librte_stack/meson.build\nindex 8f82a40ec2..5d9b3601b3 100644\n--- a/lib/librte_stack/meson.build\n+++ b/lib/librte_stack/meson.build\n@@ -2,7 +2,9 @@\n # Copyright(c) 2019 Intel Corporation\n\n sources = files('rte_stack.c', 'rte_stack_std.c', 'rte_stack_lf.c')\n-headers = files('rte_stack.h',\n+headers = files('rte_stack.h')\n+# subheaders, not for direct inclusion by apps\n+headers_no_chkincs += files(\n \t\t'rte_stack_std.h',\n \t\t'rte_stack_lf.h',\n \t\t'rte_stack_lf_generic.h',\ndiff --git a/lib/librte_table/meson.build b/lib/librte_table/meson.build\nindex d69678386e..a8b1c9a254 100644\n--- a/lib/librte_table/meson.build\n+++ b/lib/librte_table/meson.build\n@@ -20,7 +20,6 @@ headers = files('rte_table.h',\n \t\t'rte_table_hash.h',\n \t\t'rte_table_hash_cuckoo.h',\n \t\t'rte_table_hash_func.h',\n-\t\t'rte_table_hash_func_arm64.h',\n \t\t'rte_lru.h',\n \t\t'rte_table_array.h',\n \t\t'rte_table_stub.h',\n@@ -28,6 +27,6 @@ headers = files('rte_table.h',\n \t\t'rte_swx_table_em.h',)\n deps += ['mbuf', 'port', 'lpm', 'hash', 'acl']\n\n-if arch_subdir == 'x86'\n-\theaders += files('rte_lru_x86.h')\n-endif\n+headers_no_chkincs += files('rte_lru_x86.h',\n+\t\t'rte_lru_arm64.h',\n+\t\t'rte_table_hash_func_arm64.h')\ndiff --git a/lib/meson.build b/lib/meson.build\nindex ed00f89146..404809bd44 100644\n--- a/lib/meson.build\n+++ b/lib/meson.build\n@@ -65,6 +65,7 @@ foreach l:libraries\n \tuse_function_versioning = false\n \tsources = []\n \theaders = []\n+\theaders_no_chkincs = [] # public headers not directly included by apps\n \tincludes = []\n \tcflags = default_cflags\n \tobjs = [] # other object files to link against, used e.g. for\n@@ -103,6 +104,8 @@ 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\tinstall_headers(headers_no_chkincs)\n+\t\tdpdk_chkinc_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..7c9a8fce5f 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_chkinc_headers = []\n dpdk_driver_classes = []\n dpdk_drivers = []\n dpdk_extra_ldflags = []\ndiff --git a/meson_options.txt b/meson_options.txt\nindex 4604328224..37cd6e99ea 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -30,5 +30,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": [
        "v2",
        "16/19"
    ]
}