get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96339,
    "url": "http://patches.dpdk.org/api/patches/96339/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210727174340.2125-5-cristian.dumitrescu@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20210727174340.2125-5-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210727174340.2125-5-cristian.dumitrescu@intel.com",
    "date": "2021-07-27T17:43:40",
    "name": "[V2,5/5] examples/pipeline: add variable size headers example",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "e07c85cbac138253d43c698b244b611f65f95b7e",
    "submitter": {
        "id": 19,
        "url": "http://patches.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210727174340.2125-5-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 18023,
            "url": "http://patches.dpdk.org/api/series/18023/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=18023",
            "date": "2021-07-27T17:43:37",
            "name": "[V2,1/5] pipeline: prepare for variable size headers",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/18023/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/96339/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/96339/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 0BF05A0C55;\n\tTue, 27 Jul 2021 19:44:17 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C22BD41137;\n\tTue, 27 Jul 2021 19:43:55 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id 60FD2410FA\n for <dev@dpdk.org>; Tue, 27 Jul 2021 19:43:50 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 27 Jul 2021 10:43:44 -0700",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by fmsmga002.fm.intel.com with ESMTP; 27 Jul 2021 10:43:44 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10058\"; a=\"199677816\"",
            "E=Sophos;i=\"5.84,274,1620716400\"; d=\"scan'208\";a=\"199677816\"",
            "E=Sophos;i=\"5.84,274,1620716400\"; d=\"scan'208\";a=\"517040416\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue, 27 Jul 2021 18:43:40 +0100",
        "Message-Id": "<20210727174340.2125-5-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20210727174340.2125-1-cristian.dumitrescu@intel.com>",
        "References": "<20210727163609.97769-1-cristian.dumitrescu@intel.com>\n <20210727174340.2125-1-cristian.dumitrescu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH V2 5/5] examples/pipeline: add variable size\n headers example",
        "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": "Added the files to illustrate the variable size header usage.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n examples/pipeline/examples/varbit.cli  | 35 ++++++++++\n examples/pipeline/examples/varbit.spec | 95 ++++++++++++++++++++++++++\n 2 files changed, 130 insertions(+)\n create mode 100644 examples/pipeline/examples/varbit.cli\n create mode 100644 examples/pipeline/examples/varbit.spec",
    "diff": "diff --git a/examples/pipeline/examples/varbit.cli b/examples/pipeline/examples/varbit.cli\nnew file mode 100644\nindex 0000000000..0589e32c15\n--- /dev/null\n+++ b/examples/pipeline/examples/varbit.cli\n@@ -0,0 +1,35 @@\n+; SPDX-License-Identifier: BSD-3-Clause\n+; Copyright(c) 2020 Intel Corporation\n+\n+;\n+; Customize the LINK parameters to match your setup.\n+;\n+mempool MEMPOOL0 buffer 2304 pool 32K cache 256 cpu 0\n+\n+link LINK0 dev 0000:18:00.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on\n+link LINK1 dev 0000:18:00.1 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on\n+link LINK2 dev 0000:3b:00.0 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on\n+link LINK3 dev 0000:3b:00.1 rxq 1 128 MEMPOOL0 txq 1 512 promiscuous on\n+\n+;\n+; PIPELINE0 setup.\n+;\n+pipeline PIPELINE0 create 0\n+\n+pipeline PIPELINE0 port in 0 link LINK0 rxq 0 bsz 32\n+pipeline PIPELINE0 port in 1 link LINK1 rxq 0 bsz 32\n+pipeline PIPELINE0 port in 2 link LINK2 rxq 0 bsz 32\n+pipeline PIPELINE0 port in 3 link LINK3 rxq 0 bsz 32\n+\n+pipeline PIPELINE0 port out 0 link LINK0 txq 0 bsz 32\n+pipeline PIPELINE0 port out 1 link LINK1 txq 0 bsz 32\n+pipeline PIPELINE0 port out 2 link LINK2 txq 0 bsz 32\n+pipeline PIPELINE0 port out 3 link LINK3 txq 0 bsz 32\n+pipeline PIPELINE0 port out 4 sink none\n+\n+pipeline PIPELINE0 build ./examples/pipeline/examples/varbit.spec\n+\n+;\n+; Pipelines-to-threads mapping.\n+;\n+thread 1 pipeline PIPELINE0 enable\ndiff --git a/examples/pipeline/examples/varbit.spec b/examples/pipeline/examples/varbit.spec\nnew file mode 100644\nindex 0000000000..cd49403fa9\n--- /dev/null\n+++ b/examples/pipeline/examples/varbit.spec\n@@ -0,0 +1,95 @@\n+; SPDX-License-Identifier: BSD-3-Clause\n+; Copyright(c) 2020 Intel Corporation\n+\n+; This simple example illustrates how to work with variable size headers. The assumed input packet\n+; is Ethernet/IPv4/UDP, with the IPv4 header containing between 0 and 40 bytes of options. To locate\n+; the start of the UDP header, the size of the IPv4 header needs to be detected first, which is done\n+; by reading the first byte of the IPv4 header that carries the 4-bit Internet Header Length (IHL)\n+; field; this read is done with the \"lookahead\" instruction, which does not advance the extract\n+; pointer within the input packet buffer. Once the size of the IPv4 header options is known for the\n+; current packet, the IPv4 header is extracted by using the two-argument \"extract\" instruction. Then\n+; the UDP header is extracted and modified.\n+\n+//\n+// Headers\n+//\n+struct ethernet_h {\n+\tbit<48> dst_addr\n+\tbit<48> src_addr\n+\tbit<16> ethertype\n+}\n+\n+struct ipv4_top_h {\n+\tbit<8> ver_ihl\n+}\n+\n+struct ipv4_h {\n+\tbit<8> ver_ihl\n+\tbit<8> diffserv\n+\tbit<16> total_len\n+\tbit<16> identification\n+\tbit<16> flags_offset\n+\tbit<8> ttl\n+\tbit<8> protocol\n+\tbit<16> hdr_checksum\n+\tbit<32> src_addr\n+\tbit<32> dst_addr\n+\tvarbit<320> options\n+}\n+\n+struct udp_h {\n+\tbit<16> src_port\n+\tbit<16> dst_port\n+\tbit<16> length\n+\tbit<16> checksum\n+}\n+\n+header ethernet instanceof ethernet_h\n+header ipv4_top instanceof ipv4_top_h\n+header ipv4 instanceof ipv4_h\n+header udp instanceof udp_h\n+\n+//\n+// Meta-data\n+//\n+struct metadata_t {\n+\tbit<32> port\n+\tbit<32> options_size\n+}\n+\n+metadata instanceof metadata_t\n+\n+//\n+// Pipeline.\n+//\n+apply {\n+\trx m.port\n+\n+\t// Extract the fixed size Ethernet header.\n+\textract h.ethernet\n+\n+\t// Extract the variable size IPv4 header with up to 10 options.\n+\tlookahead h.ipv4_top\n+\tmov m.options_size h.ipv4_top.ver_ihl\n+\tand m.options_size 0xF\n+\tsub m.options_size 5\n+\tshl m.options_size 2\n+\textract h.ipv4 m.options_size\n+\n+\t// Extract the fixed size UDP header.\n+\textract h.udp\n+\n+\t// Modify the UDP header.\n+\tmov h.udp.src_port 0xAABB\n+\tmov h.udp.dst_port 0xCCDD\n+\n+\t// Decide the output port.\n+\txor m.port 1\n+\n+\t// Emit the Ethernet, IPv4 and UDP headers.\n+\temit h.ethernet\n+\temit h.ipv4\n+\temit h.udp\n+\n+\ttx m.port\n+}\n",
    "prefixes": [
        "V2",
        "5/5"
    ]
}