get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50272,
    "url": "http://patchwork.dpdk.org/api/patches/50272/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20180211132905.7502-2-georgina.sheehan@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20180211132905.7502-2-georgina.sheehan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180211132905.7502-2-georgina.sheehan@intel.com",
    "date": "2018-02-11T13:29:04",
    "name": "[v2,2/3] pipeline: add implementation for DSCP action",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "4bcafc12e5f21ea0eb83d3b12027af4a34e5e80b",
    "submitter": {
        "id": 1219,
        "url": "http://patchwork.dpdk.org/api/people/1219/?format=api",
        "name": "Sheehan,Georgina",
        "email": "georgina.sheehan@intel.com"
    },
    "delegate": {
        "id": 10018,
        "url": "http://patchwork.dpdk.org/api/users/10018/?format=api",
        "username": "cristian_dumitrescu",
        "first_name": "Cristian",
        "last_name": "Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20180211132905.7502-2-georgina.sheehan@intel.com/mbox/",
    "series": [
        {
            "id": 3428,
            "url": "http://patchwork.dpdk.org/api/series/3428/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=3428",
            "date": "2018-02-11T13:29:03",
            "name": "[v2,1/3] librte_pipeline: add support for DSCP action",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/3428/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/50272/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/50272/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 610591B39B;\n\tTue, 12 Feb 2019 15:03:16 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 05AC21B3A2\n\tfor <dev@dpdk.org>; Tue, 12 Feb 2019 15:03:13 +0100 (CET)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Feb 2019 06:03:12 -0800",
            "from silpixa00399837.ir.intel.com (HELO\n\tsilpixa00399837.ger.corp.intel.com) ([10.237.223.162])\n\tby orsmga004.jf.intel.com with ESMTP; 12 Feb 2019 06:03:12 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,362,1544515200\"; d=\"scan'208\";a=\"274432477\"",
        "From": "\"Sheehan,Georgina\" <georgina.sheehan@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "cristian.dumitrescu@intel.com,\n\tGeorgina Sheehan <georgina.sheehan@intel.com>",
        "Date": "Sun, 11 Feb 2018 13:29:04 +0000",
        "Message-Id": "<20180211132905.7502-2-georgina.sheehan@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20180211132905.7502-1-georgina.sheehan@intel.com>",
        "References": "<20180211085722.59717-1-georgina.sheehan@intel.com>\n\t<20180211132905.7502-1-georgina.sheehan@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 2/3] pipeline: add implementation for DSCP\n\taction",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Georgina Sheehan <georgina.sheehan@intel.com>\n\nThis allows the application to change the DSCP value of incoming packets\n\nv2: Added in call of function parse_table_action_dscp in softnic cli file\n\nSigned-off-by: Georgina Sheehan <georgina.sheehan@intel.com>\n---\n examples/ip_pipeline/action.c   | 11 +++++++\n examples/ip_pipeline/action.h   |  1 +\n examples/ip_pipeline/cli.c      | 52 ++++++++++++++++++++++++++++++++-\n examples/ip_pipeline/pipeline.h |  1 +\n examples/ip_pipeline/thread.c   | 10 +++++++\n 5 files changed, 74 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/examples/ip_pipeline/action.c b/examples/ip_pipeline/action.c\nindex d2104aad6..625c870a2 100644\n--- a/examples/ip_pipeline/action.c\n+++ b/examples/ip_pipeline/action.c\n@@ -366,6 +366,17 @@ table_action_profile_create(const char *name,\n \t\t}\n \t}\n \n+\tif (params->action_mask & (1LLU << RTE_TABLE_ACTION_DSCP)) {\n+\t\tstatus = rte_table_action_profile_action_register(ap,\n+\t\t\t\tRTE_TABLE_ACTION_DSCP,\n+\t\t\t\t&params->dscp);\n+\n+\t\tif (status) {\n+\t\t\trte_table_action_profile_free(ap);\n+\t\t\treturn NULL;\n+\t\t}\n+\t}\n+\n \tstatus = rte_table_action_profile_freeze(ap);\n \tif (status) {\n \t\trte_table_action_profile_free(ap);\ndiff --git a/examples/ip_pipeline/action.h b/examples/ip_pipeline/action.h\nindex cde17e69a..ea8f81c56 100644\n--- a/examples/ip_pipeline/action.h\n+++ b/examples/ip_pipeline/action.h\n@@ -54,6 +54,7 @@ struct table_action_profile_params {\n \tstruct rte_table_action_ttl_config ttl;\n \tstruct rte_table_action_stats_config stats;\n \tstruct rte_table_action_sym_crypto_config sym_crypto;\n+\tstruct rte_table_action_dscp_config dscp;\n };\n \n struct table_action_profile {\ndiff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c\nindex a92467e63..ca3083a48 100644\n--- a/examples/ip_pipeline/cli.c\n+++ b/examples/ip_pipeline/cli.c\n@@ -1045,7 +1045,8 @@ static const char cmd_table_action_profile_help[] =\n \"   [time]\\n\"\n \"   [sym_crypto dev <CRYPTODEV_NAME> offset <op_offset>]\\n\"\n \"   [tag]\\n\"\n-\"   [decap]\\n\";\n+\"   [decap]\\n\"\n+\"   [dscp]\\n\";\n \n static void\n cmd_table_action_profile(char **tokens,\n@@ -1458,6 +1459,17 @@ cmd_table_action_profile(char **tokens,\n \t\tt0 += 1;\n \t} /* decap */\n \n+\tif ((t0 < n_tokens) && (strcmp(tokens[t0], \"dscp\") == 0)) {\n+\t\tif (n_tokens < t0 + 1) {\n+\t\t\tsnprintf(out, out_size, MSG_ARG_MISMATCH,\n+\t\t\t\t\"table action profile dscp\");\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tp.action_mask |= 1LLU << RTE_TABLE_ACTION_DSCP;\n+\t\tt0 += 1;\n+\t} /** DSCP **/\n+\n \tif (t0 < n_tokens) {\n \t\tsnprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);\n \t\treturn;\n@@ -3116,6 +3128,7 @@ parse_match(char **tokens,\n  *       data_offset <data_offset>]\n  *    [tag <tag>]\n  *    [decap <n>]\n+ *    [dscp <n>]\n  *\n  * where:\n  *    <pa> ::= g | y | r | drop\n@@ -4108,6 +4121,26 @@ parse_table_action_decap(char **tokens,\n \treturn 2;\n }\n \n+static uint32_t\n+parse_table_action_dscp(char **tokens,\n+\t\tuint32_t n_tokens,\n+\t\tstruct table_rule_action *a)\n+{\n+\tif ((n_tokens < 2) ||\n+\t\tstrcmp(tokens[0], \"dscp\"))\n+\t\treturn 0;\n+\n+\tuint8_t dscp_val;\n+\n+\tif (parser_read_uint8(&dscp_val, tokens[1]))\n+\t\treturn 0;\n+\n+\ta->dscp.dscp_val = dscp_val;\n+\n+\ta->action_mask |= 1 << RTE_TABLE_ACTION_DSCP;\n+\treturn 2;\n+}\n+\n static uint32_t\n parse_table_action(char **tokens,\n \tuint32_t n_tokens,\n@@ -4293,6 +4326,20 @@ parse_table_action(char **tokens,\n \t\tn_tokens -= n;\n \t}\n \n+\tif (n_tokens && (strcmp(tokens[0], \"dscp\") == 0)) {\n+\t\tuint32_t n;\n+\n+\t\tn = parse_table_action_dscp(tokens, n_tokens, a);\n+\t\tif (n == 0) {\n+\t\t\tsnprintf(out, out_size, MSG_ARG_INVALID,\n+\t\t\t\t\"action dscp\");\n+\t\t\treturn 0;\n+\t\t}\n+\n+\t\ttokens += n;\n+\t\tn_tokens -= n;\n+\t}\n+\n \tif (n_tokens0 - n_tokens == 1) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"action\");\n \t\treturn 0;\n@@ -5056,6 +5103,9 @@ table_rule_show(const char *pipeline_name,\n \t\tif (a->action_mask & (1LLU << RTE_TABLE_ACTION_DECAP))\n \t\t\tfprintf(f, \"decap %u \", a->decap.n);\n \n+\t\tif (a->action_mask & (1LLU << RTE_TABLE_ACTION_DSCP))\n+\t\t\tfprintf(f, \"dscp \");\n+\n \t\t/* end */\n \t\tfprintf(f, \"\\n\");\n \t}\ndiff --git a/examples/ip_pipeline/pipeline.h b/examples/ip_pipeline/pipeline.h\nindex 278775c2d..670174ed4 100644\n--- a/examples/ip_pipeline/pipeline.h\n+++ b/examples/ip_pipeline/pipeline.h\n@@ -290,6 +290,7 @@ struct table_rule_action {\n \tstruct rte_table_action_sym_crypto_params sym_crypto;\n \tstruct rte_table_action_tag_params tag;\n \tstruct rte_table_action_decap_params decap;\n+\tstruct rte_table_action_dscp_params dscp;\n };\n \n struct table_rule {\ndiff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c\nindex 272fbbeed..c9facb53e 100644\n--- a/examples/ip_pipeline/thread.c\n+++ b/examples/ip_pipeline/thread.c\n@@ -2751,6 +2751,16 @@ action_convert(struct rte_table_action *a,\n \t\t\treturn status;\n \t}\n \n+\tif (action->action_mask & (1LLU << RTE_TABLE_ACTION_DSCP)) {\n+\t\tstatus = rte_table_action_apply(a,\n+\t\t\tdata,\n+\t\t\tRTE_TABLE_ACTION_DSCP,\n+\t\t\t&action->dscp);\n+\n+\t\tif (status)\n+\t\t\treturn status;\n+\t}\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "v2",
        "2/3"
    ]
}