get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 522954,
    "url": "http://patchwork.ozlabs.org/api/patches/522954/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1443207609-171288-2-git-send-email-anjali.singhai@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1443207609-171288-2-git-send-email-anjali.singhai@intel.com>",
    "list_archive_url": null,
    "date": "2015-09-25T19:00:09",
    "name": "[2/2] i40e: Disable Check for Hang",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "4c770663cf0a863919034780b719fc4d611fef58",
    "submitter": {
        "id": 65487,
        "url": "http://patchwork.ozlabs.org/api/people/65487/?format=api",
        "name": "Singhai, Anjali",
        "email": "anjali.singhai@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1443207609-171288-2-git-send-email-anjali.singhai@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/522954/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/522954/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ozlabs.org (Postfix) with ESMTP id B2E1C140779\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 26 Sep 2015 04:44:17 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 105A733FFC;\n\tFri, 25 Sep 2015 18:44:17 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id wwOK7w4EbY6c; Fri, 25 Sep 2015 18:44:15 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 63B6733FF9;\n\tFri, 25 Sep 2015 18:44:15 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id D25EB1C151A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 25 Sep 2015 18:44:12 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id CE0B492F0F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 25 Sep 2015 18:44:12 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id HslhhABWLpkt for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 25 Sep 2015 18:44:10 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id ADD3893096\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 25 Sep 2015 18:44:10 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga102.fm.intel.com with ESMTP; 25 Sep 2015 11:44:10 -0700",
            "from asinghai-cp.jf.intel.com ([134.134.3.57])\n\tby FMSMGA003.fm.intel.com with ESMTP; 25 Sep 2015 11:44:11 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.17,588,1437462000\"; d=\"scan'208\";a=\"568508210\"",
        "From": "Anjali Singhai Jain <anjali.singhai@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri, 25 Sep 2015 12:00:09 -0700",
        "Message-Id": "<1443207609-171288-2-git-send-email-anjali.singhai@intel.com>",
        "X-Mailer": "git-send-email 1.8.1.4",
        "In-Reply-To": "<1443207609-171288-1-git-send-email-anjali.singhai@intel.com>",
        "References": "<1443207609-171288-1-git-send-email-anjali.singhai@intel.com>",
        "Subject": "[Intel-wired-lan] [PATCH 2/2] i40e: Disable Check for Hang",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "The driver doesn't need its own check for hang logic as there are no\nknown issues that cause HW Tx Hangs. This logic was actually\n(mis)firing frequently, causing us to reset when we didn't need to.\nIf a true tx hang happens, just wait for the stack logic to catch the\nissue and send us a tx_timeout.\n\nSigned-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_main.c | 99 +----------------------------\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 70 --------------------\n drivers/net/ethernet/intel/i40e/i40e_txrx.h |  8 ---\n 3 files changed, 1 insertion(+), 176 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex f048002..7b92d1d 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -758,7 +758,6 @@ static void i40e_update_link_xoff_rx(struct i40e_pf *pf)\n \tstruct i40e_hw_port_stats *nsd = &pf->stats;\n \tstruct i40e_hw *hw = &pf->hw;\n \tu64 xoff = 0;\n-\tu16 i, v;\n \n \tif ((hw->fc.current_mode != I40E_FC_FULL) &&\n \t    (hw->fc.current_mode != I40E_FC_RX_PAUSE))\n@@ -772,20 +771,6 @@ static void i40e_update_link_xoff_rx(struct i40e_pf *pf)\n \t/* No new LFC xoff rx */\n \tif (!(nsd->link_xoff_rx - xoff))\n \t\treturn;\n-\n-\t/* Clear the __I40E_HANG_CHECK_ARMED bit for all Tx rings */\n-\tfor (v = 0; v < pf->num_alloc_vsi; v++) {\n-\t\tstruct i40e_vsi *vsi = pf->vsi[v];\n-\n-\t\tif (!vsi || !vsi->tx_rings[0])\n-\t\t\tcontinue;\n-\n-\t\tfor (i = 0; i < vsi->num_queue_pairs; i++) {\n-\t\t\tstruct i40e_ring *ring = vsi->tx_rings[i];\n-\n-\t\t\tclear_bit(__I40E_HANG_CHECK_ARMED, &ring->state);\n-\t\t}\n-\t}\n }\n \n /**\n@@ -801,7 +786,7 @@ static void i40e_update_prio_xoff_rx(struct i40e_pf *pf)\n \tbool xoff[I40E_MAX_TRAFFIC_CLASS] = {false};\n \tstruct i40e_dcbx_config *dcb_cfg;\n \tstruct i40e_hw *hw = &pf->hw;\n-\tu16 i, v;\n+\tu16 i;\n \tu8 tc;\n \n \tdcb_cfg = &hw->local_dcbx_config;\n@@ -827,23 +812,6 @@ static void i40e_update_prio_xoff_rx(struct i40e_pf *pf)\n \t\ttc = dcb_cfg->etscfg.prioritytable[i];\n \t\txoff[tc] = true;\n \t}\n-\n-\t/* Clear the __I40E_HANG_CHECK_ARMED bit for Tx rings */\n-\tfor (v = 0; v < pf->num_alloc_vsi; v++) {\n-\t\tstruct i40e_vsi *vsi = pf->vsi[v];\n-\n-\t\tif (!vsi || !vsi->tx_rings[0])\n-\t\t\tcontinue;\n-\n-\t\tfor (i = 0; i < vsi->num_queue_pairs; i++) {\n-\t\t\tstruct i40e_ring *ring = vsi->tx_rings[i];\n-\n-\t\t\ttc = ring->dcb_tc;\n-\t\t\tif (xoff[tc])\n-\t\t\t\tclear_bit(__I40E_HANG_CHECK_ARMED,\n-\t\t\t\t\t  &ring->state);\n-\t\t}\n-\t}\n }\n \n /**\n@@ -2803,8 +2771,6 @@ static int i40e_configure_tx_ring(struct i40e_ring *ring)\n \twr32(hw, I40E_QTX_CTL(pf_q), qtx_ctl);\n \ti40e_flush(hw);\n \n-\tclear_bit(__I40E_HANG_CHECK_ARMED, &ring->state);\n-\n \t/* cache tail off for easier writes later */\n \tring->tail = hw->hw_addr + I40E_QTX_TAIL(pf_q);\n \n@@ -5949,68 +5915,6 @@ static void i40e_link_event(struct i40e_pf *pf)\n }\n \n /**\n- * i40e_check_hang_subtask - Check for hung queues and dropped interrupts\n- * @pf: board private structure\n- *\n- * Set the per-queue flags to request a check for stuck queues in the irq\n- * clean functions, then force interrupts to be sure the irq clean is called.\n- **/\n-static void i40e_check_hang_subtask(struct i40e_pf *pf)\n-{\n-\tint i, v;\n-\n-\t/* If we're down or resetting, just bail */\n-\tif (test_bit(__I40E_DOWN, &pf->state) ||\n-\t    test_bit(__I40E_CONFIG_BUSY, &pf->state))\n-\t\treturn;\n-\n-\t/* for each VSI/netdev\n-\t *     for each Tx queue\n-\t *         set the check flag\n-\t *     for each q_vector\n-\t *         force an interrupt\n-\t */\n-\tfor (v = 0; v < pf->num_alloc_vsi; v++) {\n-\t\tstruct i40e_vsi *vsi = pf->vsi[v];\n-\t\tint armed = 0;\n-\n-\t\tif (!pf->vsi[v] ||\n-\t\t    test_bit(__I40E_DOWN, &vsi->state) ||\n-\t\t    (vsi->netdev && !netif_carrier_ok(vsi->netdev)))\n-\t\t\tcontinue;\n-\n-\t\tfor (i = 0; i < vsi->num_queue_pairs; i++) {\n-\t\t\tset_check_for_tx_hang(vsi->tx_rings[i]);\n-\t\t\tif (test_bit(__I40E_HANG_CHECK_ARMED,\n-\t\t\t\t     &vsi->tx_rings[i]->state))\n-\t\t\t\tarmed++;\n-\t\t}\n-\n-\t\tif (armed) {\n-\t\t\tif (!(pf->flags & I40E_FLAG_MSIX_ENABLED)) {\n-\t\t\t\twr32(&vsi->back->hw, I40E_PFINT_DYN_CTL0,\n-\t\t\t\t     (I40E_PFINT_DYN_CTL0_INTENA_MASK |\n-\t\t\t\t      I40E_PFINT_DYN_CTL0_SWINT_TRIG_MASK |\n-\t\t\t\t      I40E_PFINT_DYN_CTL0_ITR_INDX_MASK |\n-\t\t\t\t      I40E_PFINT_DYN_CTL0_SW_ITR_INDX_ENA_MASK |\n-\t\t\t\t      I40E_PFINT_DYN_CTL0_SW_ITR_INDX_MASK));\n-\t\t\t} else {\n-\t\t\t\tu16 vec = vsi->base_vector - 1;\n-\t\t\t\tu32 val = (I40E_PFINT_DYN_CTLN_INTENA_MASK |\n-\t\t\t\t      I40E_PFINT_DYN_CTLN_SWINT_TRIG_MASK |\n-\t\t\t\t      I40E_PFINT_DYN_CTLN_ITR_INDX_MASK |\n-\t\t\t\t      I40E_PFINT_DYN_CTLN_SW_ITR_INDX_ENA_MASK |\n-\t\t\t\t      I40E_PFINT_DYN_CTLN_SW_ITR_INDX_MASK);\n-\t\t\t\tfor (i = 0; i < vsi->num_q_vectors; i++, vec++)\n-\t\t\t\t\twr32(&vsi->back->hw,\n-\t\t\t\t\t     I40E_PFINT_DYN_CTLN(vec), val);\n-\t\t\t}\n-\t\t\ti40e_flush(&vsi->back->hw);\n-\t\t}\n-\t}\n-}\n-\n-/**\n  * i40e_watchdog_subtask - periodic checks not using event driven response\n  * @pf: board private structure\n  **/\n@@ -6029,7 +5933,6 @@ static void i40e_watchdog_subtask(struct i40e_pf *pf)\n \t\treturn;\n \tpf->service_timer_previous = jiffies;\n \n-\ti40e_check_hang_subtask(pf);\n \tif (pf->flags & I40E_FLAG_LINK_POLLING_ENABLED)\n \t\ti40e_link_event(pf);\n \ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex f75db56..a30e3a1 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -636,50 +636,6 @@ static u32 i40e_get_tx_pending(struct i40e_ring *ring)\n \treturn 0;\n }\n \n-/**\n- * i40e_check_tx_hang - Is there a hang in the Tx queue\n- * @tx_ring: the ring of descriptors\n- **/\n-static bool i40e_check_tx_hang(struct i40e_ring *tx_ring)\n-{\n-\tu32 tx_done = tx_ring->stats.packets;\n-\tu32 tx_done_old = tx_ring->tx_stats.tx_done_old;\n-\tu32 tx_pending = i40e_get_tx_pending(tx_ring);\n-\tstruct i40e_pf *pf = tx_ring->vsi->back;\n-\tbool ret = false;\n-\n-\tclear_check_for_tx_hang(tx_ring);\n-\n-\t/* Check for a hung queue, but be thorough. This verifies\n-\t * that a transmit has been completed since the previous\n-\t * check AND there is at least one packet pending. The\n-\t * ARMED bit is set to indicate a potential hang. The\n-\t * bit is cleared if a pause frame is received to remove\n-\t * false hang detection due to PFC or 802.3x frames. By\n-\t * requiring this to fail twice we avoid races with\n-\t * PFC clearing the ARMED bit and conditions where we\n-\t * run the check_tx_hang logic with a transmit completion\n-\t * pending but without time to complete it yet.\n-\t */\n-\tif ((tx_done_old == tx_done) && tx_pending) {\n-\t\t/* make sure it is true for two checks in a row */\n-\t\tret = test_and_set_bit(__I40E_HANG_CHECK_ARMED,\n-\t\t\t\t       &tx_ring->state);\n-\t} else if (tx_done_old == tx_done &&\n-\t\t   (tx_pending < I40E_MIN_DESC_PENDING) && (tx_pending > 0)) {\n-\t\tif (I40E_DEBUG_FLOW & pf->hw.debug_mask)\n-\t\t\tdev_info(tx_ring->dev, \"HW needs some more descs to do a cacheline flush. tx_pending %d, queue %d\",\n-\t\t\t\t tx_pending, tx_ring->queue_index);\n-\t\tpf->tx_sluggish_count++;\n-\t} else {\n-\t\t/* update completed stats and disarm the hang check */\n-\t\ttx_ring->tx_stats.tx_done_old = tx_done;\n-\t\tclear_bit(__I40E_HANG_CHECK_ARMED, &tx_ring->state);\n-\t}\n-\n-\treturn ret;\n-}\n-\n #define WB_STRIDE 0x3\n \n /**\n@@ -801,32 +757,6 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)\n \t\t\ttx_ring->arm_wb = true;\n \t}\n \n-\tif (check_for_tx_hang(tx_ring) && i40e_check_tx_hang(tx_ring)) {\n-\t\t/* schedule immediate reset if we believe we hung */\n-\t\tdev_info(tx_ring->dev, \"Detected Tx Unit Hang\\n\"\n-\t\t\t \"  VSI                  <%d>\\n\"\n-\t\t\t \"  Tx Queue             <%d>\\n\"\n-\t\t\t \"  next_to_use          <%x>\\n\"\n-\t\t\t \"  next_to_clean        <%x>\\n\",\n-\t\t\t tx_ring->vsi->seid,\n-\t\t\t tx_ring->queue_index,\n-\t\t\t tx_ring->next_to_use, i);\n-\n-\t\tnetif_stop_subqueue(tx_ring->netdev, tx_ring->queue_index);\n-\n-\t\tdev_info(tx_ring->dev,\n-\t\t\t \"tx hang detected on queue %d, reset requested\\n\",\n-\t\t\t tx_ring->queue_index);\n-\n-\t\t/* do not fire the reset immediately, wait for the stack to\n-\t\t * decide we are truly stuck, also prevents every queue from\n-\t\t * simultaneously requesting a reset\n-\t\t */\n-\n-\t\t/* the adapter is about to reset, no point in enabling polling */\n-\t\tbudget = 1;\n-\t}\n-\n \tnetdev_tx_completed_queue(netdev_get_tx_queue(tx_ring->netdev,\n \t\t\t\t\t\t      tx_ring->queue_index),\n \t\t\t\t  total_packets, total_bytes);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\nindex 4871809..809e170 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n@@ -201,8 +201,6 @@ struct i40e_rx_queue_stats {\n enum i40e_ring_state_t {\n \t__I40E_TX_FDIR_INIT_DONE,\n \t__I40E_TX_XPS_INIT_DONE,\n-\t__I40E_TX_DETECT_HANG,\n-\t__I40E_HANG_CHECK_ARMED,\n \t__I40E_RX_PS_ENABLED,\n \t__I40E_RX_16BYTE_DESC_ENABLED,\n };\n@@ -213,12 +211,6 @@ enum i40e_ring_state_t {\n \tset_bit(__I40E_RX_PS_ENABLED, &(ring)->state)\n #define clear_ring_ps_enabled(ring) \\\n \tclear_bit(__I40E_RX_PS_ENABLED, &(ring)->state)\n-#define check_for_tx_hang(ring) \\\n-\ttest_bit(__I40E_TX_DETECT_HANG, &(ring)->state)\n-#define set_check_for_tx_hang(ring) \\\n-\tset_bit(__I40E_TX_DETECT_HANG, &(ring)->state)\n-#define clear_check_for_tx_hang(ring) \\\n-\tclear_bit(__I40E_TX_DETECT_HANG, &(ring)->state)\n #define ring_is_16byte_desc_enabled(ring) \\\n \ttest_bit(__I40E_RX_16BYTE_DESC_ENABLED, &(ring)->state)\n #define set_ring_16byte_desc_enabled(ring) \\\n",
    "prefixes": [
        "2/2"
    ]
}