get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 53902,
    "url": "http://patches.dpdk.org/api/patches/53902/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1559211639-17442-10-git-send-email-matan@mellanox.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": "<1559211639-17442-10-git-send-email-matan@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1559211639-17442-10-git-send-email-matan@mellanox.com",
    "date": "2019-05-30T10:20:39",
    "name": "[v1,9/9] net/mlx5: recover secondary process Tx errors",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "87cf25782a3045e1ce9bfad9e72e9e71c62afb61",
    "submitter": {
        "id": 796,
        "url": "http://patches.dpdk.org/api/people/796/?format=api",
        "name": "Matan Azrad",
        "email": "matan@mellanox.com"
    },
    "delegate": {
        "id": 6624,
        "url": "http://patches.dpdk.org/api/users/6624/?format=api",
        "username": "shahafs",
        "first_name": "Shahaf",
        "last_name": "Shuler",
        "email": "shahafs@mellanox.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1559211639-17442-10-git-send-email-matan@mellanox.com/mbox/",
    "series": [
        {
            "id": 4823,
            "url": "http://patches.dpdk.org/api/series/4823/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4823",
            "date": "2019-05-30T10:20:30",
            "name": "mlx5: Handle data-path completions with error",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4823/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/53902/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/53902/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BFFC71B9BE;\n\tThu, 30 May 2019 12:21:02 +0200 (CEST)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n\tby dpdk.org (Postfix) with ESMTP id 51FB51B95D;\n\tThu, 30 May 2019 12:20:45 +0200 (CEST)"
        ],
        "From": "Matan Azrad <matan@mellanox.com>",
        "To": "Shahaf Shuler <shahafs@mellanox.com>, Yongseok Koh <yskoh@mellanox.com>",
        "Cc": "dev@dpdk.org,\n\tstable@dpdk.org",
        "Date": "Thu, 30 May 2019 10:20:39 +0000",
        "Message-Id": "<1559211639-17442-10-git-send-email-matan@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1559211639-17442-1-git-send-email-matan@mellanox.com>",
        "References": "<1559211639-17442-1-git-send-email-matan@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v1 9/9] net/mlx5: recover secondary process Tx\n\terrors",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The SQ errors recovery mechanism in the PMD invokes a Verbs\nfunctions to modify the RQ states in order to reset the SQ and to\nreactivate it.\n\nThese Verbs functions are not allowed to be invoked from a secondary\nprocess, hence the PMD skips the recovery when the error is captured\nby secondary processes queues.\n\nUsing the DPDK IPC mechanism the secondary process can request Verbs\nqueues state modifications to be done synchronically by the primary\nprocess.\n\nAdd support for secondary process Tx errors recovery.\n\nCc: stable@dpdk.org\n\nSigned-off-by: Matan Azrad <matan@mellanox.com>\n---\n drivers/net/mlx5/mlx5_rxtx.c | 104 ++++++++++++++++++++++++++-----------------\n 1 file changed, 62 insertions(+), 42 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c\nindex cb3baad..9659478 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.c\n+++ b/drivers/net/mlx5/mlx5_rxtx.c\n@@ -51,6 +51,10 @@\n static __rte_always_inline void\n mprq_buf_replace(struct mlx5_rxq_data *rxq, uint16_t rq_idx);\n \n+static int\n+mlx5_queue_state_modify(struct rte_eth_dev *dev,\n+\t\t\tstruct mlx5_mp_arg_queue_state_modify *sm);\n+\n uint32_t mlx5_ptype_table[] __rte_cache_aligned = {\n \t[0xff] = RTE_PTYPE_ALL_MASK, /* Last entry for errored packet. */\n };\n@@ -570,52 +574,27 @@\n }\n \n /**\n- * Move QP from error state to running state.\n+ * Move QP from error state to running state and initialize indexes.\n  *\n- * @param txq\n- *   Pointer to TX queue structure.\n- * @param qp\n- *   The qp pointer for recovery.\n+ * @param txq_ctrl\n+ *   Pointer to TX queue control structure.\n  *\n  * @return\n- *   0 on success, else errno value.\n+ *   0 on success, else -1.\n  */\n static int\n-tx_recover_qp(struct mlx5_txq_data *txq, struct ibv_qp *qp)\n+tx_recover_qp(struct mlx5_txq_ctrl *txq_ctrl)\n {\n-\tint ret;\n-\tstruct ibv_qp_attr mod = {\n-\t\t\t\t\t.qp_state = IBV_QPS_RESET,\n-\t\t\t\t\t.port_num = 1,\n-\t\t\t\t};\n-\tret = mlx5_glue->modify_qp(qp, &mod, IBV_QP_STATE);\n-\tif (ret) {\n-\t\tDRV_LOG(ERR, \"Cannot change the Tx QP state to RESET %d\\n\",\n-\t\t\tret);\n-\t\treturn ret;\n-\t}\n-\tmod.qp_state = IBV_QPS_INIT;\n-\tret = mlx5_glue->modify_qp(qp, &mod,\n-\t\t\t\t   (IBV_QP_STATE | IBV_QP_PORT));\n-\tif (ret) {\n-\t\tDRV_LOG(ERR, \"Cannot change Tx QP state to INIT %d\\n\", ret);\n-\t\treturn ret;\n-\t}\n-\tmod.qp_state = IBV_QPS_RTR;\n-\tret = mlx5_glue->modify_qp(qp, &mod, IBV_QP_STATE);\n-\tif (ret) {\n-\t\tDRV_LOG(ERR, \"Cannot change Tx QP state to RTR %d\\n\", ret);\n-\t\treturn ret;\n-\t}\n-\tmod.qp_state = IBV_QPS_RTS;\n-\tret = mlx5_glue->modify_qp(qp, &mod, IBV_QP_STATE);\n-\tif (ret) {\n-\t\tDRV_LOG(ERR, \"Cannot change Tx QP state to RTS %d\\n\", ret);\n-\t\treturn ret;\n-\t}\n-\ttxq->wqe_ci = 0;\n-\ttxq->wqe_pi = 0;\n-\ttxq->elts_comp = 0;\n+\tstruct mlx5_mp_arg_queue_state_modify sm = {\n+\t\t\t.is_wq = 0,\n+\t\t\t.queue_id = txq_ctrl->txq.idx,\n+\t};\n+\n+\tif (mlx5_queue_state_modify(ETH_DEV(txq_ctrl->priv), &sm))\n+\t\treturn -1;\n+\ttxq_ctrl->txq.wqe_ci = 0;\n+\ttxq_ctrl->txq.wqe_pi = 0;\n+\ttxq_ctrl->txq.elts_comp = 0;\n \treturn 0;\n }\n \n@@ -690,8 +669,7 @@\n \t\t\t */\n \t\t\ttxq->stats.oerrors += ((txq->wqe_ci & wqe_m) -\n \t\t\t\t\t\tnew_wqe_pi) & wqe_m;\n-\t\tif ((rte_eal_process_type() == RTE_PROC_PRIMARY) &&\n-\t\t    tx_recover_qp(txq, txq_ctrl->ibv->qp) == 0) {\n+\t\tif (tx_recover_qp(txq_ctrl) == 0) {\n \t\t\ttxq->cq_ci++;\n \t\t\t/* Release all the remaining buffers. */\n \t\t\treturn txq->elts_head;\n@@ -2065,6 +2043,48 @@\n \t\t\trte_errno = errno;\n \t\t\treturn ret;\n \t\t}\n+\t} else {\n+\t\tstruct mlx5_txq_data *txq = (*priv->txqs)[sm->queue_id];\n+\t\tstruct mlx5_txq_ctrl *txq_ctrl =\n+\t\t\tcontainer_of(txq, struct mlx5_txq_ctrl, txq);\n+\t\tstruct ibv_qp_attr mod = {\n+\t\t\t.qp_state = IBV_QPS_RESET,\n+\t\t\t.port_num = (uint8_t)priv->ibv_port,\n+\t\t};\n+\t\tstruct ibv_qp *qp = txq_ctrl->ibv->qp;\n+\n+\t\tret = mlx5_glue->modify_qp(qp, &mod, IBV_QP_STATE);\n+\t\tif (ret) {\n+\t\t\tDRV_LOG(ERR, \"Cannot change the Tx QP state to RESET \"\n+\t\t\t\t\"%s\\n\", strerror(errno));\n+\t\t\trte_errno = errno;\n+\t\t\treturn ret;\n+\t\t}\n+\t\tmod.qp_state = IBV_QPS_INIT;\n+\t\tret = mlx5_glue->modify_qp(qp, &mod,\n+\t\t\t\t\t   (IBV_QP_STATE | IBV_QP_PORT));\n+\t\tif (ret) {\n+\t\t\tDRV_LOG(ERR, \"Cannot change Tx QP state to INIT %s\\n\",\n+\t\t\t\tstrerror(errno));\n+\t\t\trte_errno = errno;\n+\t\t\treturn ret;\n+\t\t}\n+\t\tmod.qp_state = IBV_QPS_RTR;\n+\t\tret = mlx5_glue->modify_qp(qp, &mod, IBV_QP_STATE);\n+\t\tif (ret) {\n+\t\t\tDRV_LOG(ERR, \"Cannot change Tx QP state to RTR %s\\n\",\n+\t\t\t\tstrerror(errno));\n+\t\t\trte_errno = errno;\n+\t\t\treturn ret;\n+\t\t}\n+\t\tmod.qp_state = IBV_QPS_RTS;\n+\t\tret = mlx5_glue->modify_qp(qp, &mod, IBV_QP_STATE);\n+\t\tif (ret) {\n+\t\t\tDRV_LOG(ERR, \"Cannot change Tx QP state to RTS %s\\n\",\n+\t\t\t\tstrerror(errno));\n+\t\t\trte_errno = errno;\n+\t\t\treturn ret;\n+\t\t}\n \t}\n \treturn 0;\n }\n",
    "prefixes": [
        "v1",
        "9/9"
    ]
}