get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 53225,
    "url": "https://patches.dpdk.org/api/patches/53225/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/c8db3c0f8672a3f953ddf6e99ec583d3ead165db.1556809050.git.dekelp@mellanox.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": "<c8db3c0f8672a3f953ddf6e99ec583d3ead165db.1556809050.git.dekelp@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/c8db3c0f8672a3f953ddf6e99ec583d3ead165db.1556809050.git.dekelp@mellanox.com",
    "date": "2019-05-02T15:01:57",
    "name": "[v2,4/4] net/mlx5: move locally used functions to static",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9e49bb7dd6e57fefd1df39be302346d6b4848a71",
    "submitter": {
        "id": 1082,
        "url": "https://patches.dpdk.org/api/people/1082/?format=api",
        "name": "Dekel Peled",
        "email": "dekelp@mellanox.com"
    },
    "delegate": {
        "id": 6624,
        "url": "https://patches.dpdk.org/api/users/6624/?format=api",
        "username": "shahafs",
        "first_name": "Shahaf",
        "last_name": "Shuler",
        "email": "shahafs@mellanox.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/c8db3c0f8672a3f953ddf6e99ec583d3ead165db.1556809050.git.dekelp@mellanox.com/mbox/",
    "series": [
        {
            "id": 4545,
            "url": "https://patches.dpdk.org/api/series/4545/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=4545",
            "date": "2019-05-02T15:01:53",
            "name": "net/mlx5: code cleanup in rx and tx files",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/4545/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/53225/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/53225/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Subject": "[dpdk-dev] [PATCH v2 4/4] net/mlx5: move locally used functions to\n\tstatic",
        "List-Post": "<mailto:dev@dpdk.org>",
        "X-Mailer": "git-send-email 1.7.1",
        "X-Original-To": "patchwork@dpdk.org",
        "Cc": "dev@dpdk.org",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "From": "Dekel Peled <dekelp@mellanox.com>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-BeenThere": "dev@dpdk.org",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Date": "Thu,  2 May 2019 18:01:57 +0300",
        "Precedence": "list",
        "In-Reply-To": "<cover.1556809050.git.dekelp@mellanox.com>",
        "Message-Id": "<c8db3c0f8672a3f953ddf6e99ec583d3ead165db.1556809050.git.dekelp@mellanox.com>",
        "X-Mailman-Version": "2.1.15",
        "Errors-To": "dev-bounces@dpdk.org",
        "References": "<cover.1556534247.git.dekelp@mellanox.com>\n\t<cover.1556809050.git.dekelp@mellanox.com>",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 68A011B123;\n\tThu,  2 May 2019 17:04:55 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id EEA991B118\n\tfor <dev@dpdk.org>; Thu,  2 May 2019 17:04:50 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE2 (envelope-from\n\tdekelp@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 2 May 2019 18:04:49 +0300",
            "from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx\n\t[10.128.130.87])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x42F4ilW009153;\n\tThu, 2 May 2019 18:04:49 +0300"
        ],
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "To": "yskoh@mellanox.com, shahafs@mellanox.com"
    },
    "content": "Multiple functions were declared in header file mlx5_rxtx.h,\ninplemented in mlx5_rxq.c, and called only in mlx5_rxq.c.\n\nThis patch moves all these functions declarations into mlx5_rxq.c,\nas static functions.\nSome functions implementation was copied higher in the file to\nprecede the functions calls.\n\nSigned-off-by: Dekel Peled <dekelp@mellanox.com>\n---\n drivers/net/mlx5/mlx5_rxq.c  | 185 +++++++++++++++++++++----------------------\n drivers/net/mlx5/mlx5_rxtx.h |  16 ----\n 2 files changed, 92 insertions(+), 109 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c\nindex a547f2a..36fd0b3 100644\n--- a/drivers/net/mlx5/mlx5_rxq.c\n+++ b/drivers/net/mlx5/mlx5_rxq.c\n@@ -65,7 +65,7 @@\n  * @return\n  *   1 if supported, negative errno value if not.\n  */\n-inline int\n+static inline int\n mlx5_check_mprq_support(struct rte_eth_dev *dev)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n@@ -418,6 +418,33 @@\n }\n \n /**\n+ * Verify if the queue can be released.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device.\n+ * @param idx\n+ *   RX queue index.\n+ *\n+ * @return\n+ *   1 if the queue can be released\n+ *   0 if the queue can not be released, there are references to it.\n+ *   Negative errno and rte_errno is set if queue doesn't exist.\n+ */\n+static int\n+mlx5_rxq_releasable(struct rte_eth_dev *dev, uint16_t idx)\n+{\n+\tstruct mlx5_priv *priv = dev->data->dev_private;\n+\tstruct mlx5_rxq_ctrl *rxq_ctrl;\n+\n+\tif (!(*priv->rxqs)[idx]) {\n+\t\trte_errno = EINVAL;\n+\t\treturn -rte_errno;\n+\t}\n+\trxq_ctrl = container_of((*priv->rxqs)[idx], struct mlx5_rxq_ctrl, rxq);\n+\treturn (rte_atomic32_read(&rxq_ctrl->refcnt) == 1);\n+}\n+\n+/**\n  *\n  * @param dev\n  *   Pointer to Ethernet device structure.\n@@ -505,6 +532,63 @@\n }\n \n /**\n+ * Get an Rx queue Verbs object.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device.\n+ * @param idx\n+ *   Queue index in DPDK Rx queue array\n+ *\n+ * @return\n+ *   The Verbs object if it exists.\n+ */\n+static struct mlx5_rxq_ibv *\n+mlx5_rxq_ibv_get(struct rte_eth_dev *dev, uint16_t idx)\n+{\n+\tstruct mlx5_priv *priv = dev->data->dev_private;\n+\tstruct mlx5_rxq_data *rxq_data = (*priv->rxqs)[idx];\n+\tstruct mlx5_rxq_ctrl *rxq_ctrl;\n+\n+\tif (idx >= priv->rxqs_n)\n+\t\treturn NULL;\n+\tif (!rxq_data)\n+\t\treturn NULL;\n+\trxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);\n+\tif (rxq_ctrl->ibv)\n+\t\trte_atomic32_inc(&rxq_ctrl->ibv->refcnt);\n+\treturn rxq_ctrl->ibv;\n+}\n+\n+/**\n+ * Release an Rx verbs queue object.\n+ *\n+ * @param rxq_ibv\n+ *   Verbs Rx queue object.\n+ *\n+ * @return\n+ *   1 while a reference on it exists, 0 when freed.\n+ */\n+static int\n+mlx5_rxq_ibv_release(struct mlx5_rxq_ibv *rxq_ibv)\n+{\n+\tassert(rxq_ibv);\n+\tassert(rxq_ibv->wq);\n+\tassert(rxq_ibv->cq);\n+\tif (rte_atomic32_dec_and_test(&rxq_ibv->refcnt)) {\n+\t\trxq_free_elts(rxq_ibv->rxq_ctrl);\n+\t\tclaim_zero(mlx5_glue->destroy_wq(rxq_ibv->wq));\n+\t\tclaim_zero(mlx5_glue->destroy_cq(rxq_ibv->cq));\n+\t\tif (rxq_ibv->channel)\n+\t\t\tclaim_zero(mlx5_glue->destroy_comp_channel\n+\t\t\t\t   (rxq_ibv->channel));\n+\t\tLIST_REMOVE(rxq_ibv, next);\n+\t\trte_free(rxq_ibv);\n+\t\treturn 0;\n+\t}\n+\treturn 1;\n+}\n+\n+/**\n  * Allocate queue vector and fill epoll fd list for Rx interrupts.\n  *\n  * @param dev\n@@ -1032,64 +1116,6 @@ struct mlx5_rxq_ibv *\n }\n \n /**\n- * Get an Rx queue Verbs object.\n- *\n- * @param dev\n- *   Pointer to Ethernet device.\n- * @param idx\n- *   Queue index in DPDK Rx queue array\n- *\n- * @return\n- *   The Verbs object if it exists.\n- */\n-struct mlx5_rxq_ibv *\n-mlx5_rxq_ibv_get(struct rte_eth_dev *dev, uint16_t idx)\n-{\n-\tstruct mlx5_priv *priv = dev->data->dev_private;\n-\tstruct mlx5_rxq_data *rxq_data = (*priv->rxqs)[idx];\n-\tstruct mlx5_rxq_ctrl *rxq_ctrl;\n-\n-\tif (idx >= priv->rxqs_n)\n-\t\treturn NULL;\n-\tif (!rxq_data)\n-\t\treturn NULL;\n-\trxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);\n-\tif (rxq_ctrl->ibv) {\n-\t\trte_atomic32_inc(&rxq_ctrl->ibv->refcnt);\n-\t}\n-\treturn rxq_ctrl->ibv;\n-}\n-\n-/**\n- * Release an Rx verbs queue object.\n- *\n- * @param rxq_ibv\n- *   Verbs Rx queue object.\n- *\n- * @return\n- *   1 while a reference on it exists, 0 when freed.\n- */\n-int\n-mlx5_rxq_ibv_release(struct mlx5_rxq_ibv *rxq_ibv)\n-{\n-\tassert(rxq_ibv);\n-\tassert(rxq_ibv->wq);\n-\tassert(rxq_ibv->cq);\n-\tif (rte_atomic32_dec_and_test(&rxq_ibv->refcnt)) {\n-\t\trxq_free_elts(rxq_ibv->rxq_ctrl);\n-\t\tclaim_zero(mlx5_glue->destroy_wq(rxq_ibv->wq));\n-\t\tclaim_zero(mlx5_glue->destroy_cq(rxq_ibv->cq));\n-\t\tif (rxq_ibv->channel)\n-\t\t\tclaim_zero(mlx5_glue->destroy_comp_channel\n-\t\t\t\t   (rxq_ibv->channel));\n-\t\tLIST_REMOVE(rxq_ibv, next);\n-\t\trte_free(rxq_ibv);\n-\t\treturn 0;\n-\t}\n-\treturn 1;\n-}\n-\n-/**\n  * Verify the Verbs Rx queue list is empty\n  *\n  * @param dev\n@@ -1538,33 +1564,6 @@ struct mlx5_rxq_ctrl *\n }\n \n /**\n- * Verify if the queue can be released.\n- *\n- * @param dev\n- *   Pointer to Ethernet device.\n- * @param idx\n- *   RX queue index.\n- *\n- * @return\n- *   1 if the queue can be released\n- *   0 if the queue can not be released, there are references to it.\n- *   Negative errno and rte_errno is set if queue doesn't exist.\n- */\n-int\n-mlx5_rxq_releasable(struct rte_eth_dev *dev, uint16_t idx)\n-{\n-\tstruct mlx5_priv *priv = dev->data->dev_private;\n-\tstruct mlx5_rxq_ctrl *rxq_ctrl;\n-\n-\tif (!(*priv->rxqs)[idx]) {\n-\t\trte_errno = EINVAL;\n-\t\treturn -rte_errno;\n-\t}\n-\trxq_ctrl = container_of((*priv->rxqs)[idx], struct mlx5_rxq_ctrl, rxq);\n-\treturn (rte_atomic32_read(&rxq_ctrl->refcnt) == 1);\n-}\n-\n-/**\n  * Verify the Rx Queue list is empty\n  *\n  * @param dev\n@@ -1601,7 +1600,7 @@ struct mlx5_rxq_ctrl *\n  * @return\n  *   The Verbs object initialised, NULL otherwise and rte_errno is set.\n  */\n-struct mlx5_ind_table_ibv *\n+static struct mlx5_ind_table_ibv *\n mlx5_ind_table_ibv_new(struct rte_eth_dev *dev, const uint16_t *queues,\n \t\t       uint32_t queues_n)\n {\n@@ -1665,7 +1664,7 @@ struct mlx5_ind_table_ibv *\n  * @return\n  *   An indirection table if found.\n  */\n-struct mlx5_ind_table_ibv *\n+static struct mlx5_ind_table_ibv *\n mlx5_ind_table_ibv_get(struct rte_eth_dev *dev, const uint16_t *queues,\n \t\t       uint32_t queues_n)\n {\n@@ -1700,7 +1699,7 @@ struct mlx5_ind_table_ibv *\n  * @return\n  *   1 while a reference on it exists, 0 when freed.\n  */\n-int\n+static int\n mlx5_ind_table_ibv_release(struct rte_eth_dev *dev,\n \t\t\t   struct mlx5_ind_table_ibv *ind_tbl)\n {\n@@ -1984,7 +1983,7 @@ struct mlx5_hrxq *\n  * @return\n  *   The Verbs object initialised, NULL otherwise and rte_errno is set.\n  */\n-struct mlx5_rxq_ibv *\n+static struct mlx5_rxq_ibv *\n mlx5_rxq_ibv_drop_new(struct rte_eth_dev *dev)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n@@ -2044,7 +2043,7 @@ struct mlx5_rxq_ibv *\n  * @return\n  *   The Verbs object initialised, NULL otherwise and rte_errno is set.\n  */\n-void\n+static void\n mlx5_rxq_ibv_drop_release(struct rte_eth_dev *dev)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n@@ -2067,7 +2066,7 @@ struct mlx5_rxq_ibv *\n  * @return\n  *   The Verbs object initialised, NULL otherwise and rte_errno is set.\n  */\n-struct mlx5_ind_table_ibv *\n+static struct mlx5_ind_table_ibv *\n mlx5_ind_table_ibv_drop_new(struct rte_eth_dev *dev)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n@@ -2110,7 +2109,7 @@ struct mlx5_ind_table_ibv *\n  * @param dev\n  *   Pointer to Ethernet device.\n  */\n-void\n+static void\n mlx5_ind_table_ibv_drop_release(struct rte_eth_dev *dev)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\ndiff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h\nindex 1732e32..4512490 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.h\n+++ b/drivers/net/mlx5/mlx5_rxtx.h\n@@ -246,7 +246,6 @@ struct mlx5_txq_ctrl {\n \n extern uint8_t rss_hash_default_key[];\n \n-int mlx5_check_mprq_support(struct rte_eth_dev *dev);\n int mlx5_rxq_mprq_enabled(struct mlx5_rxq_data *rxq);\n int mlx5_mprq_enabled(struct rte_eth_dev *dev);\n int mlx5_mprq_free_mp(struct rte_eth_dev *dev);\n@@ -260,10 +259,6 @@ int mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,\n int mlx5_rx_intr_enable(struct rte_eth_dev *dev, uint16_t rx_queue_id);\n int mlx5_rx_intr_disable(struct rte_eth_dev *dev, uint16_t rx_queue_id);\n struct mlx5_rxq_ibv *mlx5_rxq_ibv_new(struct rte_eth_dev *dev, uint16_t idx);\n-struct mlx5_rxq_ibv *mlx5_rxq_ibv_get(struct rte_eth_dev *dev, uint16_t idx);\n-int mlx5_rxq_ibv_release(struct mlx5_rxq_ibv *rxq_ibv);\n-struct mlx5_rxq_ibv *mlx5_rxq_ibv_drop_new(struct rte_eth_dev *dev);\n-void mlx5_rxq_ibv_drop_release(struct rte_eth_dev *dev);\n int mlx5_rxq_ibv_verify(struct rte_eth_dev *dev);\n struct mlx5_rxq_ctrl *mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx,\n \t\t\t\t   uint16_t desc, unsigned int socket,\n@@ -271,20 +266,9 @@ struct mlx5_rxq_ctrl *mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx,\n \t\t\t\t   struct rte_mempool *mp);\n struct mlx5_rxq_ctrl *mlx5_rxq_get(struct rte_eth_dev *dev, uint16_t idx);\n int mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx);\n-int mlx5_rxq_releasable(struct rte_eth_dev *dev, uint16_t idx);\n int mlx5_rxq_verify(struct rte_eth_dev *dev);\n int rxq_alloc_elts(struct mlx5_rxq_ctrl *rxq_ctrl);\n-struct mlx5_ind_table_ibv *mlx5_ind_table_ibv_new(struct rte_eth_dev *dev,\n-\t\t\t\t\t\t  const uint16_t *queues,\n-\t\t\t\t\t\t  uint32_t queues_n);\n-struct mlx5_ind_table_ibv *mlx5_ind_table_ibv_get(struct rte_eth_dev *dev,\n-\t\t\t\t\t\t  const uint16_t *queues,\n-\t\t\t\t\t\t  uint32_t queues_n);\n-int mlx5_ind_table_ibv_release(struct rte_eth_dev *dev,\n-\t\t\t       struct mlx5_ind_table_ibv *ind_tbl);\n int mlx5_ind_table_ibv_verify(struct rte_eth_dev *dev);\n-struct mlx5_ind_table_ibv *mlx5_ind_table_ibv_drop_new(struct rte_eth_dev *dev);\n-void mlx5_ind_table_ibv_drop_release(struct rte_eth_dev *dev);\n struct mlx5_hrxq *mlx5_hrxq_new(struct rte_eth_dev *dev,\n \t\t\t\tconst uint8_t *rss_key, uint32_t rss_key_len,\n \t\t\t\tuint64_t hash_fields,\n",
    "prefixes": [
        "v2",
        "4/4"
    ]
}