get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96919,
    "url": "http://patches.dpdk.org/api/patches/96919/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210813235232.65757-4-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": "<20210813235232.65757-4-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210813235232.65757-4-cristian.dumitrescu@intel.com",
    "date": "2021-08-13T23:52:32",
    "name": "[4/4] examples/pipeline: add learner table example",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "de48e62b7406105dff9c1660e2160f17cfd80738",
    "submitter": {
        "id": 19,
        "url": "http://patches.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210813235232.65757-4-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 18284,
            "url": "http://patches.dpdk.org/api/series/18284/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=18284",
            "date": "2021-08-13T23:52:30",
            "name": "[1/4] table: add support learner tables",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/18284/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/96919/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/96919/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 8DE6DA0C4B;\n\tSat, 14 Aug 2021 01:52:54 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2DDF341277;\n\tSat, 14 Aug 2021 01:52:42 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id 4458740DDE\n for <dev@dpdk.org>; Sat, 14 Aug 2021 01:52:39 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Aug 2021 16:52:37 -0700",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by fmsmga006.fm.intel.com with ESMTP; 13 Aug 2021 16:52:36 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10075\"; a=\"213796357\"",
            "E=Sophos;i=\"5.84,320,1620716400\"; d=\"scan'208\";a=\"213796357\"",
            "E=Sophos;i=\"5.84,320,1620716400\"; d=\"scan'208\";a=\"674639249\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Sat, 14 Aug 2021 00:52:32 +0100",
        "Message-Id": "<20210813235232.65757-4-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20210813235232.65757-1-cristian.dumitrescu@intel.com>",
        "References": "<20210813235232.65757-1-cristian.dumitrescu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 4/4] examples/pipeline: add learner table 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 learner table usage.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n examples/pipeline/examples/learner.cli  |  35 ++++++++\n examples/pipeline/examples/learner.spec | 109 ++++++++++++++++++++++++\n 2 files changed, 144 insertions(+)\n create mode 100644 examples/pipeline/examples/learner.cli\n create mode 100644 examples/pipeline/examples/learner.spec",
    "diff": "diff --git a/examples/pipeline/examples/learner.cli b/examples/pipeline/examples/learner.cli\nnew file mode 100644\nindex 0000000000..732b6cb85f\n--- /dev/null\n+++ b/examples/pipeline/examples/learner.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/learner.spec\n+\n+;\n+; Pipelines-to-threads mapping.\n+;\n+thread 1 pipeline PIPELINE0 enable\ndiff --git a/examples/pipeline/examples/learner.spec b/examples/pipeline/examples/learner.spec\nnew file mode 100644\nindex 0000000000..0fa56295a6\n--- /dev/null\n+++ b/examples/pipeline/examples/learner.spec\n@@ -0,0 +1,109 @@\n+; SPDX-License-Identifier: BSD-3-Clause\n+; Copyright(c) 2020 Intel Corporation\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_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+}\n+\n+header ethernet instanceof ethernet_h\n+header ipv4 instanceof ipv4_h\n+\n+//\n+// Meta-data\n+//\n+struct metadata_t {\n+\tbit<32> port_in\n+\tbit<32> port_out\n+\n+\t// Arguments for the \"fwd_action\" action.\n+\tbit<32> fwd_action_arg_port_out\n+}\n+\n+metadata instanceof metadata_t\n+\n+//\n+// Registers.\n+//\n+regarray counter size 1 initval 0\n+\n+//\n+// Actions\n+//\n+struct fwd_action_args_t {\n+\tbit<32> port_out\n+}\n+\n+action fwd_action args instanceof fwd_action_args_t {\n+\tmov m.port_out t.port_out\n+\treturn\n+}\n+\n+action learn_action args none {\n+\t// Read current counter value into m.fwd_action_arg_port_out.\n+\tregrd m.fwd_action_arg_port_out counter 0\n+\n+\t// Increment the counter.\n+\tregadd counter 0 1\n+\n+\t// Limit the values of m.fwd_action_arg_port_out to 0 .. 3.\n+\tand m.fwd_action_arg_port_out 3\n+\n+\t// Add the current lookup key to the table. The associated action is fwd_action, with the\n+\t// action parameters read from the packet meta-data starting with the\n+\t// m.fwd_action_arg_port_out field.\n+\tlearn fwd_action\n+\n+\t// Send the current packet to the same output port.\n+\tmov m.port_out m.fwd_action_arg_port_out\n+\n+\treturn\n+}\n+\n+//\n+// Tables.\n+//\n+learner fwd_table {\n+\tkey {\n+\t\th.ipv4.dst_addr\n+\t}\n+\n+\tactions {\n+\t\tfwd_action args m.fwd_action_arg_port_out\n+\t\tlearn_action args none\n+\t}\n+\n+\tdefault_action learn_action args none\n+\tsize 1048576\n+\ttimeout 120\n+}\n+\n+//\n+// Pipeline.\n+//\n+apply {\n+\trx m.port_in\n+\textract h.ethernet\n+\textract h.ipv4\n+\ttable fwd_table\n+\temit h.ethernet\n+\temit h.ipv4\n+\ttx m.port_out\n+}\n",
    "prefixes": [
        "4/4"
    ]
}