get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 68476,
    "url": "http://patchwork.dpdk.org/api/patches/68476/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1586932797-99533-7-git-send-email-suanmingm@mellanox.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": "<1586932797-99533-7-git-send-email-suanmingm@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1586932797-99533-7-git-send-email-suanmingm@mellanox.com",
    "date": "2020-04-15T06:39:53",
    "name": "[06/10] net/mlx5: optimize flow meter handle type",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1ca8da013a5b7c522b04f1043afdd53368926248",
    "submitter": {
        "id": 1358,
        "url": "http://patchwork.dpdk.org/api/people/1358/?format=api",
        "name": "Suanming Mou",
        "email": "suanmingm@mellanox.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patchwork.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1586932797-99533-7-git-send-email-suanmingm@mellanox.com/mbox/",
    "series": [
        {
            "id": 9383,
            "url": "http://patchwork.dpdk.org/api/series/9383/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=9383",
            "date": "2020-04-15T06:39:47",
            "name": "net/mlx5: optimize flow structure",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/9383/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/68476/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/68476/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 574ADA0577;\n\tWed, 15 Apr 2020 08:41:05 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 234411D416;\n\tWed, 15 Apr 2020 08:40:18 +0200 (CEST)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id 64C881D16B\n for <dev@dpdk.org>; Wed, 15 Apr 2020 08:40:15 +0200 (CEST)"
        ],
        "From": "Suanming Mou <suanmingm@mellanox.com>",
        "To": "Matan Azrad <matan@mellanox.com>, Shahaf Shuler <shahafs@mellanox.com>,\n Viacheslav Ovsiienko <viacheslavo@mellanox.com>",
        "Cc": "wentaoc@mellanox.com,\n\trasland@mellanox.com,\n\tdev@dpdk.org",
        "Date": "Wed, 15 Apr 2020 14:39:53 +0800",
        "Message-Id": "<1586932797-99533-7-git-send-email-suanmingm@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1586932797-99533-1-git-send-email-suanmingm@mellanox.com>",
        "References": "<1586932797-99533-1-git-send-email-suanmingm@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 06/10] net/mlx5: optimize flow meter handle type",
        "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 <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": "While flow attaches the meter handle, the meter id can be the unique tag\nfor the flow to get the meter handle. It's no need for flow to save the\npointer of the meter handle.\n\nSave the meter id instead of pointer helps reduce the size for rte flow\nstructure.\n\nAs the supported maximum meter rule is 4K, uint16_t type is selected for\nthe meter id.\n\nSigned-off-by: Suanming Mou <suanmingm@mellanox.com>\n---\n drivers/net/mlx5/mlx5_flow.h    |  2 +-\n drivers/net/mlx5/mlx5_flow_dv.c | 29 ++++++++++++++++++++++-------\n 2 files changed, 23 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex e220647..983ccc1 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -759,7 +759,7 @@ struct rte_flow {\n \tuint32_t counter; /**< Holds flow counter. */\n \tstruct mlx5_flow_mreg_copy_resource *mreg_copy;\n \t/**< pointer to metadata register copy table resource. */\n-\tstruct mlx5_flow_meter *meter; /**< Holds flow meter. */\n+\tuint16_t meter; /**< Holds flow meter id. */\n \tuint32_t dev_handles;\n \t/**< Device flow handles that are part of the flow. */\n \tstruct mlx5_fdir *fdir; /**< Pointer to associated FDIR if any. */\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 26733e0..28010ca 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -7396,6 +7396,7 @@ struct field_modify_info modify_tcp[] = {\n \t\tstruct mlx5_flow_dv_port_id_action_resource port_id_resource;\n \t\tint action_type = actions->type;\n \t\tconst struct rte_flow_action *found_action = NULL;\n+\t\tstruct mlx5_flow_meter *fm = NULL;\n \n \t\tswitch (action_type) {\n \t\tcase RTE_FLOW_ACTION_TYPE_VOID:\n@@ -7772,20 +7773,30 @@ struct field_modify_info modify_tcp[] = {\n \t\tcase RTE_FLOW_ACTION_TYPE_METER:\n \t\t\tmtr = actions->conf;\n \t\t\tif (!flow->meter) {\n-\t\t\t\tflow->meter = mlx5_flow_meter_attach(priv,\n-\t\t\t\t\t\t\tmtr->mtr_id, attr,\n-\t\t\t\t\t\t\terror);\n-\t\t\t\tif (!flow->meter)\n+\t\t\t\tfm = mlx5_flow_meter_attach(priv, mtr->mtr_id,\n+\t\t\t\t\t\t\t    attr, error);\n+\t\t\t\tif (!fm)\n \t\t\t\t\treturn rte_flow_error_set(error,\n \t\t\t\t\t\trte_errno,\n \t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION,\n \t\t\t\t\t\tNULL,\n \t\t\t\t\t\t\"meter not found \"\n \t\t\t\t\t\t\"or invalid parameters\");\n+\t\t\t\tflow->meter = fm->meter_id;\n \t\t\t}\n \t\t\t/* Set the meter action. */\n+\t\t\tif (!fm) {\n+\t\t\t\tfm = mlx5_flow_meter_find(priv, flow->meter);\n+\t\t\t\tif (!fm)\n+\t\t\t\t\treturn rte_flow_error_set(error,\n+\t\t\t\t\t\trte_errno,\n+\t\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t\tNULL,\n+\t\t\t\t\t\t\"meter not found \"\n+\t\t\t\t\t\t\"or invalid parameters\");\n+\t\t\t}\n \t\t\tdev_flow->dv.actions[actions_n++] =\n-\t\t\t\tflow->meter->mfts->meter_action;\n+\t\t\t\tfm->mfts->meter_action;\n \t\t\taction_flags |= MLX5_FLOW_ACTION_METER;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP:\n@@ -8472,8 +8483,12 @@ struct field_modify_info modify_tcp[] = {\n \t\tflow->counter = 0;\n \t}\n \tif (flow->meter) {\n-\t\tmlx5_flow_meter_detach(flow->meter);\n-\t\tflow->meter = NULL;\n+\t\tstruct mlx5_flow_meter *fm;\n+\n+\t\tfm  = mlx5_flow_meter_find(priv, flow->meter);\n+\t\tif (fm)\n+\t\t\tmlx5_flow_meter_detach(fm);\n+\t\tflow->meter = 0;\n \t}\n \twhile (flow->dev_handles) {\n \t\tuint32_t tmp_idx = flow->dev_handles;\n",
    "prefixes": [
        "06/10"
    ]
}