get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8788,
    "url": "http://patches.dpdk.org/api/patches/8788/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1447060816-9923-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": "<1447060816-9923-3-git-send-email-konstantin.ananyev@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1447060816-9923-3-git-send-email-konstantin.ananyev@intel.com",
    "date": "2015-11-09T09:20:16",
    "name": "[dpdk-dev,PATCHv5,2/2] ixgbe: fix TX hang when RS distance exceeds HW limit",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c43eb19f42b9bf1b0423017da210790b40a0ead2",
    "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/1447060816-9923-3-git-send-email-konstantin.ananyev@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/8788/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/8788/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 9084F568A;\n\tMon,  9 Nov 2015 10:20:47 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id A6A77532D\n\tfor <dev@dpdk.org>; Mon,  9 Nov 2015 10:20:46 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga103.fm.intel.com with ESMTP; 09 Nov 2015 01:20:45 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby FMSMGA003.fm.intel.com with ESMTP; 09 Nov 2015 01:20:44 -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\ttA99Kh8r025894; Mon, 9 Nov 2015 09:20:43 GMT",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id tA99Kh6Q010200;\n\tMon, 9 Nov 2015 09:20:43 GMT",
            "(from kananye1@localhost)\n\tby sivswdev01.ir.intel.com with  id tA99Kh5A010196;\n\tMon, 9 Nov 2015 09:20:43 GMT"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,265,1444719600\"; d=\"scan'208\";a=\"596770632\"",
        "From": "Konstantin Ananyev <konstantin.ananyev@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon,  9 Nov 2015 09:20:16 +0000",
        "Message-Id": "<1447060816-9923-3-git-send-email-konstantin.ananyev@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1447060816-9923-1-git-send-email-konstantin.ananyev@intel.com>",
        "References": "<1447060816-9923-1-git-send-email-konstantin.ananyev@intel.com>",
        "Subject": "[dpdk-dev] [PATCHv5 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.\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\nReported-by: Vlad Zolotarov <vladz@cloudius-systems.com>\nSigned-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n drivers/net/ixgbe/ixgbe_rxtx.c | 32 +++++++++++++++++++++++++++-----\n 1 file changed, 27 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c\nindex 5561195..80cae5e 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 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",
        "PATCHv5",
        "2/2"
    ]
}