get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 82557,
    "url": "https://patches.dpdk.org/api/patches/82557/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1603875616-272798-19-git-send-email-suanmingm@nvidia.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": "<1603875616-272798-19-git-send-email-suanmingm@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1603875616-272798-19-git-send-email-suanmingm@nvidia.com",
    "date": "2020-10-28T08:59:59",
    "name": "[v5,18/34] net/mlx5: remove unused mreg copy code",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "93cae8f8e32b75024d47435e98e2a55463d9ec4e",
    "submitter": {
        "id": 1887,
        "url": "https://patches.dpdk.org/api/people/1887/?format=api",
        "name": "Suanming Mou",
        "email": "suanmingm@nvidia.com"
    },
    "delegate": {
        "id": 3268,
        "url": "https://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1603875616-272798-19-git-send-email-suanmingm@nvidia.com/mbox/",
    "series": [
        {
            "id": 13411,
            "url": "https://patches.dpdk.org/api/series/13411/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=13411",
            "date": "2020-10-28T08:59:42",
            "name": "net/mlx5: support multiple-thread flow operations",
            "version": 5,
            "mbox": "https://patches.dpdk.org/series/13411/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/82557/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/82557/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 8E2C3A04DD;\n\tWed, 28 Oct 2020 10:06:41 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2F910C8A6;\n\tWed, 28 Oct 2020 10:03:31 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 14337C6C8\n for <dev@dpdk.org>; Wed, 28 Oct 2020 10:02:19 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n suanmingm@nvidia.com) with SMTP; 28 Oct 2020 11:01:08 +0200",
            "from nvidia.com (mtbc-r640-04.mtbc.labs.mlnx [10.75.70.9])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 09S90JmI024495;\n Wed, 28 Oct 2020 11:01:06 +0200"
        ],
        "From": "Suanming Mou <suanmingm@nvidia.com>",
        "To": "Matan Azrad <matan@nvidia.com>, Shahaf Shuler <shahafs@nvidia.com>,\n Viacheslav Ovsiienko <viacheslavo@nvidia.com>",
        "Cc": "dev@dpdk.org, rasland@nvidia.com",
        "Date": "Wed, 28 Oct 2020 16:59:59 +0800",
        "Message-Id": "<1603875616-272798-19-git-send-email-suanmingm@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1603875616-272798-1-git-send-email-suanmingm@nvidia.com>",
        "References": "<1601984948-313027-1-git-send-email-suanmingm@nvidia.com>\n <1603875616-272798-1-git-send-email-suanmingm@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH v5 18/34] net/mlx5: remove unused mreg copy code",
        "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": "After non-cache mode feature was implemented, the flows can only be\ncreated when port started. No need to check if the mreg flows are\ncreated in port stopped status, and apply the mreg flows after port\nstart will also never happen.\n\nThis commit removed the relevant not used mreg copy code.\n\nSigned-off-by: Suanming Mou <suanmingm@nvidia.com>\nAcked-by: Matan Azrad <matan@nvidia.com>\n---\n drivers/net/mlx5/mlx5.h      |   2 -\n drivers/net/mlx5/mlx5_flow.c | 185 -------------------------------------------\n drivers/net/mlx5/mlx5_flow.h |   2 -\n 3 files changed, 189 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 81dba2f..debb862 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -1091,8 +1091,6 @@ int mlx5_dev_filter_ctrl(struct rte_eth_dev *dev,\n \t\t\t enum rte_filter_type filter_type,\n \t\t\t enum rte_filter_op filter_op,\n \t\t\t void *arg);\n-int mlx5_flow_start(struct rte_eth_dev *dev, uint32_t *list);\n-void mlx5_flow_stop(struct rte_eth_dev *dev, uint32_t *list);\n int mlx5_flow_start_default(struct rte_eth_dev *dev);\n void mlx5_flow_stop_default(struct rte_eth_dev *dev);\n int mlx5_flow_verify(struct rte_eth_dev *dev);\ndiff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex b5b4997..3a2ab76 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -3239,28 +3239,6 @@ struct mlx5_flow_tunnel_info {\n }\n \n /**\n- * Flow driver remove API. This abstracts calling driver specific functions.\n- * Parent flow (rte_flow) should have driver type (drv_type). It removes a flow\n- * on device. All the resources of the flow should be freed by calling\n- * flow_drv_destroy().\n- *\n- * @param[in] dev\n- *   Pointer to Ethernet device.\n- * @param[in, out] flow\n- *   Pointer to flow structure.\n- */\n-static inline void\n-flow_drv_remove(struct rte_eth_dev *dev, struct rte_flow *flow)\n-{\n-\tconst struct mlx5_flow_driver_ops *fops;\n-\tenum mlx5_flow_drv_type type = flow->drv_type;\n-\n-\tMLX5_ASSERT(type > MLX5_FLOW_TYPE_MIN && type < MLX5_FLOW_TYPE_MAX);\n-\tfops = flow_get_drv_ops(type);\n-\tfops->remove(dev, flow);\n-}\n-\n-/**\n  * Flow driver destroy API. This abstracts calling driver specific functions.\n  * Parent flow (rte_flow) should have driver type (drv_type). It removes a flow\n  * on device and releases resources of the flow.\n@@ -3857,19 +3835,6 @@ struct rte_flow_shared_action *\n \t\t\t\t flow->rix_mreg_copy);\n \tif (!mcp_res || !priv->mreg_cp_tbl)\n \t\treturn;\n-\tif (flow->copy_applied) {\n-\t\tMLX5_ASSERT(mcp_res->appcnt);\n-\t\tflow->copy_applied = 0;\n-\t\t--mcp_res->appcnt;\n-\t\tif (!mcp_res->appcnt) {\n-\t\t\tstruct rte_flow *mcp_flow = mlx5_ipool_get\n-\t\t\t\t\t(priv->sh->ipool[MLX5_IPOOL_RTE_FLOW],\n-\t\t\t\t\tmcp_res->rix_flow);\n-\n-\t\t\tif (mcp_flow)\n-\t\t\t\tflow_drv_remove(dev, mcp_flow);\n-\t\t}\n-\t}\n \t/*\n \t * We do not check availability of metadata registers here,\n \t * because copy resources are not allocated in this case.\n@@ -3884,81 +3849,6 @@ struct rte_flow_shared_action *\n }\n \n /**\n- * Start flow in RX_CP_TBL.\n- *\n- * @param dev\n- *   Pointer to Ethernet device.\n- * @flow\n- *   Parent flow for wich copying is provided.\n- *\n- * @return\n- *   0 on success, a negative errno value otherwise and rte_errno is set.\n- */\n-static int\n-flow_mreg_start_copy_action(struct rte_eth_dev *dev,\n-\t\t\t    struct rte_flow *flow)\n-{\n-\tstruct mlx5_flow_mreg_copy_resource *mcp_res;\n-\tstruct mlx5_priv *priv = dev->data->dev_private;\n-\tint ret;\n-\n-\tif (!flow->rix_mreg_copy || flow->copy_applied)\n-\t\treturn 0;\n-\tmcp_res = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_MCP],\n-\t\t\t\t flow->rix_mreg_copy);\n-\tif (!mcp_res)\n-\t\treturn 0;\n-\tif (!mcp_res->appcnt) {\n-\t\tstruct rte_flow *mcp_flow = mlx5_ipool_get\n-\t\t\t\t(priv->sh->ipool[MLX5_IPOOL_RTE_FLOW],\n-\t\t\t\tmcp_res->rix_flow);\n-\n-\t\tif (mcp_flow) {\n-\t\t\tret = flow_drv_apply(dev, mcp_flow, NULL);\n-\t\t\tif (ret)\n-\t\t\t\treturn ret;\n-\t\t}\n-\t}\n-\t++mcp_res->appcnt;\n-\tflow->copy_applied = 1;\n-\treturn 0;\n-}\n-\n-/**\n- * Stop flow in RX_CP_TBL.\n- *\n- * @param dev\n- *   Pointer to Ethernet device.\n- * @flow\n- *   Parent flow for wich copying is provided.\n- */\n-static void\n-flow_mreg_stop_copy_action(struct rte_eth_dev *dev,\n-\t\t\t   struct rte_flow *flow)\n-{\n-\tstruct mlx5_flow_mreg_copy_resource *mcp_res;\n-\tstruct mlx5_priv *priv = dev->data->dev_private;\n-\n-\tif (!flow->rix_mreg_copy || !flow->copy_applied)\n-\t\treturn;\n-\tmcp_res = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_MCP],\n-\t\t\t\t flow->rix_mreg_copy);\n-\tif (!mcp_res)\n-\t\treturn;\n-\tMLX5_ASSERT(mcp_res->appcnt);\n-\t--mcp_res->appcnt;\n-\tflow->copy_applied = 0;\n-\tif (!mcp_res->appcnt) {\n-\t\tstruct rte_flow *mcp_flow = mlx5_ipool_get\n-\t\t\t\t(priv->sh->ipool[MLX5_IPOOL_RTE_FLOW],\n-\t\t\t\tmcp_res->rix_flow);\n-\n-\t\tif (mcp_flow)\n-\t\t\tflow_drv_remove(dev, mcp_flow);\n-\t}\n-}\n-\n-/**\n  * Remove the default copy action from RX_CP_TBL.\n  *\n  * @param dev\n@@ -4073,10 +3963,6 @@ struct rte_flow_shared_action *\n \t\t\tif (!mcp_res)\n \t\t\t\treturn -rte_errno;\n \t\t\tflow->rix_mreg_copy = mcp_res->idx;\n-\t\t\tif (dev->data->dev_started) {\n-\t\t\t\tmcp_res->appcnt++;\n-\t\t\t\tflow->copy_applied = 1;\n-\t\t\t}\n \t\t\treturn 0;\n \t\tcase RTE_FLOW_ACTION_TYPE_MARK:\n \t\t\tmark = (const struct rte_flow_action_mark *)\n@@ -4086,10 +3972,6 @@ struct rte_flow_shared_action *\n \t\t\tif (!mcp_res)\n \t\t\t\treturn -rte_errno;\n \t\t\tflow->rix_mreg_copy = mcp_res->idx;\n-\t\t\tif (dev->data->dev_started) {\n-\t\t\t\tmcp_res->appcnt++;\n-\t\t\t\tflow->copy_applied = 1;\n-\t\t\t}\n \t\t\treturn 0;\n \t\tdefault:\n \t\t\tbreak;\n@@ -6013,73 +5895,6 @@ struct rte_flow *\n }\n \n /**\n- * Remove all flows.\n- *\n- * @param dev\n- *   Pointer to Ethernet device.\n- * @param list\n- *   Pointer to the Indexed flow list.\n- */\n-void\n-mlx5_flow_stop(struct rte_eth_dev *dev, uint32_t *list)\n-{\n-\tstruct mlx5_priv *priv = dev->data->dev_private;\n-\tstruct rte_flow *flow = NULL;\n-\tuint32_t idx;\n-\n-\tILIST_FOREACH(priv->sh->ipool[MLX5_IPOOL_RTE_FLOW], *list, idx,\n-\t\t      flow, next) {\n-\t\tflow_drv_remove(dev, flow);\n-\t\tflow_mreg_stop_copy_action(dev, flow);\n-\t}\n-\tflow_mreg_del_default_copy_action(dev);\n-\tflow_rxq_flags_clear(dev);\n-}\n-\n-/**\n- * Add all flows.\n- *\n- * @param dev\n- *   Pointer to Ethernet device.\n- * @param list\n- *   Pointer to the Indexed flow list.\n- *\n- * @return\n- *   0 on success, a negative errno value otherwise and rte_errno is set.\n- */\n-int\n-mlx5_flow_start(struct rte_eth_dev *dev, uint32_t *list)\n-{\n-\tstruct mlx5_priv *priv = dev->data->dev_private;\n-\tstruct rte_flow *flow = NULL;\n-\tstruct rte_flow_error error;\n-\tuint32_t idx;\n-\tint ret = 0;\n-\n-\t/* Make sure default copy action (reg_c[0] -> reg_b) is created. */\n-\tret = flow_mreg_add_default_copy_action(dev, &error);\n-\tif (ret < 0)\n-\t\treturn -rte_errno;\n-\t/* Apply Flows created by application. */\n-\tILIST_FOREACH(priv->sh->ipool[MLX5_IPOOL_RTE_FLOW], *list, idx,\n-\t\t      flow, next) {\n-\t\tret = flow_mreg_start_copy_action(dev, flow);\n-\t\tif (ret < 0)\n-\t\t\tgoto error;\n-\t\tret = flow_drv_apply(dev, flow, &error);\n-\t\tif (ret < 0)\n-\t\t\tgoto error;\n-\t\tflow_rxq_flags_set(dev, flow);\n-\t}\n-\treturn 0;\n-error:\n-\tret = rte_errno; /* Save rte_errno before cleanup. */\n-\tmlx5_flow_stop(dev, list);\n-\trte_errno = ret; /* Restore rte_errno. */\n-\treturn -rte_errno;\n-}\n-\n-/**\n  * Stop all default actions for flows.\n  *\n  * @param dev\ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 4fb50de..b5e4c9f 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -523,7 +523,6 @@ struct mlx5_flow_mreg_copy_resource {\n \tLIST_ENTRY(mlx5_flow_mreg_copy_resource) next;\n \t/* List entry for device flows. */\n \tuint32_t refcnt; /* Reference counter. */\n-\tuint32_t appcnt; /* Apply/Remove counter. */\n \tuint32_t idx;\n \tuint32_t rix_flow; /* Built flow for copy. */\n };\n@@ -1048,7 +1047,6 @@ struct rte_flow {\n \tuint32_t drv_type:2; /**< Driver type. */\n \tuint32_t fdir:1; /**< Identifier of associated FDIR if any. */\n \tuint32_t tunnel:1;\n-\tuint32_t copy_applied:1; /**< The MARK copy Flow os applied. */\n \tuint32_t meter:16; /**< Holds flow meter id. */\n \tuint32_t rix_mreg_copy;\n \t/**< Index to metadata register copy table resource. */\n",
    "prefixes": [
        "v5",
        "18/34"
    ]
}