get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 104725,
    "url": "https://patches.dpdk.org/api/patches/104725/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211127000254.36148-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": "<20211127000254.36148-4-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211127000254.36148-4-cristian.dumitrescu@intel.com",
    "date": "2021-11-27T00:02:54",
    "name": "[V2,4/4] pipeline: add drop port for each pipeline",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a269e30b0aae6164ca363e5579e9532909041d61",
    "submitter": {
        "id": 19,
        "url": "https://patches.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "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/20211127000254.36148-4-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 20794,
            "url": "https://patches.dpdk.org/api/series/20794/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=20794",
            "date": "2021-11-27T00:02:51",
            "name": "[V2,1/4] pipeline: improve the drop instruction",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/20794/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/104725/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/104725/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 AEED5A0C43;\n\tSat, 27 Nov 2021 01:03:15 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3CAC24276D;\n\tSat, 27 Nov 2021 01:03:03 +0100 (CET)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by mails.dpdk.org (Postfix) with ESMTP id AEA964068A\n for <dev@dpdk.org>; Sat, 27 Nov 2021 01:02:59 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 26 Nov 2021 16:02:59 -0800",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by fmsmga001.fm.intel.com with ESMTP; 26 Nov 2021 16:02:58 -0800"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10180\"; a=\"215751236\"",
            "E=Sophos;i=\"5.87,267,1631602800\"; d=\"scan'208\";a=\"215751236\"",
            "E=Sophos;i=\"5.87,267,1631602800\"; d=\"scan'208\";a=\"652292980\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "yogesh.jangra@intel.com",
        "Subject": "[PATCH V2 4/4] pipeline: add drop port for each pipeline",
        "Date": "Sat, 27 Nov 2021 00:02:54 +0000",
        "Message-Id": "<20211127000254.36148-4-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20211127000254.36148-1-cristian.dumitrescu@intel.com>",
        "References": "<20211126235129.35781-1-cristian.dumitrescu@intel.com>\n <20211127000254.36148-1-cristian.dumitrescu@intel.com>",
        "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"
    },
    "content": "An additional output port is now implicitly created for every pipeline\nto serve as the packet drop port. Up to now, the drop port had to be\nexplicitly created for each pipeline.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\nSigned-off-by: Yogesh Jangra <yogesh.jangra@intel.com>\n---\n examples/pipeline/cli.c                   | 15 +++++++++++----\n examples/pipeline/examples/fib.cli        |  1 -\n examples/pipeline/examples/learner.cli    |  1 -\n examples/pipeline/examples/selector.cli   |  1 -\n examples/pipeline/examples/varbit.cli     |  1 -\n examples/pipeline/examples/vxlan.cli      |  1 -\n examples/pipeline/examples/vxlan_pcap.cli |  1 -\n lib/pipeline/rte_swx_pipeline.c           | 11 +++++++++++\n 8 files changed, 22 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c\nindex 83b460caf6..c32349e5f0 100644\n--- a/examples/pipeline/cli.c\n+++ b/examples/pipeline/cli.c\n@@ -2551,10 +2551,17 @@ cmd_pipeline_stats(char **tokens,\n \n \t\trte_swx_ctl_pipeline_port_out_stats_read(p->p, i, &stats);\n \n-\t\tsnprintf(out, out_size, \"\\tPort %u:\"\n-\t\t\t\" packets %\" PRIu64\n-\t\t\t\" bytes %\" PRIu64 \"\\n\",\n-\t\t\ti, stats.n_pkts, stats.n_bytes);\n+\t\tif (i != info.n_ports_out - 1)\n+\t\t\tsnprintf(out, out_size, \"\\tPort %u:\"\n+\t\t\t\t\" packets %\" PRIu64\n+\t\t\t\t\" bytes %\" PRIu64 \"\\n\",\n+\t\t\t\ti, stats.n_pkts, stats.n_bytes);\n+\t\telse\n+\t\t\tsnprintf(out, out_size, \"\\tDROP:\"\n+\t\t\t\t\" packets %\" PRIu64\n+\t\t\t\t\" bytes %\" PRIu64 \"\\n\",\n+\t\t\t\tstats.n_pkts, stats.n_bytes);\n+\n \t\tout_size -= strlen(out);\n \t\tout += strlen(out);\n \t}\ndiff --git a/examples/pipeline/examples/fib.cli b/examples/pipeline/examples/fib.cli\nindex b20aed3cf6..93ab2b08f8 100644\n--- a/examples/pipeline/examples/fib.cli\n+++ b/examples/pipeline/examples/fib.cli\n@@ -25,7 +25,6 @@ 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/fib.spec\n \ndiff --git a/examples/pipeline/examples/learner.cli b/examples/pipeline/examples/learner.cli\nindex af7792624f..688ce34f34 100644\n--- a/examples/pipeline/examples/learner.cli\n+++ b/examples/pipeline/examples/learner.cli\n@@ -25,7 +25,6 @@ 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 \ndiff --git a/examples/pipeline/examples/selector.cli b/examples/pipeline/examples/selector.cli\nindex 36f3ead541..123782c57b 100644\n--- a/examples/pipeline/examples/selector.cli\n+++ b/examples/pipeline/examples/selector.cli\n@@ -19,7 +19,6 @@ 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 \ndiff --git a/examples/pipeline/examples/varbit.cli b/examples/pipeline/examples/varbit.cli\nindex 0589e32c15..9caeb9ca26 100644\n--- a/examples/pipeline/examples/varbit.cli\n+++ b/examples/pipeline/examples/varbit.cli\n@@ -25,7 +25,6 @@ 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 \ndiff --git a/examples/pipeline/examples/vxlan.cli b/examples/pipeline/examples/vxlan.cli\nindex a3bde6a9f9..444f3f7bd8 100644\n--- a/examples/pipeline/examples/vxlan.cli\n+++ b/examples/pipeline/examples/vxlan.cli\n@@ -19,7 +19,6 @@ 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/vxlan.spec\n pipeline PIPELINE0 table vxlan_table add ./examples/pipeline/examples/vxlan_table.txt\ndiff --git a/examples/pipeline/examples/vxlan_pcap.cli b/examples/pipeline/examples/vxlan_pcap.cli\nindex c03dc9303d..83fca8d0d9 100644\n--- a/examples/pipeline/examples/vxlan_pcap.cli\n+++ b/examples/pipeline/examples/vxlan_pcap.cli\n@@ -14,7 +14,6 @@ pipeline PIPELINE0 port out 0 sink none\n pipeline PIPELINE0 port out 1 sink none\n pipeline PIPELINE0 port out 2 sink none\n pipeline PIPELINE0 port out 3 sink none\n-pipeline PIPELINE0 port out 4 sink none\n \n pipeline PIPELINE0 build ./examples/pipeline/examples/vxlan.spec\n pipeline PIPELINE0 table vxlan_table add ./examples/pipeline/examples/vxlan_table.txt\ndiff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c\nindex dd914fd935..c332d44bd1 100644\n--- a/lib/pipeline/rte_swx_pipeline.c\n+++ b/lib/pipeline/rte_swx_pipeline.c\n@@ -9199,6 +9199,9 @@ pipeline_compile(struct rte_swx_pipeline *p);\n int\n rte_swx_pipeline_build(struct rte_swx_pipeline *p)\n {\n+\tstruct rte_swx_port_sink_params drop_port_params = {\n+\t\t.file_name = NULL,\n+\t};\n \tint status;\n \n \tCHECK(p, EINVAL);\n@@ -9208,6 +9211,14 @@ rte_swx_pipeline_build(struct rte_swx_pipeline *p)\n \tif (status)\n \t\tgoto error;\n \n+\t/* Drop port. */\n+\tstatus = rte_swx_pipeline_port_out_config(p,\n+\t\t\t\t\t\t  p->n_ports_out,\n+\t\t\t\t\t\t  \"sink\",\n+\t\t\t\t\t\t  &drop_port_params);\n+\tif (status)\n+\t\tgoto error;\n+\n \tstatus = port_out_build(p);\n \tif (status)\n \t\tgoto error;\n",
    "prefixes": [
        "V2",
        "4/4"
    ]
}