get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 95637,
    "url": "http://patches.dpdk.org/api/patches/95637/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210710002036.53550-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": "<20210710002036.53550-5-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210710002036.53550-5-cristian.dumitrescu@intel.com",
    "date": "2021-07-10T00:20:36",
    "name": "[V4,5/5] examples/pipeline: add selector example",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "085143c689a5c63e53b5aabbf12e67f907b0604e",
    "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/20210710002036.53550-5-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 17748,
            "url": "http://patches.dpdk.org/api/series/17748/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=17748",
            "date": "2021-07-10T00:20:33",
            "name": "[V4,1/5] examples/pipeline: improve table update CLI commands",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/17748/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/95637/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/95637/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 6FA51A0548;\n\tSat, 10 Jul 2021 02:21:12 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 76BE141759;\n\tSat, 10 Jul 2021 02:20:49 +0200 (CEST)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n by mails.dpdk.org (Postfix) with ESMTP id ED07F411A9\n for <dev@dpdk.org>; Sat, 10 Jul 2021 02:20:44 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Jul 2021 17:20:43 -0700",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by fmsmga004.fm.intel.com with ESMTP; 09 Jul 2021 17:20:43 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10040\"; a=\"209839176\"",
            "E=Sophos;i=\"5.84,228,1620716400\"; d=\"scan'208\";a=\"209839176\"",
            "E=Sophos;i=\"5.84,228,1620716400\"; d=\"scan'208\";a=\"483941914\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org,\n\tthomas@monjalon.net",
        "Date": "Sat, 10 Jul 2021 01:20:36 +0100",
        "Message-Id": "<20210710002036.53550-5-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20210710002036.53550-1-cristian.dumitrescu@intel.com>",
        "References": "<20210702224608.66233-3-cristian.dumitrescu@intel.com>\n <20210710002036.53550-1-cristian.dumitrescu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH V4 5/5] examples/pipeline: add selector 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 selector table usage.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n examples/pipeline/examples/selector.cli  | 31 ++++++++\n examples/pipeline/examples/selector.spec | 95 ++++++++++++++++++++++++\n examples/pipeline/examples/selector.txt  |  4 +\n 3 files changed, 130 insertions(+)\n create mode 100644 examples/pipeline/examples/selector.cli\n create mode 100644 examples/pipeline/examples/selector.spec\n create mode 100644 examples/pipeline/examples/selector.txt",
    "diff": "diff --git a/examples/pipeline/examples/selector.cli b/examples/pipeline/examples/selector.cli\nnew file mode 100644\nindex 000000000..36f3ead54\n--- /dev/null\n+++ b/examples/pipeline/examples/selector.cli\n@@ -0,0 +1,31 @@\n+; SPDX-License-Identifier: BSD-3-Clause\n+; Copyright(c) 2020 Intel Corporation\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+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/selector.spec\n+\n+pipeline PIPELINE0 selector s group add\n+pipeline PIPELINE0 selector s group member add ./examples/pipeline/examples/selector.txt\n+pipeline PIPELINE0 commit\n+pipeline PIPELINE0 selector s show\n+\n+thread 1 pipeline PIPELINE0 enable\ndiff --git a/examples/pipeline/examples/selector.spec b/examples/pipeline/examples/selector.spec\nnew file mode 100644\nindex 000000000..72e49cb1d\n--- /dev/null\n+++ b/examples/pipeline/examples/selector.spec\n@@ -0,0 +1,95 @@\n+; SPDX-License-Identifier: BSD-3-Clause\n+; Copyright(c) 2020 Intel Corporation\n+\n+; A selector table is made out of groups of weighted members, with a given member potentially part\n+; of several groups. The select operation returns a member ID by first selecting a group based on an\n+; input group ID and then selecting a member within that group by hashing one or several input\n+; header or meta-data fields. It is very useful for implementing an Equal-Cost Multi-Path (ECMP) or\n+; Weighted-Cost Multi-Path (WCMP) enabled FIB or a load balancer. It is part of the action selector\n+; construct described by the P4 Portable Switch Architecture (PSA) specification.\n+;\n+; Normally, an action selector FIB is built with a routing table (the base table), a selector table\n+; (the group table) and a next hop table (the member table). One of the routing table actions sets\n+; up the group ID meta-data field used as the index into the group table, which produces the member\n+; ID meta-data field, i.e. the next hop ID that is used as the index into the next hop table. The\n+; next hop action prepares the output packet for being sent next hop in the network by prepending\n+; one or several headers to the packet (Ethernet at the very least), decrementing the TTL and\n+; recomputing the IPv4 checksum, etc. The selector allows for multiple next hops to be specified\n+; for any given route as opposed to a single next hop per route; for every packet, its next hop is\n+; picked out of the set of next hops defined for the route while preserving the packet ordering\n+; within the flow, with the flow defined by the selector n-tuple fields.\n+;\n+; In this simple example, the base table and the member table are striped out in order to focus\n+; exclusively on illustrating the selector table. The group_id is read from the destination MAC\n+; address and the selector n-tuple is represented by the Protocol, the source IP address and the\n+; destination IP address fields. The member_id produced by the selector table is used to identify\n+; the output port which facilitates the testing of different member weights by simply comparing the\n+; rates of output packets sent on different ports.\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+\tbit<32> group_id\n+}\n+\n+metadata instanceof metadata_t\n+\n+//\n+// Selectors.\n+//\n+selector s {\n+\tgroup_id m.group_id\n+\n+\tselector {\n+\t\th.ipv4.protocol\n+\t\th.ipv4.src_addr\n+\t\th.ipv4.dst_addr\n+\t}\n+\n+\tmember_id m.port_out\n+\n+\tn_groups_max 64\n+\tn_members_per_group_max 16\n+}\n+\n+//\n+// Pipeline.\n+//\n+apply {\n+\trx m.port_in\n+\textract h.ethernet\n+\textract h.ipv4\n+\tmov m.group_id h.ethernet.dst_addr\n+\ttable s\n+\temit h.ethernet\n+\temit h.ipv4\n+\ttx m.port_out\n+}\ndiff --git a/examples/pipeline/examples/selector.txt b/examples/pipeline/examples/selector.txt\nnew file mode 100644\nindex 000000000..b3c83c773\n--- /dev/null\n+++ b/examples/pipeline/examples/selector.txt\n@@ -0,0 +1,4 @@\n+group 0 member 0 weight 1\n+group 0 member 1 weight 1\n+group 0 member 2 weight 2\n+group 0 member 3 weight 4\n",
    "prefixes": [
        "V4",
        "5/5"
    ]
}