get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1086468,
    "url": "http://patchwork.ozlabs.org/api/patches/1086468/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190416172439.27908-2-anirudh.venkataramanan@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": "<20190416172439.27908-2-anirudh.venkataramanan@intel.com>",
    "list_archive_url": null,
    "date": "2019-04-16T17:24:25",
    "name": "[S19,01/15] ice: Implement LLDP persistence",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9d078dadf1ba61f87ce48ea58233cc6542126557",
    "submitter": {
        "id": 73601,
        "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api",
        "name": "Anirudh Venkataramanan",
        "email": "anirudh.venkataramanan@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/20190416172439.27908-2-anirudh.venkataramanan@intel.com/mbox/",
    "series": [
        {
            "id": 103107,
            "url": "http://patchwork.ozlabs.org/api/series/103107/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=103107",
            "date": "2019-04-16T17:24:38",
            "name": "Fixes and feature updates for ice",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/103107/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1086468/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1086468/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.138; helo=whitealder.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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 44kC1h2p7Yz9s55\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 17 Apr 2019 03:25:28 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 01BD687074;\n\tTue, 16 Apr 2019 17:25:27 +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 MJgOdWZ4cbmV; Tue, 16 Apr 2019 17:25:19 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 52AAA870B4;\n\tTue, 16 Apr 2019 17:25:17 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id D2E5E1BF9A0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:25:14 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id CFA638796C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:25:14 +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 0ncPWDl93rJ0 for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:25:14 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 054EB8739E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:25:13 +0000 (UTC)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Apr 2019 10:25:11 -0700",
            "from shasta.jf.intel.com ([10.166.244.191])\n\tby orsmga001.jf.intel.com with ESMTP; 16 Apr 2019 10:25: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-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.60,358,1549958400\"; d=\"scan'208\";a=\"224064164\"",
        "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Tue, 16 Apr 2019 10:24:25 -0700",
        "Message-Id": "<20190416172439.27908-2-anirudh.venkataramanan@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190416172439.27908-1-anirudh.venkataramanan@intel.com>",
        "References": "<20190416172439.27908-1-anirudh.venkataramanan@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH S19 01/15] ice: Implement LLDP persistence",
        "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": "Implement LLDP persistence across reboots, start and stop of LLDP agent.\nAdd additional parameter to ice_aq_start_lldp and ice_aq_stop_lldp.\n\nAlso change the ethtool private flag from \"disable-fw-lldp\" to\n\"enable-fw-lldp\". This change will flip the boolean logic of the\nfunctionality of the flag (on = enable, off = disable). The change\nin name and functionality is to differentiate between the\npre-persistence and post-persistence states.\n\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n[Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> squashed multiple commits]\n---\n drivers/net/ethernet/intel/ice/ice.h         |  2 +-\n drivers/net/ethernet/intel/ice/ice_dcb.c     | 16 +++++++++--\n drivers/net/ethernet/intel/ice/ice_dcb.h     |  8 ++++--\n drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 30 ++++----------------\n drivers/net/ethernet/intel/ice/ice_ethtool.c | 10 +++----\n 5 files changed, 29 insertions(+), 37 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h\nindex 792e6e42030e..7958f2bac8da 100644\n--- a/drivers/net/ethernet/intel/ice/ice.h\n+++ b/drivers/net/ethernet/intel/ice/ice.h\n@@ -330,7 +330,7 @@ enum ice_pf_flags {\n \tICE_FLAG_DCB_CAPABLE,\n \tICE_FLAG_DCB_ENA,\n \tICE_FLAG_LINK_DOWN_ON_CLOSE_ENA,\n-\tICE_FLAG_DISABLE_FW_LLDP,\n+\tICE_FLAG_ENABLE_FW_LLDP,\n \tICE_FLAG_ETHTOOL_CTXT,\t\t/* set when ethtool holds RTNL lock */\n \tICE_PF_FLAGS_NBITS\t\t/* must be last */\n };\ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb.c b/drivers/net/ethernet/intel/ice/ice_dcb.c\nindex 70e0a5739c1d..da35f1323c86 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb.c\n@@ -82,12 +82,14 @@ ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update,\n  * @hw: pointer to the HW struct\n  * @shutdown_lldp_agent: True if LLDP Agent needs to be Shutdown\n  *\t\t\t False if LLDP Agent needs to be Stopped\n+ * @persist: True if Stop/Shutdown of LLDP Agent needs to be persistent across\n+ *\t     reboots\n  * @cd: pointer to command details structure or NULL\n  *\n  * Stop or Shutdown the embedded LLDP Agent (0x0A05)\n  */\n enum ice_status\n-ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent,\n+ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent, bool persist,\n \t\t struct ice_sq_cd *cd)\n {\n \tstruct ice_aqc_lldp_stop *cmd;\n@@ -100,17 +102,22 @@ ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent,\n \tif (shutdown_lldp_agent)\n \t\tcmd->command |= ICE_AQ_LLDP_AGENT_SHUTDOWN;\n \n+\tif (persist)\n+\t\tcmd->command |= ICE_AQ_LLDP_AGENT_PERSIST_DIS;\n+\n \treturn ice_aq_send_cmd(hw, &desc, NULL, 0, cd);\n }\n \n /**\n  * ice_aq_start_lldp\n  * @hw: pointer to the HW struct\n+ * @persist: True if Start of LLDP Agent needs to be persistent across reboots\n  * @cd: pointer to command details structure or NULL\n  *\n  * Start the embedded LLDP Agent on all ports. (0x0A06)\n  */\n-enum ice_status ice_aq_start_lldp(struct ice_hw *hw, struct ice_sq_cd *cd)\n+enum ice_status\n+ice_aq_start_lldp(struct ice_hw *hw, bool persist, struct ice_sq_cd *cd)\n {\n \tstruct ice_aqc_lldp_start *cmd;\n \tstruct ice_aq_desc desc;\n@@ -121,6 +128,9 @@ enum ice_status ice_aq_start_lldp(struct ice_hw *hw, struct ice_sq_cd *cd)\n \n \tcmd->command = ICE_AQ_LLDP_AGENT_START;\n \n+\tif (persist)\n+\t\tcmd->command |= ICE_AQ_LLDP_AGENT_PERSIST_ENA;\n+\n \treturn ice_aq_send_cmd(hw, &desc, NULL, 0, cd);\n }\n \n@@ -163,7 +173,7 @@ ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,\n  *\n  * Get the DCBX status from the Firmware\n  */\n-u8 ice_get_dcbx_status(struct ice_hw *hw)\n+static u8 ice_get_dcbx_status(struct ice_hw *hw)\n {\n \tu32 reg;\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb.h b/drivers/net/ethernet/intel/ice/ice_dcb.h\nindex 41360e3dc07e..0bf0cf54783f 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb.h\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb.h\n@@ -120,7 +120,6 @@ struct ice_cee_app_prio {\n \tu8 prio_map;\n } __packed;\n \n-u8 ice_get_dcbx_status(struct ice_hw *hw);\n enum ice_status ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg);\n enum ice_status ice_get_dcb_cfg(struct ice_port_info *pi);\n enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi);\n@@ -131,9 +130,10 @@ ice_query_port_ets(struct ice_port_info *pi,\n \t\t   struct ice_sq_cd *cmd_details);\n #ifdef CONFIG_DCB\n enum ice_status\n-ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent,\n+ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent, bool persist,\n \t\t struct ice_sq_cd *cd);\n-enum ice_status ice_aq_start_lldp(struct ice_hw *hw, struct ice_sq_cd *cd);\n+enum ice_status\n+ice_aq_start_lldp(struct ice_hw *hw, bool persist, struct ice_sq_cd *cd);\n enum ice_status\n ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent,\n \t\t       bool *dcbx_agent_status, struct ice_sq_cd *cd);\n@@ -144,6 +144,7 @@ ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update,\n static inline enum ice_status\n ice_aq_stop_lldp(struct ice_hw __always_unused *hw,\n \t\t bool __always_unused shutdown_lldp_agent,\n+\t\t bool __always_unused persist,\n \t\t struct ice_sq_cd __always_unused *cd)\n {\n \treturn 0;\n@@ -151,6 +152,7 @@ ice_aq_stop_lldp(struct ice_hw __always_unused *hw,\n \n static inline enum ice_status\n ice_aq_start_lldp(struct ice_hw __always_unused *hw,\n+\t\t  bool __always_unused persist,\n \t\t  struct ice_sq_cd __always_unused *cd)\n {\n \treturn 0;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\nindex 32546aef2500..53c3a6056572 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n@@ -360,33 +360,10 @@ int ice_init_pf_dcb(struct ice_pf *pf)\n \n \tport_info = hw->port_info;\n \n-\t/* check if device is DCB capable */\n-\tif (!hw->func_caps.common_cap.dcb) {\n-\t\tdev_dbg(dev, \"DCB not supported\\n\");\n-\t\treturn -EOPNOTSUPP;\n-\t}\n-\n-\t/* Best effort to put DCBx and LLDP into a good state */\n-\tport_info->dcbx_status = ice_get_dcbx_status(hw);\n-\tif (port_info->dcbx_status != ICE_DCBX_STATUS_DONE &&\n-\t    port_info->dcbx_status != ICE_DCBX_STATUS_IN_PROGRESS) {\n-\t\tbool dcbx_status;\n-\n-\t\t/* Attempt to start LLDP engine. Ignore errors\n-\t\t * as this will error if it is already started\n-\t\t */\n-\t\tice_aq_start_lldp(hw, NULL);\n-\n-\t\t/* Attempt to start DCBX. Ignore errors as this\n-\t\t * will error if it is already started\n-\t\t */\n-\t\tice_aq_start_stop_dcbx(hw, true, &dcbx_status, NULL);\n-\t}\n-\n \terr = ice_init_dcb(hw);\n \tif (err) {\n-\t\t/* FW LLDP not in usable state, default to SW DCBx/LLDP */\n-\t\tdev_info(&pf->pdev->dev, \"FW LLDP not in usable state\\n\");\n+\t\t/* FW LLDP is not active, default to SW DCBx/LLDP */\n+\t\tdev_info(&pf->pdev->dev, \"FW LLDP is not active\\n\");\n \t\thw->port_info->dcbx_status = ICE_DCBX_STATUS_NOT_STARTED;\n \t\thw->port_info->is_sw_lldp = true;\n \t}\n@@ -398,6 +375,9 @@ int ice_init_pf_dcb(struct ice_pf *pf)\n \tif (port_info->is_sw_lldp) {\n \t\tsw_default = 1;\n \t\tdev_info(&pf->pdev->dev, \"DCBx/LLDP in SW mode.\\n\");\n+\t\tclear_bit(ICE_FLAG_ENABLE_FW_LLDP, pf->flags);\n+\t} else {\n+\t\tset_bit(ICE_FLAG_ENABLE_FW_LLDP, pf->flags);\n \t}\n \n \tif (port_info->dcbx_status == ICE_DCBX_STATUS_NOT_STARTED) {\ndiff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c\nindex 1341fde8d53f..76122a28da7e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c\n@@ -134,7 +134,7 @@ struct ice_priv_flag {\n \n static const struct ice_priv_flag ice_gstrings_priv_flags[] = {\n \tICE_PRIV_FLAG(\"link-down-on-close\", ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA),\n-\tICE_PRIV_FLAG(\"disable-fw-lldp\", ICE_FLAG_DISABLE_FW_LLDP),\n+\tICE_PRIV_FLAG(\"enable-fw-lldp\", ICE_FLAG_ENABLE_FW_LLDP),\n };\n \n #define ICE_PRIV_FLAG_ARRAY_SIZE\tARRAY_SIZE(ice_gstrings_priv_flags)\n@@ -433,8 +433,8 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \n \tbitmap_xor(change_flags, pf->flags, orig_flags, ICE_PF_FLAGS_NBITS);\n \n-\tif (test_bit(ICE_FLAG_DISABLE_FW_LLDP, change_flags)) {\n-\t\tif (test_bit(ICE_FLAG_DISABLE_FW_LLDP, pf->flags)) {\n+\tif (test_bit(ICE_FLAG_ENABLE_FW_LLDP, change_flags)) {\n+\t\tif (!test_bit(ICE_FLAG_ENABLE_FW_LLDP, pf->flags)) {\n \t\t\tenum ice_status status;\n \n \t\t\tstatus = ice_aq_cfg_lldp_mib_change(&pf->hw, false,\n@@ -450,7 +450,7 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\t\t/* The AQ call to stop the FW LLDP agent will generate\n \t\t\t * an error if the agent is already stopped.\n \t\t\t */\n-\t\t\tstatus = ice_aq_stop_lldp(&pf->hw, true, NULL);\n+\t\t\tstatus = ice_aq_stop_lldp(&pf->hw, true, true, NULL);\n \t\t\tif (status)\n \t\t\t\tdev_warn(&pf->pdev->dev,\n \t\t\t\t\t \"Fail to stop LLDP agent\\n\");\n@@ -468,7 +468,7 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\t\t/* AQ command to start FW LLDP agent will return an\n \t\t\t * error if the agent is already started\n \t\t\t */\n-\t\t\tstatus = ice_aq_start_lldp(&pf->hw, NULL);\n+\t\t\tstatus = ice_aq_start_lldp(&pf->hw, true, NULL);\n \t\t\tif (status)\n \t\t\t\tdev_warn(&pf->pdev->dev,\n \t\t\t\t\t \"Fail to start LLDP Agent\\n\");\n",
    "prefixes": [
        "S19",
        "01/15"
    ]
}