get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 17046,
    "url": "http://patches.dpdk.org/api/patches/17046/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/5d8429bfe55aa87354d239e19b42debabf56b136.1479309720.git.adrien.mazarguil@6wind.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": "<5d8429bfe55aa87354d239e19b42debabf56b136.1479309720.git.adrien.mazarguil@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/5d8429bfe55aa87354d239e19b42debabf56b136.1479309720.git.adrien.mazarguil@6wind.com",
    "date": "2016-11-16T16:23:48",
    "name": "[dpdk-dev,22/22] app/testpmd: add queue actions to flow command",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "45f09cf784a94f06e2604d7a4a3bd0c6d0f4ce02",
    "submitter": {
        "id": 165,
        "url": "http://patches.dpdk.org/api/people/165/?format=api",
        "name": "Adrien Mazarguil",
        "email": "adrien.mazarguil@6wind.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/5d8429bfe55aa87354d239e19b42debabf56b136.1479309720.git.adrien.mazarguil@6wind.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/17046/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/17046/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 87502D508;\n\tWed, 16 Nov 2016 17:25:50 +0100 (CET)",
            "from mail-wm0-f41.google.com (mail-wm0-f41.google.com\n\t[74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 012CB58C8\n\tfor <dev@dpdk.org>; Wed, 16 Nov 2016 17:24:59 +0100 (CET)",
            "by mail-wm0-f41.google.com with SMTP id a197so249951581wmd.0\n\tfor <dev@dpdk.org>; Wed, 16 Nov 2016 08:24:59 -0800 (PST)",
            "from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net.\n\t[82.239.227.177]) by smtp.gmail.com with ESMTPSA id\n\tv202sm10954626wmv.8.2016.11.16.08.24.58\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tWed, 16 Nov 2016 08:24:58 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=tIiw/DdzMS+ERw5pzoYAdVukWTugfoMERIOVhZPgesY=;\n\tb=XOFlA1xnTb/cOeMhDST/kOtmOkaNqVwe7DTj6fycYLv3txvTtKS67UfWpIhChH5QH0\n\tzxlRj7MjzMm69GxXp/7iPQ5hN/wNjoKXqENZowTh4aCr0S4ijqgaznmwCwlrv9JMTMD4\n\t0tzsVMI7ZtpCtcu/XeYGn16lqO+gb0HO90EsXQDH4wqcgP/9NpL1lVtrK3dF9Pc2GGR6\n\tBSvNgBFQVddAY8ypoK6nKdBLmQZY4yAA/BrIJwHmcvbvQ0DIIaXdtkGye+bU42iTcrS9\n\tSeK0i915+CX6ybH/Lr7+iHVosmDjrnI5vaQ8CrBTH5hEn9j6RF7kygloAwPxO9660juZ\n\tj56g==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=tIiw/DdzMS+ERw5pzoYAdVukWTugfoMERIOVhZPgesY=;\n\tb=mn04IuVnN3RuazDvq7QO2NnhQZTW2FR03bisEB5o8HeoIcYXJKCpPLS9G1SyD0OugG\n\toc6dhmOrIXNDmM+slCcL+HCCpwMsBabjrlSb0JQBHkxR98bFWL2z82zuIDgv33SUQnXT\n\t4Vl/1UpSnxsmFJvG3n/UFTgD52ZaHu0IKfqLEze1ebGoJ5V/06bnt8olh6UI3MgXwMDu\n\tzbdYq7YZbFwOXHEHwc6KzJdaKbxScJN9kilxK/jXPWLDS9Rc37zYDSZS8UNb0giXMcOZ\n\tw2elR3cYWPR9DfHbHs+2ipLkDa7jFljm0/oAjNmnNXPYKsaiPDHQQ8WyfX2i1wDohpz1\n\t1fiQ==",
        "X-Gm-Message-State": "ABUngvdPWoOvs2UBm+jpiReQAtDlx56sbe0lCl8FKOmmgU+J23OSO6rP5698BTTGBakJQ2+K",
        "X-Received": "by 10.194.96.110 with SMTP id dr14mr2615479wjb.209.1479313499307;\n\tWed, 16 Nov 2016 08:24:59 -0800 (PST)",
        "From": "Adrien Mazarguil <adrien.mazarguil@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "Thomas Monjalon <thomas.monjalon@6wind.com>,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>,\n\tOlivier Matz <olivier.matz@6wind.com>",
        "Date": "Wed, 16 Nov 2016 17:23:48 +0100",
        "Message-Id": "<5d8429bfe55aa87354d239e19b42debabf56b136.1479309720.git.adrien.mazarguil@6wind.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<cover.1479309719.git.adrien.mazarguil@6wind.com>",
        "References": "<cover.1471632644.git.adrien.mazarguil@6wind.com>\n\t<cover.1479309719.git.adrien.mazarguil@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH 22/22] app/testpmd: add queue actions to flow\n\tcommand",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "- QUEUE: assign packets to a given queue index.\n- DUP: duplicate packets to a given queue index.\n- RSS: spread packets among several queues.\n\nSigned-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>\n---\n app/test-pmd/cmdline_flow.c | 152 +++++++++++++++++++++++++++++++++++++++\n 1 file changed, 152 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex e166045..70e2b76 100644\n--- a/app/test-pmd/cmdline_flow.c\n+++ b/app/test-pmd/cmdline_flow.c\n@@ -157,8 +157,15 @@ enum index {\n \tACTION_MARK,\n \tACTION_MARK_ID,\n \tACTION_FLAG,\n+\tACTION_QUEUE,\n+\tACTION_QUEUE_INDEX,\n \tACTION_DROP,\n \tACTION_COUNT,\n+\tACTION_DUP,\n+\tACTION_DUP_INDEX,\n+\tACTION_RSS,\n+\tACTION_RSS_QUEUES,\n+\tACTION_RSS_QUEUE,\n \tACTION_PF,\n \tACTION_VF,\n \tACTION_VF_ORIGINAL,\n@@ -172,6 +179,14 @@ enum index {\n #define ITEM_RAW_SIZE \\\n \t(offsetof(struct rte_flow_item_raw, pattern) + ITEM_RAW_PATTERN_SIZE)\n \n+/** Number of queue[] entries in struct rte_flow_action_rss. */\n+#define ACTION_RSS_NUM 32\n+\n+/** Storage size for struct rte_flow_action_rss including queues. */\n+#define ACTION_RSS_SIZE \\\n+\t(offsetof(struct rte_flow_action_rss, queue) + \\\n+\t sizeof(*((struct rte_flow_action_rss *)0)->queue) * ACTION_RSS_NUM)\n+\n /** Maximum number of subsequent tokens and arguments on the stack. */\n #define CTX_STACK_SIZE 16\n \n@@ -489,8 +504,11 @@ static const enum index next_action[] = {\n \tACTION_PASSTHRU,\n \tACTION_MARK,\n \tACTION_FLAG,\n+\tACTION_QUEUE,\n \tACTION_DROP,\n \tACTION_COUNT,\n+\tACTION_DUP,\n+\tACTION_RSS,\n \tACTION_PF,\n \tACTION_VF,\n \t0,\n@@ -502,6 +520,24 @@ static const enum index action_mark[] = {\n \t0,\n };\n \n+static const enum index action_queue[] = {\n+\tACTION_QUEUE_INDEX,\n+\tACTION_NEXT,\n+\t0,\n+};\n+\n+static const enum index action_dup[] = {\n+\tACTION_DUP_INDEX,\n+\tACTION_NEXT,\n+\t0,\n+};\n+\n+static const enum index action_rss[] = {\n+\tACTION_RSS_QUEUES,\n+\tACTION_NEXT,\n+\t0,\n+};\n+\n static const enum index action_vf[] = {\n \tACTION_VF_ORIGINAL,\n \tACTION_VF_ID,\n@@ -519,6 +555,9 @@ static int parse_vc_spec(struct context *, const struct token *,\n \t\t\t const char *, unsigned int, void *, unsigned int);\n static int parse_vc_conf(struct context *, const struct token *,\n \t\t\t const char *, unsigned int, void *, unsigned int);\n+static int parse_vc_action_rss_queue(struct context *, const struct token *,\n+\t\t\t\t     const char *, unsigned int, void *,\n+\t\t\t\t     unsigned int);\n static int parse_destroy(struct context *, const struct token *,\n \t\t\t const char *, unsigned int,\n \t\t\t void *, unsigned int);\n@@ -568,6 +607,8 @@ static int comp_port(struct context *, const struct token *,\n \t\t     unsigned int, char *, unsigned int);\n static int comp_rule_id(struct context *, const struct token *,\n \t\t\tunsigned int, char *, unsigned int);\n+static int comp_vc_action_rss_queue(struct context *, const struct token *,\n+\t\t\t\t    unsigned int, char *, unsigned int);\n \n /** Token definitions. */\n static const struct token token_list[] = {\n@@ -1169,6 +1210,21 @@ static const struct token token_list[] = {\n \t\t.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),\n \t\t.call = parse_vc,\n \t},\n+\t[ACTION_QUEUE] = {\n+\t\t.name = \"queue\",\n+\t\t.help = \"assign packets to a given queue index\",\n+\t\t.priv = PRIV_ACTION(QUEUE,\n+\t\t\t\t    sizeof(struct rte_flow_action_queue)),\n+\t\t.next = NEXT(action_queue),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ACTION_QUEUE_INDEX] = {\n+\t\t.name = \"index\",\n+\t\t.help = \"queue index to use\",\n+\t\t.next = NEXT(action_queue, NEXT_ENTRY(UNSIGNED)),\n+\t\t.args = ARGS(ARGS_ENTRY(struct rte_flow_action_queue, index)),\n+\t\t.call = parse_vc_conf,\n+\t},\n \t[ACTION_DROP] = {\n \t\t.name = \"drop\",\n \t\t.help = \"drop packets (note: passthru has priority)\",\n@@ -1183,6 +1239,39 @@ static const struct token token_list[] = {\n \t\t.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),\n \t\t.call = parse_vc,\n \t},\n+\t[ACTION_DUP] = {\n+\t\t.name = \"dup\",\n+\t\t.help = \"duplicate packets to a given queue index\",\n+\t\t.priv = PRIV_ACTION(DUP, sizeof(struct rte_flow_action_dup)),\n+\t\t.next = NEXT(action_dup),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ACTION_DUP_INDEX] = {\n+\t\t.name = \"index\",\n+\t\t.help = \"queue index to duplicate packets to\",\n+\t\t.next = NEXT(action_dup, NEXT_ENTRY(UNSIGNED)),\n+\t\t.args = ARGS(ARGS_ENTRY(struct rte_flow_action_dup, index)),\n+\t\t.call = parse_vc_conf,\n+\t},\n+\t[ACTION_RSS] = {\n+\t\t.name = \"rss\",\n+\t\t.help = \"spread packets among several queues\",\n+\t\t.priv = PRIV_ACTION(RSS, ACTION_RSS_SIZE),\n+\t\t.next = NEXT(action_rss),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ACTION_RSS_QUEUES] = {\n+\t\t.name = \"queues\",\n+\t\t.help = \"queue indices to use\",\n+\t\t.next = NEXT(action_rss, NEXT_ENTRY(ACTION_RSS_QUEUE)),\n+\t\t.call = parse_vc_conf,\n+\t},\n+\t[ACTION_RSS_QUEUE] = {\n+\t\t.name = \"{queue}\",\n+\t\t.help = \"queue index\",\n+\t\t.call = parse_vc_action_rss_queue,\n+\t\t.comp = comp_vc_action_rss_queue,\n+\t},\n \t[ACTION_PF] = {\n \t\t.name = \"pf\",\n \t\t.help = \"redirect packets to physical device function\",\n@@ -1562,6 +1651,51 @@ parse_vc_conf(struct context *ctx, const struct token *token,\n \treturn len;\n }\n \n+/**\n+ * Parse queue field for RSS action.\n+ *\n+ * Valid tokens are queue indices and the \"end\" token.\n+ */\n+static int\n+parse_vc_action_rss_queue(struct context *ctx, const struct token *token,\n+\t\t\t  const char *str, unsigned int len,\n+\t\t\t  void *buf, unsigned int size)\n+{\n+\tstatic const enum index const next[] = NEXT_ENTRY(ACTION_RSS_QUEUE);\n+\tint ret;\n+\tint i;\n+\n+\t(void)token;\n+\t(void)buf;\n+\t(void)size;\n+\tif (ctx->curr != ACTION_RSS_QUEUE)\n+\t\treturn -1;\n+\ti = ctx->objdata >> 16;\n+\tif (!strncmp(str, \"end\", len)) {\n+\t\tctx->objdata &= 0xffff;\n+\t\treturn len;\n+\t}\n+\tif (i >= ACTION_RSS_NUM)\n+\t\treturn -1;\n+\tif (push_args(ctx, ARGS_ENTRY(struct rte_flow_action_rss, queue[i])))\n+\t\treturn -1;\n+\tret = parse_int(ctx, token, str, len, NULL, 0);\n+\tif (ret < 0) {\n+\t\tpop_args(ctx);\n+\t\treturn -1;\n+\t}\n+\t++i;\n+\tctx->objdata = i << 16 | (ctx->objdata & 0xffff);\n+\t/* Repeat token. */\n+\tif (ctx->next_num == RTE_DIM(ctx->next))\n+\t\treturn -1;\n+\tctx->next[ctx->next_num++] = next;\n+\tif (!ctx->object)\n+\t\treturn len;\n+\t((struct rte_flow_action_rss *)ctx->object)->queues = i;\n+\treturn len;\n+}\n+\n /** Parse tokens for destroy command. */\n static int\n parse_destroy(struct context *ctx, const struct token *token,\n@@ -2136,6 +2270,24 @@ comp_rule_id(struct context *ctx, const struct token *token,\n \treturn i;\n }\n \n+/** Complete queue field for RSS action. */\n+static int\n+comp_vc_action_rss_queue(struct context *ctx, const struct token *token,\n+\t\t\t unsigned int ent, char *buf, unsigned int size)\n+{\n+\tstatic const char *const str[] = { \"\", \"end\", NULL };\n+\tunsigned int i;\n+\n+\t(void)ctx;\n+\t(void)token;\n+\tfor (i = 0; str[i] != NULL; ++i)\n+\t\tif (buf && i == ent)\n+\t\t\treturn snprintf(buf, size, \"%s\", str[i]);\n+\tif (buf)\n+\t\treturn -1;\n+\treturn i;\n+}\n+\n /** Internal context. */\n static struct context cmd_flow_context;\n \n",
    "prefixes": [
        "dpdk-dev",
        "22/22"
    ]
}