get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8795,
    "url": "http://patches.dpdk.org/api/patches/8795/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1447096873-8353-3-git-send-email-konstantin.ananyev@intel.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": "<1447096873-8353-3-git-send-email-konstantin.ananyev@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1447096873-8353-3-git-send-email-konstantin.ananyev@intel.com",
    "date": "2015-11-09T19:21:13",
    "name": "[dpdk-dev,PATCHv6,2/2] ixgbe: fix TX hang when RS distance exceeds HW limit",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "28fb34e9adda7bec17abe35f81e682bb1d290bfb",
    "submitter": {
        "id": 33,
        "url": "http://patches.dpdk.org/api/people/33/?format=api",
        "name": "Ananyev, Konstantin",
        "email": "konstantin.ananyev@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1447096873-8353-3-git-send-email-konstantin.ananyev@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/8795/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/8795/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 06C47591F;\n\tMon,  9 Nov 2015 20:21:27 +0100 (CET)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 605B32E83\n\tfor <dev@dpdk.org>; Mon,  9 Nov 2015 20:21:25 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga102.jf.intel.com with ESMTP; 09 Nov 2015 11:21:24 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga003.jf.intel.com with ESMTP; 09 Nov 2015 11:21:22 -0800",
            "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\ttA9JLMBt010671; Mon, 9 Nov 2015 19:21:22 GMT",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id tA9JLLHa008404;\n\tMon, 9 Nov 2015 19:21:21 GMT",
            "(from kananye1@localhost)\n\tby sivswdev01.ir.intel.com with  id tA9JLLJ2008400;\n\tMon, 9 Nov 2015 19:21:21 GMT"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,266,1444719600\"; d=\"scan'208\";a=\"681609006\"",
        "From": "Konstantin Ananyev <konstantin.ananyev@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon,  9 Nov 2015 19:21:13 +0000",
        "Message-Id": "<1447096873-8353-3-git-send-email-konstantin.ananyev@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": [
            "<1447096873-8353-1-git-send-email-konstantin.ananyev@intel.com>",
            "<1440085070-13989-1-git-send-email-vladz@cloudius-systems.com>"
        ],
        "References": [
            "<1447096873-8353-1-git-send-email-konstantin.ananyev@intel.com>",
            "<1440085070-13989-1-git-send-email-vladz@cloudius-systems.com>"
        ],
        "Subject": "[dpdk-dev] [PATCHv6 2/2] ixgbe: fix TX hang when RS distance\n\texceeds HW limit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "One of the ways to reproduce the issue:\n\ntestpmd <EAL-OPTIONS> -- -i --txqflags=0\ntestpmd> set fwd txonly\ntestpmd> set txpkts 64,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4\ntestpmd> set txsplit rand\ntestpmd> start\n\nAfter some time TX on ixgbe queue will hang,\nand all packet transmission on that queue will stop.\n\nThis bug was first reported and investigated by\nVlad Zolotarov <vladz@cloudius-systems.com>:\n\"We can reproduce this issue when stressed the xmit path with a lot of highly\nfragmented TCP frames (packets with up to 33 fragments with non-headers\nfragments as small as 4 bytes) with all offload features enabled.\"\n\nThe root cause is that ixgbe_xmit_pkts() in some cases violates the HW rule\nthat the distance between TDs with RS bit set should not exceed 40 TDs.\n\nFrom the latest 82599 spec update:\n\"When WTHRESH is set to zero, the software device driver should set the RS bit\nin the Tx descriptors with the EOP bit set and at least once in the 40\ndescriptors.\"\n\nThe fix is to make sure that the distance between TDs with RS bit set\nwould never exceed HW limit.\nAs part of that fix, tx_rs_thresh for ixgbe PMD is not allowed to be greater\nthen to 32 to comply with HW restrictions.\n\nWith that fix slight slowdown for the full-featured ixgbe TX path\nmight be observed (from our testing - up to 4%).\n\nixgbe simple TX path is unaffected by that patch.\n\nv5 changes:\n- rework the patch to avoid setting RS bit on every EOP descriptor\n (while that approach is valid, it causes significant slowdown\n  on the TX path: up to 25%).\n\nv6 changes:\n- fix pmd_perf_autotest\n- fix error description\n- update RN\n\nReported-by: Vlad Zolotarov <vladz@cloudius-systems.com>\nSigned-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n app/test/test_pmd_perf.c             |  8 ++++----\n doc/guides/rel_notes/release_2_2.rst |  7 +++++++\n drivers/net/ixgbe/ixgbe_rxtx.c       | 32 +++++++++++++++++++++++++++-----\n 3 files changed, 38 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c\nindex 1fd6843..ef9262c 100644\n--- a/app/test/test_pmd_perf.c\n+++ b/app/test/test_pmd_perf.c\n@@ -841,10 +841,10 @@ test_set_rxtx_conf(cmdline_fixed_string_t mode)\n \t\tport_conf.rxmode.enable_scatter = 0;\n \t\treturn 0;\n \t} else if (!strcmp(mode, \"scalar\")) {\n-\t\t/* bulk alloc rx, simple tx */\n-\t\ttx_conf.txq_flags = 0xf01;\n-\t\ttx_conf.tx_rs_thresh = 128;\n-\t\ttx_conf.tx_free_thresh = 128;\n+\t\t/* bulk alloc rx, full-featured tx */\n+\t\ttx_conf.txq_flags = 0;\n+\t\ttx_conf.tx_rs_thresh = 32;\n+\t\ttx_conf.tx_free_thresh = 32;\n \t\tport_conf.rxmode.hw_ip_checksum = 1;\n \t\tport_conf.rxmode.enable_scatter = 0;\n \t\treturn 0;\ndiff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst\nindex 59dda59..62e225b 100644\n--- a/doc/guides/rel_notes/release_2_2.rst\n+++ b/doc/guides/rel_notes/release_2_2.rst\n@@ -134,6 +134,13 @@ Drivers\n \n   VF needs the PF interrupt support initialized even if not started.\n \n+* **ixgbe: Fixed TX hang when RS distance exceeds HW limit.**\n+\n+  Fixed an issue when TX queue can hang when a lot of highly fragmented\n+  packets have to be sent.\n+  As part of that fix, tx_rs_thresh for ixgbe PMD is not allowed to be greater\n+  then to 32 to comply with HW restrictions.\n+\n * **i40e: Fixed base driver allocation when not using first numa node.**\n \n   Fixed i40e issue that occurred when a DPDK application didn't initialize\ndiff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c\nindex 5561195..ca6fb69 100644\n--- a/drivers/net/ixgbe/ixgbe_rxtx.c\n+++ b/drivers/net/ixgbe/ixgbe_rxtx.c\n@@ -572,7 +572,7 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \tstruct ixgbe_tx_entry *sw_ring;\n \tstruct ixgbe_tx_entry *txe, *txn;\n \tvolatile union ixgbe_adv_tx_desc *txr;\n-\tvolatile union ixgbe_adv_tx_desc *txd;\n+\tvolatile union ixgbe_adv_tx_desc *txd, *txp;\n \tstruct rte_mbuf     *tx_pkt;\n \tstruct rte_mbuf     *m_seg;\n \tuint64_t buf_dma_addr;\n@@ -595,6 +595,7 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \ttxr     = txq->tx_ring;\n \ttx_id   = txq->tx_tail;\n \ttxe = &sw_ring[tx_id];\n+\ttxp = NULL;\n \n \t/* Determine if the descriptor ring needs to be cleaned. */\n \tif (txq->nb_tx_free < txq->tx_free_thresh)\n@@ -638,6 +639,12 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\t */\n \t\tnb_used = (uint16_t)(tx_pkt->nb_segs + new_ctx);\n \n+\t\tif (txp != NULL &&\n+\t\t\t\tnb_used + txq->nb_tx_used >= txq->tx_rs_thresh)\n+\t\t\t/* set RS on the previous packet in the burst */\n+\t\t\ttxp->read.cmd_type_len |=\n+\t\t\t\trte_cpu_to_le_32(IXGBE_TXD_CMD_RS);\n+\n \t\t/*\n \t\t * The number of descriptors that must be allocated for a\n \t\t * packet is the number of segments of that packet, plus 1\n@@ -840,10 +847,18 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \n \t\t\t/* Update txq RS bit counters */\n \t\t\ttxq->nb_tx_used = 0;\n-\t\t}\n+\t\t\ttxp = NULL;\n+\t\t} else\n+\t\t\ttxp = txd;\n+\n \t\ttxd->read.cmd_type_len |= rte_cpu_to_le_32(cmd_type_len);\n \t}\n+\n end_of_tx:\n+\t/* set RS on last packet in the burst */\n+\tif (txp != NULL)\n+\t\ttxp->read.cmd_type_len |= rte_cpu_to_le_32(IXGBE_TXD_CMD_RS);\n+\n \trte_wmb();\n \n \t/*\n@@ -2019,9 +2034,16 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,\n \t\t\ttx_conf->tx_free_thresh : DEFAULT_TX_FREE_THRESH);\n \tif (tx_rs_thresh >= (nb_desc - 2)) {\n \t\tPMD_INIT_LOG(ERR, \"tx_rs_thresh must be less than the number \"\n-\t\t\t     \"of TX descriptors minus 2. (tx_rs_thresh=%u \"\n-\t\t\t     \"port=%d queue=%d)\", (unsigned int)tx_rs_thresh,\n-\t\t\t     (int)dev->data->port_id, (int)queue_idx);\n+\t\t\t\"of TX descriptors minus 2. (tx_rs_thresh=%u \"\n+\t\t\t\"port=%d queue=%d)\", (unsigned int)tx_rs_thresh,\n+\t\t\t(int)dev->data->port_id, (int)queue_idx);\n+\t\treturn -(EINVAL);\n+\t}\n+\tif (tx_rs_thresh > DEFAULT_TX_RS_THRESH) {\n+\t\tPMD_INIT_LOG(ERR, \"tx_rs_thresh must be less or equal than %u. \"\n+\t\t\t\"(tx_rs_thresh=%u port=%d queue=%d)\",\n+\t\t\tDEFAULT_TX_RS_THRESH, (unsigned int)tx_rs_thresh,\n+\t\t\t(int)dev->data->port_id, (int)queue_idx);\n \t\treturn -(EINVAL);\n \t}\n \tif (tx_free_thresh >= (nb_desc - 3)) {\n",
    "prefixes": [
        "dpdk-dev",
        "PATCHv6",
        "2/2"
    ]
}