get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 82571,
    "url": "https://patches.dpdk.org/api/patches/82571/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1603875616-272798-35-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-35-git-send-email-suanmingm@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1603875616-272798-35-git-send-email-suanmingm@nvidia.com",
    "date": "2020-10-28T09:00:15",
    "name": "[v5,34/34] net/mlx5: remove shared context lock",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "098769cd509647a30332b2c664d3c52729989ee9",
    "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-35-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/82571/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/82571/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 C811BA04DD;\n\tWed, 28 Oct 2020 10:11:04 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DB552C9AC;\n\tWed, 28 Oct 2020 10:03:52 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 90FDDC804\n for <dev@dpdk.org>; Wed, 28 Oct 2020 10:02:21 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n suanmingm@nvidia.com) with SMTP; 28 Oct 2020 11:01:52 +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 09S90JmY024495;\n Wed, 28 Oct 2020 11:01:48 +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, Xueming Li <xuemingl@nvidia.com>",
        "Date": "Wed, 28 Oct 2020 17:00:15 +0800",
        "Message-Id": "<1603875616-272798-35-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 34/34] net/mlx5: remove shared context lock",
        "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": "From: Xueming Li <xuemingl@nvidia.com>\n\nTo support multi-thread flow insertion, this patch removes shared data\nlock since all resources should support concurrent protection.\n\nSigned-off-by: Xueming Li <xuemingl@nvidia.com>\nSigned-off-by: Suanming Mou <suanmingm@nvidia.com>\nAcked-by: Matan Azrad <matan@nvidia.com>\n---\n doc/guides/nics/mlx5.rst               |   1 +\n doc/guides/rel_notes/release_20_11.rst |   1 +\n drivers/net/mlx5/linux/mlx5_os.c       |   4 +-\n drivers/net/mlx5/mlx5.h                |   1 -\n drivers/net/mlx5/mlx5_flow_dv.c        | 209 ++++-----------------------------\n 5 files changed, 27 insertions(+), 189 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst\nindex e5e55fc..8c59cc6 100644\n--- a/doc/guides/nics/mlx5.rst\n+++ b/doc/guides/nics/mlx5.rst\n@@ -96,6 +96,7 @@ Features\n - Per packet no-inline hint flag to disable packet data copying into Tx descriptors.\n - Hardware LRO.\n - Hairpin.\n+- Multiple-thread flow insertion.\n \n Limitations\n -----------\ndiff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst\nindex e284771..0742fc8 100644\n--- a/doc/guides/rel_notes/release_20_11.rst\n+++ b/doc/guides/rel_notes/release_20_11.rst\n@@ -358,6 +358,7 @@ New Features\n   * Added support for QinQ packets matching.\n   * Added support for the new vlan fields ``has_vlan`` in the eth item and\n     ``has_more_vlan`` in the vlan item.\n+  * Added support for PMD level multiple-thread flow insertion.\n \n * **Updated vhost sample application.**\n \ndiff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c\nindex 8612cab..d4f2194 100644\n--- a/drivers/net/mlx5/linux/mlx5_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_os.c\n@@ -321,7 +321,6 @@\n \t\terr = errno;\n \t\tgoto error;\n \t}\n-\tpthread_mutex_init(&sh->dv_mutex, NULL);\n \tsh->tx_domain = domain;\n #ifdef HAVE_MLX5DV_DR_ESWITCH\n \tif (priv->config.dv_esw_en) {\n@@ -435,7 +434,6 @@\n \t\tmlx5_glue->destroy_flow_action(sh->pop_vlan_action);\n \t\tsh->pop_vlan_action = NULL;\n \t}\n-\tpthread_mutex_destroy(&sh->dv_mutex);\n #endif /* HAVE_MLX5DV_DR */\n \tif (sh->default_miss_action)\n \t\tmlx5_glue->destroy_flow_action\n@@ -1536,6 +1534,8 @@\n \t}\n \trte_spinlock_init(&priv->shared_act_sl);\n \tmlx5_flow_counter_mode_config(eth_dev);\n+\tif (priv->config.dv_flow_en)\n+\t\teth_dev->data->dev_flags |= RTE_ETH_DEV_FLOW_OPS_THREAD_SAFE;\n \treturn eth_dev;\n error:\n \tif (priv) {\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex be21a9a..9a458cd 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -639,7 +639,6 @@ struct mlx5_dev_ctx_shared {\n \t/* Packet pacing related structure. */\n \tstruct mlx5_dev_txpp txpp;\n \t/* Shared DV/DR flow data section. */\n-\tpthread_mutex_t dv_mutex; /* DV context mutex. */\n \tuint32_t dv_meta_mask; /* flow META metadata supported mask. */\n \tuint32_t dv_mark_mask; /* flow MARK metadata supported mask. */\n \tuint32_t dv_regc0_mask; /* available bits of metatada reg_c[0]. */\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex cf48402..01b6e7c 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -276,45 +276,6 @@ struct field_modify_info modify_tcp[] = {\n \t}\n }\n \n-/**\n- * Acquire the synchronizing object to protect multithreaded access\n- * to shared dv context. Lock occurs only if context is actually\n- * shared, i.e. we have multiport IB device and representors are\n- * created.\n- *\n- * @param[in] dev\n- *   Pointer to the rte_eth_dev structure.\n- */\n-static void\n-flow_dv_shared_lock(struct rte_eth_dev *dev)\n-{\n-\tstruct mlx5_priv *priv = dev->data->dev_private;\n-\tstruct mlx5_dev_ctx_shared *sh = priv->sh;\n-\n-\tif (sh->refcnt > 1) {\n-\t\tint ret;\n-\n-\t\tret = pthread_mutex_lock(&sh->dv_mutex);\n-\t\tMLX5_ASSERT(!ret);\n-\t\t(void)ret;\n-\t}\n-}\n-\n-static void\n-flow_dv_shared_unlock(struct rte_eth_dev *dev)\n-{\n-\tstruct mlx5_priv *priv = dev->data->dev_private;\n-\tstruct mlx5_dev_ctx_shared *sh = priv->sh;\n-\n-\tif (sh->refcnt > 1) {\n-\t\tint ret;\n-\n-\t\tret = pthread_mutex_unlock(&sh->dv_mutex);\n-\t\tMLX5_ASSERT(!ret);\n-\t\t(void)ret;\n-\t}\n-}\n-\n /* Update VLAN's VID/PCP based on input rte_flow_action.\n  *\n  * @param[in] action\n@@ -5075,7 +5036,7 @@ struct mlx5_hlist_entry *\n  *   Index to the counter handler.\n  */\n static void\n-flow_dv_counter_release(struct rte_eth_dev *dev, uint32_t counter)\n+flow_dv_counter_free(struct rte_eth_dev *dev, uint32_t counter)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct mlx5_flow_counter_pool *pool = NULL;\n@@ -8624,7 +8585,7 @@ struct mlx5_hlist_entry *\n \t\tact_res->rix_tag = 0;\n \t}\n \tif (act_res->cnt) {\n-\t\tflow_dv_counter_release(dev, act_res->cnt);\n+\t\tflow_dv_counter_free(dev, act_res->cnt);\n \t\tact_res->cnt = 0;\n \t}\n }\n@@ -9298,12 +9259,12 @@ struct mlx5_cache_entry *\n  *   0 on success, a negative errno value otherwise and rte_errno is set.\n  */\n static int\n-__flow_dv_translate(struct rte_eth_dev *dev,\n-\t\t    struct mlx5_flow *dev_flow,\n-\t\t    const struct rte_flow_attr *attr,\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+flow_dv_translate(struct rte_eth_dev *dev,\n+\t\t  struct mlx5_flow *dev_flow,\n+\t\t  const struct rte_flow_attr *attr,\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 {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct mlx5_dev_config *dev_conf = &priv->config;\n@@ -10380,8 +10341,8 @@ struct mlx5_cache_entry *\n  *   0 on success, a negative errno value otherwise and rte_errno is set.\n  */\n static int\n-__flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow,\n-\t\tstruct rte_flow_error *error)\n+flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow,\n+\t      struct rte_flow_error *error)\n {\n \tstruct mlx5_flow_dv_workspace *dv;\n \tstruct mlx5_flow_handle *dh;\n@@ -10837,7 +10798,7 @@ struct mlx5_cache_entry *\n  *   Pointer to flow structure.\n  */\n static void\n-__flow_dv_remove(struct rte_eth_dev *dev, struct rte_flow *flow)\n+flow_dv_remove(struct rte_eth_dev *dev, struct rte_flow *flow)\n {\n \tstruct mlx5_flow_handle *dh;\n \tuint32_t handle_idx;\n@@ -10873,7 +10834,7 @@ struct mlx5_cache_entry *\n  *   Pointer to flow structure.\n  */\n static void\n-__flow_dv_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)\n+flow_dv_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)\n {\n \tstruct rte_flow_shared_action *shared;\n \tstruct mlx5_flow_handle *dev_handle;\n@@ -10881,12 +10842,12 @@ struct mlx5_cache_entry *\n \n \tif (!flow)\n \t\treturn;\n-\t__flow_dv_remove(dev, flow);\n+\tflow_dv_remove(dev, flow);\n \tshared = mlx5_flow_get_shared_rss(flow);\n \tif (shared)\n \t\t__atomic_sub_fetch(&shared->refcnt, 1, __ATOMIC_RELAXED);\n \tif (flow->counter) {\n-\t\tflow_dv_counter_release(dev, flow->counter);\n+\t\tflow_dv_counter_free(dev, flow->counter);\n \t\tflow->counter = 0;\n \t}\n \tif (flow->meter) {\n@@ -11169,10 +11130,10 @@ struct mlx5_cache_entry *\n  *   rte_errno is set.\n  */\n static struct rte_flow_shared_action *\n-__flow_dv_action_create(struct rte_eth_dev *dev,\n-\t\t\tconst struct rte_flow_shared_action_conf *conf,\n-\t\t\tconst struct rte_flow_action *action,\n-\t\t\tstruct rte_flow_error *error)\n+flow_dv_action_create(struct rte_eth_dev *dev,\n+\t\t      const struct rte_flow_shared_action_conf *conf,\n+\t\t      const struct rte_flow_action *action,\n+\t\t      struct rte_flow_error *error)\n {\n \tstruct rte_flow_shared_action *shared_action = NULL;\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n@@ -11216,9 +11177,9 @@ struct mlx5_cache_entry *\n  *   0 on success, otherwise negative errno value.\n  */\n static int\n-__flow_dv_action_destroy(struct rte_eth_dev *dev,\n-\t\t\t struct rte_flow_shared_action *action,\n-\t\t\t struct rte_flow_error *error)\n+flow_dv_action_destroy(struct rte_eth_dev *dev,\n+\t\t       struct rte_flow_shared_action *action,\n+\t\t       struct rte_flow_error *error)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tint ret;\n@@ -11338,7 +11299,7 @@ struct mlx5_cache_entry *\n  *   0 on success, otherwise negative errno value.\n  */\n static int\n-__flow_dv_action_update(struct rte_eth_dev *dev,\n+flow_dv_action_update(struct rte_eth_dev *dev,\n \t\t\tstruct rte_flow_shared_action *action,\n \t\t\tconst void *action_conf,\n \t\t\tstruct rte_flow_error *error)\n@@ -12102,85 +12063,12 @@ struct mlx5_cache_entry *\n }\n \n /*\n- * Mutex-protected thunk to lock-free  __flow_dv_translate().\n- */\n-static int\n-flow_dv_translate(struct rte_eth_dev *dev,\n-\t\t  struct mlx5_flow *dev_flow,\n-\t\t  const struct rte_flow_attr *attr,\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-{\n-\tint ret;\n-\n-\tflow_dv_shared_lock(dev);\n-\tret = __flow_dv_translate(dev, dev_flow, attr, items, actions, error);\n-\tflow_dv_shared_unlock(dev);\n-\treturn ret;\n-}\n-\n-/*\n- * Mutex-protected thunk to lock-free  __flow_dv_apply().\n- */\n-static int\n-flow_dv_apply(struct rte_eth_dev *dev,\n-\t      struct rte_flow *flow,\n-\t      struct rte_flow_error *error)\n-{\n-\tint ret;\n-\n-\tflow_dv_shared_lock(dev);\n-\tret = __flow_dv_apply(dev, flow, error);\n-\tflow_dv_shared_unlock(dev);\n-\treturn ret;\n-}\n-\n-/*\n- * Mutex-protected thunk to lock-free __flow_dv_remove().\n- */\n-static void\n-flow_dv_remove(struct rte_eth_dev *dev, struct rte_flow *flow)\n-{\n-\tflow_dv_shared_lock(dev);\n-\t__flow_dv_remove(dev, flow);\n-\tflow_dv_shared_unlock(dev);\n-}\n-\n-/*\n- * Mutex-protected thunk to lock-free __flow_dv_destroy().\n- */\n-static void\n-flow_dv_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)\n-{\n-\tflow_dv_shared_lock(dev);\n-\t__flow_dv_destroy(dev, flow);\n-\tflow_dv_shared_unlock(dev);\n-}\n-\n-/*\n  * Mutex-protected thunk to lock-free flow_dv_counter_alloc().\n  */\n static uint32_t\n flow_dv_counter_allocate(struct rte_eth_dev *dev)\n {\n-\tuint32_t cnt;\n-\n-\tflow_dv_shared_lock(dev);\n-\tcnt = flow_dv_counter_alloc(dev, 0);\n-\tflow_dv_shared_unlock(dev);\n-\treturn cnt;\n-}\n-\n-/*\n- * Mutex-protected thunk to lock-free flow_dv_counter_release().\n- */\n-static void\n-flow_dv_counter_free(struct rte_eth_dev *dev, uint32_t cnt)\n-{\n-\tflow_dv_shared_lock(dev);\n-\tflow_dv_counter_release(dev, cnt);\n-\tflow_dv_shared_unlock(dev);\n+\treturn flow_dv_counter_alloc(dev, 0);\n }\n \n /**\n@@ -12218,57 +12106,6 @@ struct mlx5_cache_entry *\n \t}\n }\n \n-/*\n- * Mutex-protected thunk to lock-free  __flow_dv_action_create().\n- */\n-static struct rte_flow_shared_action *\n-flow_dv_action_create(struct rte_eth_dev *dev,\n-\t\t      const struct rte_flow_shared_action_conf *conf,\n-\t\t      const struct rte_flow_action *action,\n-\t\t      struct rte_flow_error *error)\n-{\n-\tstruct rte_flow_shared_action *shared_action = NULL;\n-\n-\tflow_dv_shared_lock(dev);\n-\tshared_action = __flow_dv_action_create(dev, conf, action, error);\n-\tflow_dv_shared_unlock(dev);\n-\treturn shared_action;\n-}\n-\n-/*\n- * Mutex-protected thunk to lock-free  __flow_dv_action_destroy().\n- */\n-static int\n-flow_dv_action_destroy(struct rte_eth_dev *dev,\n-\t\t       struct rte_flow_shared_action *action,\n-\t\t       struct rte_flow_error *error)\n-{\n-\tint ret;\n-\n-\tflow_dv_shared_lock(dev);\n-\tret = __flow_dv_action_destroy(dev, action, error);\n-\tflow_dv_shared_unlock(dev);\n-\treturn ret;\n-}\n-\n-/*\n- * Mutex-protected thunk to lock-free  __flow_dv_action_update().\n- */\n-static int\n-flow_dv_action_update(struct rte_eth_dev *dev,\n-\t\t      struct rte_flow_shared_action *action,\n-\t\t      const void *action_conf,\n-\t\t      struct rte_flow_error *error)\n-{\n-\tint ret;\n-\n-\tflow_dv_shared_lock(dev);\n-\tret = __flow_dv_action_update(dev, action, action_conf,\n-\t\t\t\t      error);\n-\tflow_dv_shared_unlock(dev);\n-\treturn ret;\n-}\n-\n static int\n flow_dv_sync_domain(struct rte_eth_dev *dev, uint32_t domains, uint32_t flags)\n {\n",
    "prefixes": [
        "v5",
        "34/34"
    ]
}