get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1285698,
    "url": "http://patchwork.ozlabs.org/api/patches/1285698/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200508004113.39725-2-anthony.l.nguyen@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": "<20200508004113.39725-2-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2020-05-08T00:41:00",
    "name": "[S41,02/15] ice: Don't reset and rebuild for Tx timeout on PFC enabled queue",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "d6adf39b0f751686d63bccbf5c208aafcb89173e",
    "submitter": {
        "id": 68875,
        "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api",
        "name": "Tony Nguyen",
        "email": "anthony.l.nguyen@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/20200508004113.39725-2-anthony.l.nguyen@intel.com/mbox/",
    "series": [
        {
            "id": 175527,
            "url": "http://patchwork.ozlabs.org/api/series/175527/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=175527",
            "date": "2020-05-08T00:41:10",
            "name": "[S41,01/15] ice: Add VF promiscuous support",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/175527/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1285698/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1285698/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@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"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.136; helo=silver.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)",
            "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49JBR868r2z9sSG\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  8 May 2020 10:44:04 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 46F402050A;\n\tFri,  8 May 2020 00:44:03 +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 WTT56ItG9FL2; Fri,  8 May 2020 00:43:53 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id E604A21543;\n\tFri,  8 May 2020 00:43:46 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by ash.osuosl.org (Postfix) with ESMTP id 948A31BF2C4\n for <intel-wired-lan@lists.osuosl.org>; Fri,  8 May 2020 00:43:42 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by whitealder.osuosl.org (Postfix) with ESMTP id 91A72878C1\n for <intel-wired-lan@lists.osuosl.org>; Fri,  8 May 2020 00:43:42 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id JjosAm1DQmMC for <intel-wired-lan@lists.osuosl.org>;\n Fri,  8 May 2020 00:43:34 +0000 (UTC)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by whitealder.osuosl.org (Postfix) with ESMTPS id 5D7AF87886\n for <intel-wired-lan@lists.osuosl.org>; Fri,  8 May 2020 00:43:34 +0000 (UTC)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 07 May 2020 17:43:33 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.241.65])\n by orsmga007.jf.intel.com with ESMTP; 07 May 2020 17:43:33 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "IronPort-SDR": [
            "\n RCXNF+LinJ6l4EHzC/H2Q8fjjGkCw9M5/js4YCWG6YoUD9EHVgcIOfuNL9rGniT3DUs8+K/Bdo\n EwzZkEi0ej4g==",
            "\n NF2PigbkkzCreM3/kJ8pZvWlAA9TDz7Dohdda7LJEkHnjYxazDbFlmB6pdqPKRxcCOh1ZCFE8E\n FVzxkdBR/gqQ=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.73,365,1583222400\"; d=\"scan'208\";a=\"249468767\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Thu,  7 May 2020 17:41:00 -0700",
        "Message-Id": "<20200508004113.39725-2-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20200508004113.39725-1-anthony.l.nguyen@intel.com>",
        "References": "<20200508004113.39725-1-anthony.l.nguyen@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH S41 02/15] ice: Don't reset and rebuild\n for Tx timeout on PFC enabled queue",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Avinash JD <avinash.dayanand@intel.com>\n\nWhen there's a Tx timeout for a queue which belongs to a PFC enabled TC,\nthen it's not because the queue is hung but because PFC is in action.\n\nIn PFC, peer sends a pause frame for a specified period of time when its\nbuffer threshold is exceeded (due to congestion). Netdev on the other\nhand checks if ACK is received within a specified time for a TX packet, if\nnot, it'll invoke the tx_timeout routine.\n\nSigned-off-by: Avinash JD <avinash.dayanand@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 58 ++++++++++++++++++++\n drivers/net/ethernet/intel/ice/ice_dcb_lib.h | 23 ++++++++\n drivers/net/ethernet/intel/ice/ice_main.c    | 10 ++++\n drivers/net/ethernet/intel/ice/ice_type.h    |  2 +\n 4 files changed, 93 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\nindex c4f8be0c0b24..d91bd72eebdc 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n@@ -62,6 +62,64 @@ u8 ice_dcb_get_ena_tc(struct ice_dcbx_cfg *dcbcfg)\n \treturn ena_tc;\n }\n \n+/**\n+ * ice_is_pfc_causing_hung_q\n+ * @pf: pointer to PF structure\n+ * @txqueue: Tx queue which is supposedly hung queue\n+ *\n+ * find if PFC is causing the hung queue, if yes return true else false\n+ */\n+bool ice_is_pfc_causing_hung_q(struct ice_pf *pf, unsigned int txqueue)\n+{\n+\tu8 num_tcs = 0, i, tc, up_mapped_tc, up_in_tc = 0;\n+\tu64 ref_prio_xoff[ICE_MAX_UP];\n+\tstruct ice_vsi *vsi;\n+\tu32 up2tc;\n+\n+\tvsi = ice_get_main_vsi(pf);\n+\tif (!vsi)\n+\t\treturn false;\n+\n+\tice_for_each_traffic_class(i)\n+\t\tif (vsi->tc_cfg.ena_tc & BIT(i))\n+\t\t\tnum_tcs++;\n+\n+\t/* first find out the TC to which the hung queue belongs to */\n+\tfor (tc = 0; tc < num_tcs - 1; tc++)\n+\t\tif (ice_find_q_in_range(vsi->tc_cfg.tc_info[tc].qoffset,\n+\t\t\t\t\tvsi->tc_cfg.tc_info[tc + 1].qoffset,\n+\t\t\t\t\ttxqueue))\n+\t\t\tbreak;\n+\n+\t/* Build a bit map of all UPs associated to the suspect hung queue TC,\n+\t * so that we check for its counter increment.\n+\t */\n+\tup2tc = rd32(&pf->hw, PRTDCB_TUP2TC);\n+\tfor (i = 0; i < ICE_MAX_UP; i++) {\n+\t\tup_mapped_tc = (up2tc >> (i * 3)) & 0x7;\n+\t\tif (up_mapped_tc == tc)\n+\t\t\tup_in_tc |= BIT(i);\n+\t}\n+\n+\t/* Now that we figured out that hung queue is PFC enabled, still the\n+\t * Tx timeout can be legitimate. So to make sure Tx timeout is\n+\t * absolutely caused by PFC storm, check if the counters are\n+\t * incrementing.\n+\t */\n+\tfor (i = 0; i < ICE_MAX_UP; i++)\n+\t\tif (up_in_tc & BIT(i))\n+\t\t\tref_prio_xoff[i] = pf->stats.priority_xoff_rx[i];\n+\n+\tice_update_dcb_stats(pf);\n+\n+\tfor (i = 0; i < ICE_MAX_UP; i++)\n+\t\tif (up_in_tc & BIT(i))\n+\t\t\tif (pf->stats.priority_xoff_rx[i] > ref_prio_xoff[i])\n+\t\t\t\treturn true;\n+\n+\treturn false;\n+}\n+\n /**\n  * ice_dcb_get_mode - gets the DCB mode\n  * @port_info: pointer to port info structure\ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.h b/drivers/net/ethernet/intel/ice/ice_dcb_lib.h\nindex 11457b6ba145..a7a5d9833a93 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.h\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.h\n@@ -17,6 +17,8 @@\n void ice_dcb_rebuild(struct ice_pf *pf);\n u8 ice_dcb_get_ena_tc(struct ice_dcbx_cfg *dcbcfg);\n u8 ice_dcb_get_num_tc(struct ice_dcbx_cfg *dcbcfg);\n+void ice_vsi_set_dcb_tc_cfg(struct ice_vsi *vsi);\n+bool ice_is_pfc_causing_hung_q(struct ice_pf *pf, unsigned int txqueue);\n u8 ice_dcb_get_tc(struct ice_vsi *vsi, int queue_index);\n int\n ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked);\n@@ -34,6 +36,20 @@ void\n ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,\n \t\t\t\t    struct ice_rq_event_info *event);\n void ice_vsi_cfg_netdev_tc(struct ice_vsi *vsi, u8 ena_tc);\n+\n+/**\n+ * ice_find_q_in_range\n+ * @low: start of queue range for a TC i.e. offset of TC\n+ * @high: start of queue for next TC\n+ * @tx_q: hung_queue/tx_queue\n+ *\n+ * finds if queue 'tx_q' falls between the two offsets of any given TC\n+ */\n+static inline bool ice_find_q_in_range(u16 low, u16 high, unsigned int tx_q)\n+{\n+\treturn (tx_q >= low) && (tx_q < high);\n+}\n+\n static inline void\n ice_set_cgd_num(struct ice_tlan_ctx *tlan_ctx, struct ice_ring *ring)\n {\n@@ -81,6 +97,13 @@ ice_tx_prepare_vlan_flags_dcb(struct ice_ring __always_unused *tx_ring,\n \treturn 0;\n }\n \n+static inline bool\n+ice_is_pfc_causing_hung_q(struct ice_pf __always_unused *pf,\n+\t\t\t  unsigned int __always_unused txqueue)\n+{\n+\treturn false;\n+}\n+\n #define ice_update_dcb_stats(pf) do {} while (0)\n #define ice_pf_dcb_recfg(pf) do {} while (0)\n #define ice_vsi_cfg_dcb_rings(vsi) do {} while (0)\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 3d143e8c5112..2128238a0f6d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -5201,6 +5201,16 @@ static void ice_tx_timeout(struct net_device *netdev, unsigned int txqueue)\n \n \tpf->tx_timeout_count++;\n \n+\t/* Check if PFC is enabled for the TC to which the queue belongs\n+\t * to. If yes then Tx timeout is not caused by a hung queue, no\n+\t * need to reset and rebuild\n+\t */\n+\tif (ice_is_pfc_causing_hung_q(pf, txqueue)) {\n+\t\tdev_info(ice_pf_to_dev(pf), \"Fake Tx hang detected on queue %u, timeout caused by PFC storm\\n\",\n+\t\t\t txqueue);\n+\t\treturn;\n+\t}\n+\n \t/* now that we have an index, find the tx_ring struct */\n \tfor (i = 0; i < vsi->num_txq; i++)\n \t\tif (vsi->tx_rings[i] && vsi->tx_rings[i]->desc)\ndiff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h\nindex 40ac93d24e97..5abfd01113ed 100644\n--- a/drivers/net/ethernet/intel/ice/ice_type.h\n+++ b/drivers/net/ethernet/intel/ice/ice_type.h\n@@ -611,6 +611,8 @@ struct ice_eth_stats {\n \tu64 tx_errors;\t\t\t/* tepc */\n };\n \n+#define ICE_MAX_UP\t8\n+\n /* Statistics collected by the MAC */\n struct ice_hw_port_stats {\n \t/* eth stats collected by the port */\n",
    "prefixes": [
        "S41",
        "02/15"
    ]
}