get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57410,
    "url": "https://patches.dpdk.org/api/patches/57410/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1564926927-31450-1-git-send-email-viacheslavo@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": "<1564926927-31450-1-git-send-email-viacheslavo@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1564926927-31450-1-git-send-email-viacheslavo@mellanox.com",
    "date": "2019-08-04T13:55:27",
    "name": "net/mlx5: fix completion queue overflow for large bursts",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "2c2131200575eb5688efee21a125f39a7917867c",
    "submitter": {
        "id": 1102,
        "url": "https://patches.dpdk.org/api/people/1102/?format=api",
        "name": "Slava Ovsiienko",
        "email": "viacheslavo@mellanox.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/1564926927-31450-1-git-send-email-viacheslavo@mellanox.com/mbox/",
    "series": [
        {
            "id": 5901,
            "url": "https://patches.dpdk.org/api/series/5901/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5901",
            "date": "2019-08-04T13:55:27",
            "name": "net/mlx5: fix completion queue overflow for large bursts",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/5901/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/57410/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/57410/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 523651BE73;\n\tSun,  4 Aug 2019 15:55:33 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id 727B11BE6B\n\tfor <dev@dpdk.org>; Sun,  4 Aug 2019 15:55:32 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE2 (envelope-from\n\tviacheslavo@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 4 Aug 2019 16:55:31 +0300",
            "from pegasus12.mtr.labs.mlnx (pegasus12.mtr.labs.mlnx\n\t[10.210.17.40])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x74DtVmr002787;\n\tSun, 4 Aug 2019 16:55:31 +0300",
            "from pegasus12.mtr.labs.mlnx (localhost [127.0.0.1])\n\tby pegasus12.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id\n\tx74DtV7q031494; Sun, 4 Aug 2019 13:55:31 GMT",
            "(from viacheslavo@localhost)\n\tby pegasus12.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id x74DtU50031493; \n\tSun, 4 Aug 2019 13:55:30 GMT"
        ],
        "X-Authentication-Warning": "pegasus12.mtr.labs.mlnx: viacheslavo set sender to\n\tviacheslavo@mellanox.com using -f",
        "From": "Viacheslav Ovsiienko <viacheslavo@mellanox.com>",
        "To": "dev@dpdk.org",
        "Cc": "yskoh@mellanox.com, shahafs@mellanox.com",
        "Date": "Sun,  4 Aug 2019 13:55:27 +0000",
        "Message-Id": "<1564926927-31450-1-git-send-email-viacheslavo@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "Subject": "[dpdk-dev] [PATCH] net/mlx5: fix completion queue overflow for\n\tlarge bursts",
        "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": "There is the limit on completion descriptor fetch to improve\nlatency. If burst size is large there might be not enough\nresources freed in completion processing. This fix reiterates\nsending loop and allows multiple completion descriptor fetch\nand processing.\n\nFixes: 18a1c20044c0 (\"net/mlx5: implement Tx burst template\")\n\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n drivers/net/mlx5/mlx5_rxtx.c | 29 ++++++++++++++++++++---------\n drivers/net/mlx5/mlx5_rxtx.h |  1 +\n 2 files changed, 21 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c\nindex 308133b..4b26562 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.c\n+++ b/drivers/net/mlx5/mlx5_rxtx.c\n@@ -4522,6 +4522,14 @@ enum mlx5_txcmp_code {\n \n \tassert(txq->elts_s >= (uint16_t)(txq->elts_head - txq->elts_tail));\n \tassert(txq->wqe_s >= (uint16_t)(txq->wqe_ci - txq->wqe_pi));\n+\tif (unlikely(!pkts_n))\n+\t\treturn 0;\n+\tloc.pkts_sent = 0;\n+\tloc.pkts_copy = 0;\n+\tloc.wqe_last = NULL;\n+\n+send_loop:\n+\tloc.pkts_loop = loc.pkts_sent;\n \t/*\n \t * Check if there are some CQEs, if any:\n \t * - process an encountered errors\n@@ -4529,9 +4537,7 @@ enum mlx5_txcmp_code {\n \t * - free related mbufs\n \t * - doorbell the NIC about processed CQEs\n \t */\n-\tif (unlikely(!pkts_n))\n-\t\treturn 0;\n-\trte_prefetch0(*pkts);\n+\trte_prefetch0(*(pkts + loc.pkts_sent));\n \tmlx5_tx_handle_completion(txq, olx);\n \t/*\n \t * Calculate the number of available resources - elts and WQEs.\n@@ -4548,10 +4554,7 @@ enum mlx5_txcmp_code {\n \tloc.wqe_free = txq->wqe_s -\n \t\t\t\t(uint16_t)(txq->wqe_ci - txq->wqe_pi);\n \tif (unlikely(!loc.elts_free || !loc.wqe_free))\n-\t\treturn 0;\n-\tloc.pkts_sent = 0;\n-\tloc.pkts_copy = 0;\n-\tloc.wqe_last = NULL;\n+\t\treturn loc.pkts_sent;\n \tfor (;;) {\n \t\t/*\n \t\t * Fetch the packet from array. Usually this is\n@@ -4717,8 +4720,8 @@ enum mlx5_txcmp_code {\n \t */\n \tassert(MLX5_TXOFF_CONFIG(INLINE) || loc.pkts_sent >= loc.pkts_copy);\n \t/* Take a shortcut if nothing is sent. */\n-\tif (unlikely(loc.pkts_sent == 0))\n-\t\treturn 0;\n+\tif (unlikely(loc.pkts_sent == loc.pkts_loop))\n+\t\treturn loc.pkts_sent;\n \t/*\n \t * Ring QP doorbell immediately after WQE building completion\n \t * to improve latencies. The pure software related data treatment\n@@ -4747,6 +4750,14 @@ enum mlx5_txcmp_code {\n #endif\n \tassert(txq->elts_s >= (uint16_t)(txq->elts_head - txq->elts_tail));\n \tassert(txq->wqe_s >= (uint16_t)(txq->wqe_ci - txq->wqe_pi));\n+\tif (pkts_n > loc.pkts_sent) {\n+\t\t/*\n+\t\t * If burst size is large there might be no enough CQE\n+\t\t * fetched from completion queue and no enough resources\n+\t\t * freed to send all the packets.\n+\t\t */\n+\t\tgoto send_loop;\n+\t}\n \treturn loc.pkts_sent;\n }\n \ndiff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h\nindex aaa02a2..bad9e9c 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.h\n+++ b/drivers/net/mlx5/mlx5_rxtx.h\n@@ -239,6 +239,7 @@ struct mlx5_txq_local {\n \tstruct rte_mbuf *mbuf; /* first mbuf to process. */\n \tuint16_t pkts_copy; /* packets copied to elts. */\n \tuint16_t pkts_sent; /* packets sent. */\n+\tuint16_t pkts_loop; /* packets sent on loop entry. */\n \tuint16_t elts_free; /* available elts remain. */\n \tuint16_t wqe_free; /* available wqe remain. */\n \tuint16_t mbuf_off; /* data offset in current mbuf. */\n",
    "prefixes": []
}