get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1137029,
    "url": "http://patchwork.ozlabs.org/api/patches/1137029/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190725085541.55104-7-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": "<20190725085541.55104-7-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2019-07-25T08:55:33",
    "name": "[S23,v4,07/15] ice: Fix kernel hang with DCB reset in CEE mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "d7402fec941c50786a1e0d1407575f3637d06a49",
    "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/20190725085541.55104-7-anthony.l.nguyen@intel.com/mbox/",
    "series": [
        {
            "id": 121506,
            "url": "http://patchwork.ozlabs.org/api/series/121506/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=121506",
            "date": "2019-07-25T08:55:36",
            "name": "[S23,v4,01/15] ice: Implement ethtool ops for channels",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/121506/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1137029/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1137029/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\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 45vfG01QYxz9sMr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 26 Jul 2019 03:24:08 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id CA56288191;\n\tThu, 25 Jul 2019 17:24:06 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id TvEJHL9UlSAO; Thu, 25 Jul 2019 17:24:05 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id D7D008817D;\n\tThu, 25 Jul 2019 17:24:05 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 73CC71BF312\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 25 Jul 2019 17:24:01 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 6C682864BD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 25 Jul 2019 17:24:01 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 47c2zWi1YaJc for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 25 Jul 2019 17:23:59 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 00A94864D0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 25 Jul 2019 17:23:58 +0000 (UTC)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Jul 2019 10:23:56 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby orsmga007.jf.intel.com with ESMTP; 25 Jul 2019 10:23:56 -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-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.64,307,1559545200\"; d=\"scan'208\";a=\"160973708\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Thu, 25 Jul 2019 01:55:33 -0700",
        "Message-Id": "<20190725085541.55104-7-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190725085541.55104-1-anthony.l.nguyen@intel.com>",
        "References": "<20190725085541.55104-1-anthony.l.nguyen@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH S23 v4 07/15] ice: Fix kernel hang with\n\tDCB reset in CEE mode",
        "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\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<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\t<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: Usha Ketineni <usha.k.ketineni@intel.com>\n\nThis patch fixes the set local MIB AQ call failures in the DCB rebuild path\nby setting the defaults for the ETS recommended DCB configuration. Also,\nwilling bits for the DCB configuration needs to be set correctly. Resets\nworks fine in IEEE mode as the ETS recommended DCB configuration is\npopulated but not in CEE mode.\nWithout this patch, PFR causes the kernel hang in CEE mode.\n\nSigned-off-by: Usha Ketineni <usha.k.ketineni@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 149 +++++++++++--------\n 1 file changed, 88 insertions(+), 61 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\nindex f80628a13f2a..d285aba3fea7 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n@@ -208,16 +208,87 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)\n \treturn ret;\n }\n \n+/**\n+ * ice_cfg_etsrec_defaults - Set default ETS recommended DCB config\n+ * @pi: port information structure\n+ */\n+static void ice_cfg_etsrec_defaults(struct ice_port_info *pi)\n+{\n+\tstruct ice_dcbx_cfg *dcbcfg = &pi->local_dcbx_cfg;\n+\tu8 i;\n+\n+\t/* Ensure ETS recommended DCB configuration is not already set */\n+\tif (dcbcfg->etsrec.maxtcs)\n+\t\treturn;\n+\n+\t/* In CEE mode, set the default to 1 TC */\n+\tdcbcfg->etsrec.maxtcs = 1;\n+\tfor (i = 0; i < ICE_MAX_TRAFFIC_CLASS; i++) {\n+\t\tdcbcfg->etsrec.tcbwtable[i] = i ? 0 : 100;\n+\t\tdcbcfg->etsrec.tsatable[i] = i ? ICE_IEEE_TSA_STRICT :\n+\t\t\t\t\t\t ICE_IEEE_TSA_ETS;\n+\t}\n+}\n+\n+/**\n+ * ice_dcb_need_recfg - Check if DCB needs reconfig\n+ * @pf: board private structure\n+ * @old_cfg: current DCB config\n+ * @new_cfg: new DCB config\n+ */\n+static bool\n+ice_dcb_need_recfg(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg,\n+\t\t   struct ice_dcbx_cfg *new_cfg)\n+{\n+\tbool need_reconfig = false;\n+\n+\t/* Check if ETS configuration has changed */\n+\tif (memcmp(&new_cfg->etscfg, &old_cfg->etscfg,\n+\t\t   sizeof(new_cfg->etscfg))) {\n+\t\t/* If Priority Table has changed reconfig is needed */\n+\t\tif (memcmp(&new_cfg->etscfg.prio_table,\n+\t\t\t   &old_cfg->etscfg.prio_table,\n+\t\t\t   sizeof(new_cfg->etscfg.prio_table))) {\n+\t\t\tneed_reconfig = true;\n+\t\t\tdev_dbg(&pf->pdev->dev, \"ETS UP2TC changed.\\n\");\n+\t\t}\n+\n+\t\tif (memcmp(&new_cfg->etscfg.tcbwtable,\n+\t\t\t   &old_cfg->etscfg.tcbwtable,\n+\t\t\t   sizeof(new_cfg->etscfg.tcbwtable)))\n+\t\t\tdev_dbg(&pf->pdev->dev, \"ETS TC BW Table changed.\\n\");\n+\n+\t\tif (memcmp(&new_cfg->etscfg.tsatable,\n+\t\t\t   &old_cfg->etscfg.tsatable,\n+\t\t\t   sizeof(new_cfg->etscfg.tsatable)))\n+\t\t\tdev_dbg(&pf->pdev->dev, \"ETS TSA Table changed.\\n\");\n+\t}\n+\n+\t/* Check if PFC configuration has changed */\n+\tif (memcmp(&new_cfg->pfc, &old_cfg->pfc, sizeof(new_cfg->pfc))) {\n+\t\tneed_reconfig = true;\n+\t\tdev_dbg(&pf->pdev->dev, \"PFC config change detected.\\n\");\n+\t}\n+\n+\t/* Check if APP Table has changed */\n+\tif (memcmp(&new_cfg->app, &old_cfg->app, sizeof(new_cfg->app))) {\n+\t\tneed_reconfig = true;\n+\t\tdev_dbg(&pf->pdev->dev, \"APP Table change detected.\\n\");\n+\t}\n+\n+\tdev_dbg(&pf->pdev->dev, \"dcb need_reconfig=%d\\n\", need_reconfig);\n+\treturn need_reconfig;\n+}\n+\n /**\n  * ice_dcb_rebuild - rebuild DCB post reset\n  * @pf: physical function instance\n  */\n void ice_dcb_rebuild(struct ice_pf *pf)\n {\n+\tstruct ice_dcbx_cfg *local_dcbx_cfg, *desired_dcbx_cfg, *prev_cfg;\n \tstruct ice_aqc_port_ets_elem buf = { 0 };\n-\tstruct ice_dcbx_cfg *prev_cfg;\n \tenum ice_status ret;\n-\tu8 willing;\n \n \tret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);\n \tif (ret) {\n@@ -229,9 +300,15 @@ void ice_dcb_rebuild(struct ice_pf *pf)\n \tif (!test_bit(ICE_FLAG_DCB_ENA, pf->flags))\n \t\treturn;\n \n+\tlocal_dcbx_cfg = &pf->hw.port_info->local_dcbx_cfg;\n+\tdesired_dcbx_cfg = &pf->hw.port_info->desired_dcbx_cfg;\n+\n \t/* Save current willing state and force FW to unwilling */\n-\twilling = pf->hw.port_info->local_dcbx_cfg.etscfg.willing;\n-\tpf->hw.port_info->local_dcbx_cfg.etscfg.willing = 0x0;\n+\tlocal_dcbx_cfg->etscfg.willing = 0x0;\n+\tlocal_dcbx_cfg->pfc.willing = 0x0;\n+\tlocal_dcbx_cfg->app_mode = ICE_DCBX_APPS_NON_WILLING;\n+\n+\tice_cfg_etsrec_defaults(pf->hw.port_info);\n \tret = ice_set_dcb_cfg(pf->hw.port_info);\n \tif (ret) {\n \t\tdev_err(&pf->pdev->dev, \"Failed to set DCB to unwilling\\n\");\n@@ -239,8 +316,7 @@ void ice_dcb_rebuild(struct ice_pf *pf)\n \t}\n \n \t/* Retrieve DCB config and ensure same as current in SW */\n-\tprev_cfg = devm_kmemdup(&pf->pdev->dev,\n-\t\t\t\t&pf->hw.port_info->local_dcbx_cfg,\n+\tprev_cfg = devm_kmemdup(&pf->pdev->dev, local_dcbx_cfg,\n \t\t\t\tsizeof(*prev_cfg), GFP_KERNEL);\n \tif (!prev_cfg) {\n \t\tdev_err(&pf->pdev->dev, \"Failed to alloc space for DCB cfg\\n\");\n@@ -248,22 +324,22 @@ void ice_dcb_rebuild(struct ice_pf *pf)\n \t}\n \n \tice_init_dcb(&pf->hw);\n-\tif (memcmp(prev_cfg, &pf->hw.port_info->local_dcbx_cfg,\n-\t\t   sizeof(*prev_cfg))) {\n+\tif (ice_dcb_need_recfg(pf, prev_cfg, local_dcbx_cfg)) {\n \t\t/* difference in cfg detected - disable DCB till next MIB */\n \t\tdev_err(&pf->pdev->dev, \"Set local MIB not accurate\\n\");\n-\t\tdevm_kfree(&pf->pdev->dev, prev_cfg);\n \t\tgoto dcb_error;\n \t}\n \n \t/* fetched config congruent to previous configuration */\n \tdevm_kfree(&pf->pdev->dev, prev_cfg);\n \n-\t/* Configuration replayed - reset willing state to previous */\n-\tpf->hw.port_info->local_dcbx_cfg.etscfg.willing = willing;\n+\t/* Set the local desired config */\n+\tmemset(&pf->hw.port_info->local_dcbx_cfg, 0, sizeof(*local_dcbx_cfg));\n+\tmemcpy(local_dcbx_cfg, desired_dcbx_cfg, sizeof(*local_dcbx_cfg));\n+\tice_cfg_etsrec_defaults(pf->hw.port_info);\n \tret = ice_set_dcb_cfg(pf->hw.port_info);\n \tif (ret) {\n-\t\tdev_err(&pf->pdev->dev, \"Fail restoring prev willing state\\n\");\n+\t\tdev_err(&pf->pdev->dev, \"Failed to set desired config\\n\");\n \t\tgoto dcb_error;\n \t}\n \tdev_info(&pf->pdev->dev, \"DCB restored after reset\\n\");\n@@ -506,55 +582,6 @@ ice_tx_prepare_vlan_flags_dcb(struct ice_ring *tx_ring,\n \treturn 0;\n }\n \n-/**\n- * ice_dcb_need_recfg - Check if DCB needs reconfig\n- * @pf: board private structure\n- * @old_cfg: current DCB config\n- * @new_cfg: new DCB config\n- */\n-static bool ice_dcb_need_recfg(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg,\n-\t\t\t       struct ice_dcbx_cfg *new_cfg)\n-{\n-\tbool need_reconfig = false;\n-\n-\t/* Check if ETS configuration has changed */\n-\tif (memcmp(&new_cfg->etscfg, &old_cfg->etscfg,\n-\t\t   sizeof(new_cfg->etscfg))) {\n-\t\t/* If Priority Table has changed reconfig is needed */\n-\t\tif (memcmp(&new_cfg->etscfg.prio_table,\n-\t\t\t   &old_cfg->etscfg.prio_table,\n-\t\t\t   sizeof(new_cfg->etscfg.prio_table))) {\n-\t\t\tneed_reconfig = true;\n-\t\t\tdev_dbg(&pf->pdev->dev, \"ETS UP2TC changed.\\n\");\n-\t\t}\n-\n-\t\tif (memcmp(&new_cfg->etscfg.tcbwtable,\n-\t\t\t   &old_cfg->etscfg.tcbwtable,\n-\t\t\t   sizeof(new_cfg->etscfg.tcbwtable)))\n-\t\t\tdev_dbg(&pf->pdev->dev, \"ETS TC BW Table changed.\\n\");\n-\n-\t\tif (memcmp(&new_cfg->etscfg.tsatable,\n-\t\t\t   &old_cfg->etscfg.tsatable,\n-\t\t\t   sizeof(new_cfg->etscfg.tsatable)))\n-\t\t\tdev_dbg(&pf->pdev->dev, \"ETS TSA Table changed.\\n\");\n-\t}\n-\n-\t/* Check if PFC configuration has changed */\n-\tif (memcmp(&new_cfg->pfc, &old_cfg->pfc, sizeof(new_cfg->pfc))) {\n-\t\tneed_reconfig = true;\n-\t\tdev_dbg(&pf->pdev->dev, \"PFC config change detected.\\n\");\n-\t}\n-\n-\t/* Check if APP Table has changed */\n-\tif (memcmp(&new_cfg->app, &old_cfg->app, sizeof(new_cfg->app))) {\n-\t\tneed_reconfig = true;\n-\t\tdev_dbg(&pf->pdev->dev, \"APP Table change detected.\\n\");\n-\t}\n-\n-\tdev_dbg(&pf->pdev->dev, \"dcb need_reconfig=%d\\n\", need_reconfig);\n-\treturn need_reconfig;\n-}\n-\n /**\n  * ice_dcb_process_lldp_set_mib_change - Process MIB change\n  * @pf: ptr to ice_pf\n",
    "prefixes": [
        "S23",
        "v4",
        "07/15"
    ]
}