get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 22671,
    "url": "http://patches.dpdk.org/api/patches/22671/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/2a99263e0ab95c4af08ffb2dc17084a72b9265ee.1490773631.git.nelio.laranjeiro@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": "<2a99263e0ab95c4af08ffb2dc17084a72b9265ee.1490773631.git.nelio.laranjeiro@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/2a99263e0ab95c4af08ffb2dc17084a72b9265ee.1490773631.git.nelio.laranjeiro@6wind.com",
    "date": "2017-03-29T07:53:38",
    "name": "[dpdk-dev,1/2] net/mlx5: remove duplicated process",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "81f2a991a31d97997102a9f323d814f1812dfc05",
    "submitter": {
        "id": 243,
        "url": "http://patches.dpdk.org/api/people/243/?format=api",
        "name": "Nélio Laranjeiro",
        "email": "nelio.laranjeiro@6wind.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/2a99263e0ab95c4af08ffb2dc17084a72b9265ee.1490773631.git.nelio.laranjeiro@6wind.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/22671/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/22671/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 BF2B95A8D;\n\tWed, 29 Mar 2017 09:56:29 +0200 (CEST)",
            "from mail-wm0-f43.google.com (mail-wm0-f43.google.com\n\t[74.125.82.43]) by dpdk.org (Postfix) with ESMTP id 2FCFC2C55\n\tfor <dev@dpdk.org>; Wed, 29 Mar 2017 09:53:55 +0200 (CEST)",
            "by mail-wm0-f43.google.com with SMTP id u132so57022444wmg.0\n\tfor <dev@dpdk.org>; Wed, 29 Mar 2017 00:53:55 -0700 (PDT)",
            "from ping.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\tb42sm8190981wra.36.2017.03.29.00.53.55\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 29 Mar 2017 00:53:55 -0700 (PDT)"
        ],
        "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;\n\tbh=1To8XGKPA5sSGGpFSastoydUNDttcw9AHb3AatJJlFM=;\n\tb=v9Qo75AW1KCRXHhpyGzyXBR8S19hCnslrJI2FA+gJB4yhQHoa3W1LKKVLJzb93cS6i\n\tRfGpYJ+aN+3VkjghpRLFCwzvIKEixVtPoP4RcMhU/u0GY4w9EqSEA04mtl5HRCLfou1d\n\t1SqvwhSxFIEf/BNpf5jN1MK2cffYix3u9Zb4uRB3sNtyUIMoyhoEmQ6qgumxEcSFskKV\n\twUw2Hkc3DB60KmSXJ9fk0u6wfZPjzP75d5DpYs8auWCOGy9zv+9+ZImn4iGgBgWzVVFR\n\tPzhk3Fx7lpE+i519rYler5q5efwiL0k0LIStb7Dy88nFP6oqVqPL1PxS+8kvHzMN4Qae\n\tiyPQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=1To8XGKPA5sSGGpFSastoydUNDttcw9AHb3AatJJlFM=;\n\tb=PPExufXBuGoruVaops01V9Y1erG7MsBKpPs2kzpZNF4MTZkeYiqruirlE2CTai4I6V\n\t1Up1gttFHjZr3h5KZ92FGztBMI0SPzoLonRorITc/zGfbj8XggFhADv8TwNwyiiwEWBL\n\tDd0o+uogsvbJoFMGO4iJTU8L0oSrnl75AquGU0SqW+AXCGqTmc/EbGbHcld6NeUWvztG\n\tB8VvwAvCgncVHvmSNgKI/Za8Ly68sxwgJ5mWJG0ZNeWMljfUi0HPDb49phKj6HvkiRBu\n\tz+IQIm98PnrxcQTwZpj9Ah7mPkbHsumaDB4VUDFr4r5p0Ibf+DVWKf9MDIDfJkYcOxn5\n\txedQ==",
        "X-Gm-Message-State": "AFeK/H3oenJKvOOnCho4CedlJsyeVGR89AAnSCRMdzYLqGzoN9VupFDt9ijKkhDo6kIRogAV",
        "X-Received": "by 10.28.7.144 with SMTP id 138mr18140589wmh.125.1490774035661; \n\tWed, 29 Mar 2017 00:53:55 -0700 (PDT)",
        "From": "Nelio Laranjeiro <nelio.laranjeiro@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "Adrien Mazarguil <adrien.mazarguil@6wind.com>,\n\tYongseok Koh <yskoh@mellanox.com>",
        "Date": "Wed, 29 Mar 2017 09:53:38 +0200",
        "Message-Id": "<2a99263e0ab95c4af08ffb2dc17084a72b9265ee.1490773631.git.nelio.laranjeiro@6wind.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "Subject": "[dpdk-dev] [PATCH 1/2] net/mlx5: remove duplicated process",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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": "Flow validation already processes the final actions to verify if a rule can\nbe applied or not and the same is done during creation. As the creation\nfunction relies on validation to generate and apply a rule, this job can be\nfully handled by the validation function.\n\nSigned-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>\nAcked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>\nAcked-by: Yongseok Koh <yskoh@mellanox.com>\n---\n drivers/net/mlx5/mlx5_flow.c | 115 ++++++++++++++++---------------------------\n 1 file changed, 43 insertions(+), 72 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex 5468642..b34be55 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -377,6 +377,8 @@ mlx5_flow_item_validate(const struct rte_flow_item *item,\n  *   Perform verbose error reporting if not NULL.\n  * @param[in, out] flow\n  *   Flow structure to update.\n+ * @param[in, out] action\n+ *   Action structure to update.\n  *\n  * @return\n  *   0 on success, a negative errno value otherwise and rte_errno is set.\n@@ -387,14 +389,10 @@ priv_flow_validate(struct priv *priv,\n \t\t   const struct rte_flow_item items[],\n \t\t   const struct rte_flow_action actions[],\n \t\t   struct rte_flow_error *error,\n-\t\t   struct mlx5_flow *flow)\n+\t\t   struct mlx5_flow *flow,\n+\t\t   struct mlx5_flow_action *action)\n {\n \tconst struct mlx5_flow_items *cur_item = mlx5_flow_items;\n-\tstruct mlx5_flow_action action = {\n-\t\t.queue = 0,\n-\t\t.drop = 0,\n-\t\t.mark = 0,\n-\t};\n \n \t(void)priv;\n \tif (attr->group) {\n@@ -474,7 +472,7 @@ priv_flow_validate(struct priv *priv,\n \t\tif (actions->type == RTE_FLOW_ACTION_TYPE_VOID) {\n \t\t\tcontinue;\n \t\t} else if (actions->type == RTE_FLOW_ACTION_TYPE_DROP) {\n-\t\t\taction.drop = 1;\n+\t\t\taction->drop = 1;\n \t\t} else if (actions->type == RTE_FLOW_ACTION_TYPE_QUEUE) {\n \t\t\tconst struct rte_flow_action_queue *queue =\n \t\t\t\t(const struct rte_flow_action_queue *)\n@@ -484,34 +482,35 @@ priv_flow_validate(struct priv *priv,\n \n \t\t\tif (!queue || (queue->index > (priv->rxqs_n - 1)))\n \t\t\t\tgoto exit_action_not_supported;\n-\t\t\tfor (n = 0; n < action.queues_n; ++n) {\n-\t\t\t\tif (action.queues[n] == queue->index) {\n+\t\t\tfor (n = 0; n < action->queues_n; ++n) {\n+\t\t\t\tif (action->queues[n] == queue->index) {\n \t\t\t\t\tfound = 1;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n-\t\t\tif (action.queues_n && !found) {\n+\t\t\tif (action->queues_n && !found) {\n \t\t\t\trte_flow_error_set(error, ENOTSUP,\n \t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ACTION,\n \t\t\t\t\t   actions,\n \t\t\t\t\t   \"queue action not in RSS queues\");\n \t\t\t\treturn -rte_errno;\n \t\t\t}\n-\t\t\taction.queue = 1;\n-\t\t\taction.queues_n = 1;\n-\t\t\taction.queues[0] = queue->index;\n+\t\t\taction->queue = 1;\n+\t\t\taction->queues_n = 1;\n+\t\t\taction->queues[0] = queue->index;\n \t\t} else if (actions->type == RTE_FLOW_ACTION_TYPE_RSS) {\n \t\t\tconst struct rte_flow_action_rss *rss =\n \t\t\t\t(const struct rte_flow_action_rss *)\n \t\t\t\tactions->conf;\n \t\t\tuint16_t n;\n \n-\t\t\tif (action.queues_n == 1) {\n+\t\t\tif (action->queues_n == 1) {\n \t\t\t\tuint16_t found = 0;\n \n-\t\t\t\tassert(action.queues_n);\n+\t\t\t\tassert(action->queues_n);\n \t\t\t\tfor (n = 0; n < rss->num; ++n) {\n-\t\t\t\t\tif (action.queues[0] == rss->queue[n]) {\n+\t\t\t\t\tif (action->queues[0] ==\n+\t\t\t\t\t    rss->queue[n]) {\n \t\t\t\t\t\tfound = 1;\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n@@ -525,10 +524,10 @@ priv_flow_validate(struct priv *priv,\n \t\t\t\t\treturn -rte_errno;\n \t\t\t\t}\n \t\t\t}\n-\t\t\taction.queue = 1;\n+\t\t\taction->queue = 1;\n \t\t\tfor (n = 0; n < rss->num; ++n)\n-\t\t\t\taction.queues[n] = rss->queue[n];\n-\t\t\taction.queues_n = rss->num;\n+\t\t\t\taction->queues[n] = rss->queue[n];\n+\t\t\taction->queues_n = rss->num;\n \t\t} else if (actions->type == RTE_FLOW_ACTION_TYPE_MARK) {\n \t\t\tconst struct rte_flow_action_mark *mark =\n \t\t\t\t(const struct rte_flow_action_mark *)\n@@ -548,16 +547,17 @@ priv_flow_validate(struct priv *priv,\n \t\t\t\t\t\t   \" and 16777199\");\n \t\t\t\treturn -rte_errno;\n \t\t\t}\n-\t\t\taction.mark = 1;\n+\t\t\taction->mark = 1;\n+\t\t\taction->mark_id = mark->id;\n \t\t} else if (actions->type == RTE_FLOW_ACTION_TYPE_FLAG) {\n-\t\t\taction.mark = 1;\n+\t\t\taction->mark = 1;\n \t\t} else {\n \t\t\tgoto exit_action_not_supported;\n \t\t}\n \t}\n-\tif (action.mark && !flow->ibv_attr && !action.drop)\n+\tif (action->mark && !flow->ibv_attr && !action->drop)\n \t\tflow->offset += sizeof(struct ibv_exp_flow_spec_action_tag);\n-\tif (!action.queue && !action.drop) {\n+\tif (!action->queue && !action->drop) {\n \t\trte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_HANDLE,\n \t\t\t\t   NULL, \"no valid action\");\n \t\treturn -rte_errno;\n@@ -589,9 +589,17 @@ mlx5_flow_validate(struct rte_eth_dev *dev,\n \tstruct priv *priv = dev->data->dev_private;\n \tint ret;\n \tstruct mlx5_flow flow = { .offset = sizeof(struct ibv_exp_flow_attr) };\n+\tstruct mlx5_flow_action action = {\n+\t\t.queue = 0,\n+\t\t.drop = 0,\n+\t\t.mark = 0,\n+\t\t.mark_id = MLX5_FLOW_MARK_DEFAULT,\n+\t\t.queues_n = 0,\n+\t};\n \n \tpriv_lock(priv);\n-\tret = priv_flow_validate(priv, attr, items, actions, error, &flow);\n+\tret = priv_flow_validate(priv, attr, items, actions, error, &flow,\n+\t\t\t\t &action);\n \tpriv_unlock(priv);\n \treturn ret;\n }\n@@ -1130,11 +1138,18 @@ priv_flow_create(struct priv *priv,\n \t\t struct rte_flow_error *error)\n {\n \tstruct rte_flow *rte_flow;\n-\tstruct mlx5_flow_action action;\n \tstruct mlx5_flow flow = { .offset = sizeof(struct ibv_exp_flow_attr), };\n+\tstruct mlx5_flow_action action = {\n+\t\t.queue = 0,\n+\t\t.drop = 0,\n+\t\t.mark = 0,\n+\t\t.mark_id = MLX5_FLOW_MARK_DEFAULT,\n+\t\t.queues_n = 0,\n+\t};\n \tint err;\n \n-\terr = priv_flow_validate(priv, attr, items, actions, error, &flow);\n+\terr = priv_flow_validate(priv, attr, items, actions, error, &flow,\n+\t\t\t\t &action);\n \tif (err)\n \t\tgoto exit;\n \tflow.ibv_attr = rte_malloc(__func__, flow.offset, 0);\n@@ -1156,52 +1171,8 @@ priv_flow_create(struct priv *priv,\n \tflow.inner = 0;\n \tflow.hash_fields = 0;\n \tclaim_zero(priv_flow_validate(priv, attr, items, actions,\n-\t\t\t\t      error, &flow));\n-\taction = (struct mlx5_flow_action){\n-\t\t.queue = 0,\n-\t\t.drop = 0,\n-\t\t.mark = 0,\n-\t\t.mark_id = MLX5_FLOW_MARK_DEFAULT,\n-\t};\n-\tfor (; actions->type != RTE_FLOW_ACTION_TYPE_END; ++actions) {\n-\t\tif (actions->type == RTE_FLOW_ACTION_TYPE_VOID) {\n-\t\t\tcontinue;\n-\t\t} else if (actions->type == RTE_FLOW_ACTION_TYPE_QUEUE) {\n-\t\t\taction.queue = 1;\n-\t\t\taction.queues[action.queues_n++] =\n-\t\t\t\t((const struct rte_flow_action_queue *)\n-\t\t\t\t actions->conf)->index;\n-\t\t} else if (actions->type == RTE_FLOW_ACTION_TYPE_RSS) {\n-\t\t\tconst struct rte_flow_action_rss *rss =\n-\t\t\t\t(const struct rte_flow_action_rss *)\n-\t\t\t\t actions->conf;\n-\t\t\tuint16_t n;\n-\n-\t\t\taction.queue = 1;\n-\t\t\taction.queues_n = rss->num;\n-\t\t\tfor (n = 0; n < rss->num; ++n)\n-\t\t\t\taction.queues[n] = rss->queue[n];\n-\t\t} else if (actions->type == RTE_FLOW_ACTION_TYPE_DROP) {\n-\t\t\taction.drop = 1;\n-\t\t\taction.mark = 0;\n-\t\t} else if (actions->type == RTE_FLOW_ACTION_TYPE_MARK) {\n-\t\t\tconst struct rte_flow_action_mark *mark =\n-\t\t\t\t(const struct rte_flow_action_mark *)\n-\t\t\t\tactions->conf;\n-\n-\t\t\tif (mark)\n-\t\t\t\taction.mark_id = mark->id;\n-\t\t\taction.mark = !action.drop;\n-\t\t} else if (actions->type == RTE_FLOW_ACTION_TYPE_FLAG) {\n-\t\t\taction.mark = 1;\n-\t\t} else {\n-\t\t\trte_flow_error_set(error, ENOTSUP,\n-\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ACTION,\n-\t\t\t\t\t   actions, \"unsupported action\");\n-\t\t\tgoto exit;\n-\t\t}\n-\t}\n-\tif (action.mark) {\n+\t\t\t\t      error, &flow, &action));\n+\tif (action.mark && !action.drop) {\n \t\tmlx5_flow_create_flag_mark(&flow, action.mark_id);\n \t\tflow.offset += sizeof(struct ibv_exp_flow_spec_action_tag);\n \t}\n",
    "prefixes": [
        "dpdk-dev",
        "1/2"
    ]
}