get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96926,
    "url": "https://patches.dpdk.org/api/patches/96926/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210814134326.73736-4-cristian.dumitrescu@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": "<20210814134326.73736-4-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210814134326.73736-4-cristian.dumitrescu@intel.com",
    "date": "2021-08-14T13:43:26",
    "name": "[V2,4/4] examples/pipeline: add learner table example",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c273ecfcb8c7757c656e3659745447ba6f32d64a",
    "submitter": {
        "id": 19,
        "url": "https://patches.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210814134326.73736-4-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 18287,
            "url": "https://patches.dpdk.org/api/series/18287/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=18287",
            "date": "2021-08-14T13:43:23",
            "name": "[V2,1/4] table: add support learner tables",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/18287/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/96926/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/96926/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 1FA34A0C57;\n\tSat, 14 Aug 2021 15:43:59 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E6139411FA;\n\tSat, 14 Aug 2021 15:43:36 +0200 (CEST)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n by mails.dpdk.org (Postfix) with ESMTP id B17E14003D\n for <dev@dpdk.org>; Sat, 14 Aug 2021 15:43:32 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 Aug 2021 06:43:32 -0700",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by orsmga002.jf.intel.com with ESMTP; 14 Aug 2021 06:43:31 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10075\"; a=\"215712724\"",
            "E=Sophos;i=\"5.84,321,1620716400\"; d=\"scan'208\";a=\"215712724\"",
            "E=Sophos;i=\"5.84,321,1620716400\"; d=\"scan'208\";a=\"440632463\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Sat, 14 Aug 2021 14:43:26 +0100",
        "Message-Id": "<20210814134326.73736-4-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20210814134326.73736-1-cristian.dumitrescu@intel.com>",
        "References": "<20210813235232.65757-1-cristian.dumitrescu@intel.com>\n <20210814134326.73736-1-cristian.dumitrescu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH V2 4/4] examples/pipeline: add learner table\n 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\nV2: Added description to the .spec file.\n\n examples/pipeline/examples/learner.cli  |  37 +++++++\n examples/pipeline/examples/learner.spec | 127 ++++++++++++++++++++++++\n 2 files changed, 164 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..af7792624f\n--- /dev/null\n+++ b/examples/pipeline/examples/learner.cli\n@@ -0,0 +1,37 @@\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\n+\n+; Once the application has started, the command to get the CLI prompt is: telnet 0.0.0.0 8086\ndiff --git a/examples/pipeline/examples/learner.spec b/examples/pipeline/examples/learner.spec\nnew file mode 100644\nindex 0000000000..d635422282\n--- /dev/null\n+++ b/examples/pipeline/examples/learner.spec\n@@ -0,0 +1,127 @@\n+; SPDX-License-Identifier: BSD-3-Clause\n+; Copyright(c) 2020 Intel Corporation\n+\n+; The learner tables are very useful for learning and connection tracking.\n+;\n+; As opposed to regular tables, which are read-only for the data plane, the learner tables can be\n+; updated by the data plane without any control plane intervention. The \"learning\" process typically\n+; takes place by having the default action (i.e. the table action which is executed on lookup miss)\n+; explicitly add to the table with a specific action the key that just missed the lookup operation.\n+; Each table key expires automatically after a configurable timeout period if not hit during this\n+; interval.\n+;\n+; This example demonstrates a simple connection tracking setup, where the connections are identified\n+; by the IPv4 destination address. The forwarding action assigned to each new connection gets the\n+; output port as argument, with the output port of each connection generated by a counter that is\n+; persistent between packets. On top of the usual table stats, the learner table stats include the\n+; number of packets with learning related events.\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 output port values to 0 .. 3.\n+\tand m.fwd_action_arg_port_out 3\n+\n+\t// Add the current lookup key to the table with fwd_action as the key action. The action\n+\t// arguments are read from the packet meta-data (the m.fwd_action_arg_port_out field). These\n+\t// packet meta-data fields have to be written before the \"learn\" instruction is invoked.\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+\n+\t\tlearn_action args none\n+\t}\n+\n+\tdefault_action learn_action args none\n+\n+\tsize 1048576\n+\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": [
        "V2",
        "4/4"
    ]
}