get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 83405,
    "url": "https://patches.dpdk.org/api/patches/83405/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1604323278-18039-8-git-send-email-juraj.linkes@pantheon.tech/",
    "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": "<1604323278-18039-8-git-send-email-juraj.linkes@pantheon.tech>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1604323278-18039-8-git-send-email-juraj.linkes@pantheon.tech",
    "date": "2020-11-02T13:21:14",
    "name": "[v6,07/11] build: streamline Arm build setup and machine args",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b3da85f2d0aada8535b6c824eca6c21807902892",
    "submitter": {
        "id": 1626,
        "url": "https://patches.dpdk.org/api/people/1626/?format=api",
        "name": "Juraj Linkeš",
        "email": "juraj.linkes@pantheon.tech"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1604323278-18039-8-git-send-email-juraj.linkes@pantheon.tech/mbox/",
    "series": [
        {
            "id": 13572,
            "url": "https://patches.dpdk.org/api/series/13572/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=13572",
            "date": "2020-11-02T13:21:08",
            "name": "Arm build options rework",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/13572/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/83405/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/83405/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id D340CA04E7;\n\tMon,  2 Nov 2020 14:23:36 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 44B3FC91A;\n\tMon,  2 Nov 2020 14:21:39 +0100 (CET)",
            "from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20])\n by dpdk.org (Postfix) with ESMTP id 69F88C8DA\n for <dev@dpdk.org>; Mon,  2 Nov 2020 14:21:32 +0100 (CET)",
            "from localhost (localhost [127.0.0.1])\n by lb.pantheon.sk (Postfix) with ESMTP id 4F1EBB6B61;\n Mon,  2 Nov 2020 14:21:30 +0100 (CET)",
            "from lb.pantheon.sk ([127.0.0.1])\n by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id QmkMwg9buttV; Mon,  2 Nov 2020 14:21:29 +0100 (CET)",
            "from service-node1.lab.pantheon.local (unknown [46.229.239.141])\n by lb.pantheon.sk (Postfix) with ESMTP id 7303AB6B67;\n Mon,  2 Nov 2020 14:21:25 +0100 (CET)"
        ],
        "X-Virus-Scanned": "amavisd-new at siecit.sk",
        "From": "=?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>",
        "To": "bruce.richardson@intel.com, Ruifeng.Wang@arm.com,\n Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com,\n Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com",
        "Cc": "dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>",
        "Date": "Mon,  2 Nov 2020 14:21:14 +0100",
        "Message-Id": "<1604323278-18039-8-git-send-email-juraj.linkes@pantheon.tech>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech>",
        "References": "<1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech>\n <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 07/11] build: streamline Arm build setup and\n\tmachine args",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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": "Modify the Arm build system so it satisfies the following:\n* Use predefined configuration values and predefined machine args the\n  generic portable build.\n* Use configuration values based on MIDR and native machine args for\n  native builds.\n* Use configuration values and machine args based on MIDR implementer ID\n  and part number specified in cross files for cross builds. Require\n  these to be specified.\n\nSigned-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>\n---\n config/arm/arm64_armada_linux_gcc   |   1 +\n config/arm/arm64_dpaa_linux_gcc     |   1 +\n config/arm/arm64_emag_linux_gcc     |   1 +\n config/arm/arm64_thunderx_linux_gcc |   1 +\n config/arm/meson.build              | 158 +++++++++++++---------------\n 5 files changed, 80 insertions(+), 82 deletions(-)",
    "diff": "diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc\nindex 52c5f4476..52214f2d8 100644\n--- a/config/arm/arm64_armada_linux_gcc\n+++ b/config/arm/arm64_armada_linux_gcc\n@@ -15,3 +15,4 @@ endian = 'little'\n \n [properties]\n implementer_id = '0x56'\n+part_number = 'generic'\ndiff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc\nindex 573ae7e42..29f1581de 100644\n--- a/config/arm/arm64_dpaa_linux_gcc\n+++ b/config/arm/arm64_dpaa_linux_gcc\n@@ -15,3 +15,4 @@ endian = 'little'\n \n [properties]\n implementer_id = 'dpaa'\n+part_number = 'generic'\ndiff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc\nindex 24f3d533e..14ecf9a12 100644\n--- a/config/arm/arm64_emag_linux_gcc\n+++ b/config/arm/arm64_emag_linux_gcc\n@@ -14,3 +14,4 @@ endian = 'little'\n \n [properties]\n implementer_id = '0x50'\n+part_number = 'generic'\ndiff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc\nindex 670764437..6fa29886d 100644\n--- a/config/arm/arm64_thunderx_linux_gcc\n+++ b/config/arm/arm64_thunderx_linux_gcc\n@@ -14,3 +14,4 @@ endian = 'little'\n \n [properties]\n implementer_id = '0x43'\n+part_number = 'generic'\ndiff --git a/config/arm/meson.build b/config/arm/meson.build\nindex 8dc946761..4cb5274b1 100644\n--- a/config/arm/meson.build\n+++ b/config/arm/meson.build\n@@ -3,8 +3,6 @@\n # Copyright(c) 2017 Cavium, Inc\n # Copyright(c) 2020 PANTHEON.tech s.r.o.\n \n-arm_force_native_march = false\n-\n # common flags to all aarch64 builds, with lowest priority\n flags_common_default = [\n \t# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)\n@@ -28,6 +26,8 @@ flags_common_default = [\n \t['RTE_ARCH_ARM64', true],\n \t['RTE_CACHE_LINE_SIZE', 128]\n ]\n+generic_machine_args = ['-march=armv8-a+crc', '-moutline-atomics']\n+native_machine_args = ['-march=native', '-mtune=native']\n \n # implementer specific aarch64 flags, with middle priority\n # (will overwrite common flags)\n@@ -101,47 +101,46 @@ flags_part_number_octeontx2 = [\n ]\n \n # arm config (implementer 0x41) is the default config\n-part_number_config_arm = {\n-\t'generic': [['-march=armv8-a+crc', '-moutline-atomics']],\n-\t'native': [['-march=native']],\n-\t'0xd03': [['-mcpu=cortex-a53']],\n-\t'0xd04': [['-mcpu=cortex-a35']],\n-\t'0xd07': [['-mcpu=cortex-a57']],\n-\t'0xd08': [['-mcpu=cortex-a72']],\n-\t'0xd09': [['-mcpu=cortex-a73']],\n-\t'0xd0a': [['-mcpu=cortex-a75']],\n-\t'0xd0b': [['-mcpu=cortex-a76']],\n-\t'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]\n-}\n-part_number_config_cavium = {\n-\t'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],\n-\t'native': [['-march=native']],\n-\t'0xa1': [['-mcpu=thunderxt88'], flags_part_number_thunderx],\n-\t'0xa2': [['-mcpu=thunderxt81'], flags_part_number_thunderx],\n-\t'0xa3': [['-mcpu=thunderxt83'], flags_part_number_thunderx],\n-\t'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],\n-\t'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]\n+part_number_machine_args = {\n+\t'0xd03': ['-mcpu=cortex-a53'],\n+\t'0xd04': ['-mcpu=cortex-a35'],\n+\t'0xd07': ['-mcpu=cortex-a57'],\n+\t'0xd08': ['-mcpu=cortex-a72'],\n+\t'0xd09': ['-mcpu=cortex-a73'],\n+\t'0xd0a': ['-mcpu=cortex-a75'],\n+\t'0xd0b': ['-mcpu=cortex-a76'],\n+\t'0xd0c': ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],\n+\t'0xa1': ['-mcpu=thunderxt88'],\n+\t'0xa2': ['-mcpu=thunderxt81'],\n+\t'0xa3': ['-mcpu=thunderxt83'],\n+\t'0xaf': ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],\n+\t'0xb2': ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2']\n }\n-part_number_config_emag = {\n-\t'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']],\n-\t'native': [['-march=native']]\n+\n+part_number_flags = {\n+\t'0xd0c': flags_part_number_n1generic,\n+\t'0xa1': flags_part_number_thunderx,\n+\t'0xa2': flags_part_number_thunderx,\n+\t'0xa3': flags_part_number_thunderx,\n+\t'0xaf': flags_part_number_thunderx2,\n+\t'0xb2': flags_part_number_octeontx2\n }\n \n ## Arm implementer ID (MIDR in Arm Architecture Reference Manual)\n-implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]\n-implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]\n-implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]\n-implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]\n-implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]\n-implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]\n-implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]\n-implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]\n-implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]\n-implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]\n-implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]\n-implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]\n-implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]\n-implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]\n+implementer_generic = ['Generic armv8', flags_implementer_generic]\n+implementer_0x41 = ['Arm', flags_implementer_arm]\n+implementer_0x42 = ['Broadcom', flags_implementer_generic]\n+implementer_0x43 = ['Cavium', flags_implementer_cavium]\n+implementer_0x44 = ['DEC', flags_implementer_generic]\n+implementer_0x49 = ['Infineon', flags_implementer_generic]\n+implementer_0x4d = ['Motorola', flags_implementer_generic]\n+implementer_0x4e = ['NVIDIA', flags_implementer_generic]\n+implementer_0x50 = ['Ampere Computing', flags_implementer_emag]\n+implementer_0x51 = ['Qualcomm', flags_implementer_generic]\n+implementer_0x53 = ['Samsung', flags_implementer_generic]\n+implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada]\n+implementer_0x69 = ['Intel', flags_implementer_generic]\n+implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa]\n \n dpdk_conf.set('RTE_ARCH_ARM', 1)\n dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)\n@@ -154,69 +153,64 @@ if dpdk_conf.get('RTE_ARCH_32')\n \tmachine_args += '-mfpu=neon'\n else\n \t# aarch64 build\n-\timplementer_id = 'generic'\n-\tif machine == 'generic' and not meson.is_cross_build()\n-\t\timplementer_config = implementer_generic\n-\t\tpart_number = 'generic'\n-\telif not meson.is_cross_build()\n-\t\t# The script returns ['Implementer', 'Variant', 'Architecture',\n-\t\t# 'Primary Part number', 'Revision']\n-\t\tdetect_vendor = find_program(join_paths(\n-\t\t\t\tmeson.current_source_dir(), 'armv8_machine.py'))\n-\t\tcmd = run_command(detect_vendor.path())\n-\t\tif cmd.returncode() == 0\n-\t\t\tcmd_output = cmd.stdout().to_lower().strip().split(' ')\n-\t\t\timplementer_id = cmd_output[0]\n-\t\t\tpart_number = cmd_output[3]\n-\t\tendif\n-\t\t# Set to generic if variable is not found\n-\t\timplementer_config = get_variable('implementer_' + implementer_id, ['generic'])\n-\t\tif implementer_config[0] == 'generic'\n+\tif not meson.is_cross_build()\n+\t\tif machine == 'generic'\n+\t\t\t# generic native build\n \t\t\timplementer_config = implementer_generic\n \t\t\tpart_number = 'generic'\n-\t\tendif\n-\t\tif arm_force_native_march == true\n-\t\t\tpart_number = 'native'\n+\t\t\ttarget_machine_args = generic_machine_args\n+\t\telse\n+\t\t\t# native build\n+\t\t\t# The script returns ['Implementer', 'Variant', 'Architecture',\n+\t\t\t# 'Primary Part number', 'Revision']\n+\t\t\tdetect_vendor = find_program(join_paths(\n+\t\t\t\t\tmeson.current_source_dir(), 'armv8_machine.py'))\n+\t\t\tcmd = run_command(detect_vendor.path())\n+\t\t\tif cmd.returncode() == 0\n+\t\t\t\tcmd_output = cmd.stdout().to_lower().strip().split(' ')\n+\t\t\t\timplementer_id = cmd_output[0]\n+\t\t\t\tpart_number = cmd_output[3]\n+\t\t\telse\n+\t\t\t\terror('Failed to get Arm MIDR information.')\n+\t\t\tendif\n+\t\t\t# Set to generic if implementer is not found\n+\t\t\timplementer_config = get_variable('implementer_' + implementer_id, implementer_generic)\n+\t\t\ttarget_machine_args = native_machine_args\n \t\tendif\n \telse\n-\t\timplementer_id = meson.get_cross_property('implementer_id', 'generic')\n-\t\tpart_number = meson.get_cross_property('part_number', 'generic')\n+\t\t# cross build\n+\t\timplementer_id = meson.get_cross_property('implementer_id', '')\n+\t\tif implementer_id == ''\n+\t\t\terror('Arm implementer ID must be specified in the cross file.')\n+\t\tendif\n \t\timplementer_config = get_variable('implementer_' + implementer_id)\n+\t\tpart_number = meson.get_cross_property('part_number', '')\n+\t\tif part_number == ''\n+\t\t\terror('Arm part number must be specified in the cross file.')\n+\t\telif part_number == 'generic'\n+\t\t\ttarget_machine_args = generic_machine_args\n+\t\telse\n+\t\t\ttarget_machine_args = part_number_machine_args[part_number]\n+\t\tendif\n \tendif\n \n \tmessage('Arm implementer: ' + implementer_config[0])\n \tmessage('Arm part number: ' + part_number)\n \n-\tpart_number_config = implementer_config[2]\n-\tif part_number_config.has_key(part_number)\n-\t\t# use the specified part_number machine args if found\n-\t\tpart_number_config = part_number_config[part_number]\n-\telif not meson.is_cross_build()\n-\t\t# default to generic machine args if part_number is not found\n-\t\t# and not forcing native machine args\n-\t\t# but don't default in cross-builds; if part_number is specified\n-\t\t# incorrectly in a cross-file, it needs to be fixed there\n-\t\tpart_number_config = part_number_config['generic']\n-\telse\n-\t\t# doing cross build and part number is not in part_number_config\n-\t\terror('Cross build part number 0@0 not found.'.format(part_number))\n-\tendif\n-\n-\t# use default flags with implementer flags\n \tdpdk_flags = flags_common_default + implementer_config[1]\n-\tif part_number_config.length() > 1\n-\t\t# add extra flags from the part number\n-\t\tdpdk_flags += part_number_config[1]\n+\tif part_number_flags.has_key(part_number)\n+\t\tdpdk_flags += part_number_flags[part_number]\n \tendif\n \n \t# apply supported machine args\n \tmachine_args = [] # Clear previous machine args\n-\tforeach flag: part_number_config[0]\n+\tforeach flag: target_machine_args\n \t\tif cc.has_argument(flag)\n \t\t\tmachine_args += flag\n \t\tendif\n \tendforeach\n \n+\t# use default flags with implementer flags and part number flags\n \t# apply flags\n \tforeach flag: dpdk_flags\n \t\tif flag.length() > 0\n",
    "prefixes": [
        "v6",
        "07/11"
    ]
}