get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64470,
    "url": "http://patches.dpdk.org/api/patches/64470/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200113023949.26718-7-xiaolong.ye@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": "<20200113023949.26718-7-xiaolong.ye@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200113023949.26718-7-xiaolong.ye@intel.com",
    "date": "2020-01-13T02:39:18",
    "name": "[v4,06/36] net/i40e/base: further implementation of LLDP",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "88cebb9a77687d56c4d8317204c23bf31f92318c",
    "submitter": {
        "id": 1120,
        "url": "http://patches.dpdk.org/api/people/1120/?format=api",
        "name": "Xiaolong Ye",
        "email": "xiaolong.ye@intel.com"
    },
    "delegate": {
        "id": 31221,
        "url": "http://patches.dpdk.org/api/users/31221/?format=api",
        "username": "yexl",
        "first_name": "xiaolong",
        "last_name": "ye",
        "email": "xiaolong.ye@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200113023949.26718-7-xiaolong.ye@intel.com/mbox/",
    "series": [
        {
            "id": 8064,
            "url": "http://patches.dpdk.org/api/series/8064/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8064",
            "date": "2020-01-13T02:39:12",
            "name": "update for i40e base code",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/8064/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64470/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/64470/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E5F5BA04F0;\n\tMon, 13 Jan 2020 03:48:00 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C643D1D5A5;\n\tMon, 13 Jan 2020 03:47:17 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by dpdk.org (Postfix) with ESMTP id C71AF1D58D\n for <dev@dpdk.org>; Mon, 13 Jan 2020 03:47:09 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 12 Jan 2020 18:47:09 -0800",
            "from dpdk_yexl_af_xdp.sh.intel.com ([10.67.119.206])\n by FMSMGA003.fm.intel.com with ESMTP; 12 Jan 2020 18:47:08 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.69,427,1571727600\"; d=\"scan'208\";a=\"272916320\"",
        "From": "Xiaolong Ye <xiaolong.ye@intel.com>",
        "To": "Beilei Xing <beilei.xing@intel.com>,\n\tQi Zhang <qi.z.zhang@intel.com>",
        "Cc": "dev@dpdk.org, Xiaolong Ye <xiaolong.ye@intel.com>,\n Jaroslaw Ilgiewicz <jaroslaw.ilgiewicz@intel.com>",
        "Date": "Mon, 13 Jan 2020 10:39:18 +0800",
        "Message-Id": "<20200113023949.26718-7-xiaolong.ye@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200113023949.26718-1-xiaolong.ye@intel.com>",
        "References": "<20191202074935.97629-1-xiaolong.ye@intel.com>\n <20200113023949.26718-1-xiaolong.ye@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 06/36] net/i40e/base: further implementation\n\tof LLDP",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This code implements changes necessary for LLDP Agent support.\n\n1. Modified i40e_aq_start_lldp and i40e_aq_stop_lldp. Now Stop and Start\ncan also be persistent across power cycles.\n2. Added new function i40e_aq_restore_lldp which restores factory\nsetting for LLDP Agent or gets its status.\n\nSigned-off-by: Jaroslaw Ilgiewicz <jaroslaw.ilgiewicz@intel.com>\nSigned-off-by: Xiaolong Ye <xiaolong.ye@intel.com>\n---\n drivers/net/i40e/base/i40e_adminq_cmd.h |  19 ++-\n drivers/net/i40e/base/i40e_common.c     | 173 ++++++------------------\n drivers/net/i40e/base/i40e_prototype.h  |  18 +--\n drivers/net/i40e/base/i40e_type.h       |   1 +\n drivers/net/i40e/i40e_ethdev.c          |   4 +-\n drivers/net/i40e/rte_pmd_i40e.c         |   4 +-\n 6 files changed, 67 insertions(+), 152 deletions(-)",
    "diff": "diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h\nindex b459be921..a89b88fa5 100644\n--- a/drivers/net/i40e/base/i40e_adminq_cmd.h\n+++ b/drivers/net/i40e/base/i40e_adminq_cmd.h\n@@ -265,6 +265,7 @@ enum i40e_admin_queue_opc {\n \ti40e_aqc_opc_get_cee_dcb_cfg\t= 0x0A07,\n \ti40e_aqc_opc_lldp_set_local_mib\t= 0x0A08,\n \ti40e_aqc_opc_lldp_stop_start_spec_agent\t= 0x0A09,\n+\ti40e_aqc_opc_lldp_restore\t\t= 0x0A0A,\n \n \t/* Tunnel commands */\n \ti40e_aqc_opc_add_udp_tunnel\t= 0x0B00,\n@@ -2554,8 +2555,9 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_tlv);\n /* Stop LLDP (direct 0x0A05) */\n struct i40e_aqc_lldp_stop {\n \tu8\tcommand;\n-#define I40E_AQ_LLDP_AGENT_STOP\t\t0x0\n-#define I40E_AQ_LLDP_AGENT_SHUTDOWN\t0x1\n+#define I40E_AQ_LLDP_AGENT_STOP\t\t\t0x0\n+#define I40E_AQ_LLDP_AGENT_SHUTDOWN\t\t0x1\n+#define I40E_AQ_LLDP_AGENT_STOP_PERSIST\t\t0x2\n \tu8\treserved[15];\n };\n \n@@ -2565,7 +2567,8 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop);\n \n struct i40e_aqc_lldp_start {\n \tu8\tcommand;\n-#define I40E_AQ_LLDP_AGENT_START\t0x1\n+#define I40E_AQ_LLDP_AGENT_START\t\t0x1\n+#define I40E_AQ_LLDP_AGENT_START_PERSIST\t0x2\n \tu8\treserved[15];\n };\n \n@@ -2685,6 +2688,16 @@ struct i40e_aqc_lldp_stop_start_specific_agent {\n \n I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop_start_specific_agent);\n \n+/* Restore LLDP Agent factory settings (direct 0x0A0A) */\n+struct i40e_aqc_lldp_restore {\n+\tu8\tcommand;\n+#define I40E_AQ_LLDP_AGENT_RESTORE_NOT\t\t0x0\n+#define I40E_AQ_LLDP_AGENT_RESTORE\t\t0x1\n+\tu8\treserved[15];\n+};\n+\n+I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_restore);\n+\n /* Add Udp Tunnel command and completion (direct 0x0B00) */\n struct i40e_aqc_add_udp_tunnel {\n \t__le16\tudp_port;\ndiff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c\nindex 0b26f86c5..8ebf8b856 100644\n--- a/drivers/net/i40e/base/i40e_common.c\n+++ b/drivers/net/i40e/base/i40e_common.c\n@@ -4347,151 +4347,39 @@ enum i40e_status_code i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw,\n }\n \n /**\n- * i40e_aq_add_lldp_tlv\n+ * i40e_aq_restore_lldp\n  * @hw: pointer to the hw struct\n- * @bridge_type: type of bridge\n- * @buff: buffer with TLV to add\n- * @buff_size: length of the buffer\n- * @tlv_len: length of the TLV to be added\n- * @mib_len: length of the LLDP MIB returned in response\n+ * @setting: pointer to factory setting variable or NULL\n+ * @restore: True if factory settings should be restored\n  * @cmd_details: pointer to command details structure or NULL\n  *\n- * Add the specified TLV to LLDP Local MIB for the given bridge type,\n- * it is responsibility of the caller to make sure that the TLV is not\n- * already present in the LLDPDU.\n- * In return firmware will write the complete LLDP MIB with the newly\n- * added TLV in the response buffer.\n+ * Restore LLDP Agent factory settings if @restore set to True. In other case\n+ * only returns factory setting in AQ response.\n  **/\n-enum i40e_status_code i40e_aq_add_lldp_tlv(struct i40e_hw *hw, u8 bridge_type,\n-\t\t\t\tvoid *buff, u16 buff_size, u16 tlv_len,\n-\t\t\t\tu16 *mib_len,\n-\t\t\t\tstruct i40e_asq_cmd_details *cmd_details)\n-{\n-\tstruct i40e_aq_desc desc;\n-\tstruct i40e_aqc_lldp_add_tlv *cmd =\n-\t\t(struct i40e_aqc_lldp_add_tlv *)&desc.params.raw;\n-\tenum i40e_status_code status;\n-\n-\tif (buff_size == 0 || !buff || tlv_len == 0)\n-\t\treturn I40E_ERR_PARAM;\n-\n-\ti40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_add_tlv);\n-\n-\t/* Indirect Command */\n-\tdesc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD));\n-\tif (buff_size > I40E_AQ_LARGE_BUF)\n-\t\tdesc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB);\n-\tdesc.datalen = CPU_TO_LE16(buff_size);\n-\n-\tcmd->type = ((bridge_type << I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT) &\n-\t\t      I40E_AQ_LLDP_BRIDGE_TYPE_MASK);\n-\tcmd->len = CPU_TO_LE16(tlv_len);\n-\n-\tstatus = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details);\n-\tif (!status) {\n-\t\tif (mib_len != NULL)\n-\t\t\t*mib_len = LE16_TO_CPU(desc.datalen);\n-\t}\n-\n-\treturn status;\n-}\n-\n-/**\n- * i40e_aq_update_lldp_tlv\n- * @hw: pointer to the hw struct\n- * @bridge_type: type of bridge\n- * @buff: buffer with TLV to update\n- * @buff_size: size of the buffer holding original and updated TLVs\n- * @old_len: Length of the Original TLV\n- * @new_len: Length of the Updated TLV\n- * @offset: offset of the updated TLV in the buff\n- * @mib_len: length of the returned LLDP MIB\n- * @cmd_details: pointer to command details structure or NULL\n- *\n- * Update the specified TLV to the LLDP Local MIB for the given bridge type.\n- * Firmware will place the complete LLDP MIB in response buffer with the\n- * updated TLV.\n- **/\n-enum i40e_status_code i40e_aq_update_lldp_tlv(struct i40e_hw *hw,\n-\t\t\t\tu8 bridge_type, void *buff, u16 buff_size,\n-\t\t\t\tu16 old_len, u16 new_len, u16 offset,\n-\t\t\t\tu16 *mib_len,\n-\t\t\t\tstruct i40e_asq_cmd_details *cmd_details)\n+enum i40e_status_code\n+i40e_aq_restore_lldp(struct i40e_hw *hw, u8 *setting, bool restore,\n+\t\t     struct i40e_asq_cmd_details *cmd_details)\n {\n \tstruct i40e_aq_desc desc;\n-\tstruct i40e_aqc_lldp_update_tlv *cmd =\n-\t\t(struct i40e_aqc_lldp_update_tlv *)&desc.params.raw;\n+\tstruct i40e_aqc_lldp_restore *cmd =\n+\t\t(struct i40e_aqc_lldp_restore *)&desc.params.raw;\n \tenum i40e_status_code status;\n \n-\tif (buff_size == 0 || !buff || offset == 0 ||\n-\t    old_len == 0 || new_len == 0)\n-\t\treturn I40E_ERR_PARAM;\n-\n-\ti40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_update_tlv);\n-\n-\t/* Indirect Command */\n-\tdesc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD));\n-\tif (buff_size > I40E_AQ_LARGE_BUF)\n-\t\tdesc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB);\n-\tdesc.datalen = CPU_TO_LE16(buff_size);\n-\n-\tcmd->type = ((bridge_type << I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT) &\n-\t\t      I40E_AQ_LLDP_BRIDGE_TYPE_MASK);\n-\tcmd->old_len = CPU_TO_LE16(old_len);\n-\tcmd->new_offset = CPU_TO_LE16(offset);\n-\tcmd->new_len = CPU_TO_LE16(new_len);\n-\n-\tstatus = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details);\n-\tif (!status) {\n-\t\tif (mib_len != NULL)\n-\t\t\t*mib_len = LE16_TO_CPU(desc.datalen);\n+\tif (!(hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT)) {\n+\t\ti40e_debug(hw, I40E_DEBUG_ALL,\n+\t\t\t   \"Restore LLDP not supported by current FW version.\\n\");\n+\t\treturn I40E_ERR_DEVICE_NOT_SUPPORTED;\n \t}\n \n-\treturn status;\n-}\n-\n-/**\n- * i40e_aq_delete_lldp_tlv\n- * @hw: pointer to the hw struct\n- * @bridge_type: type of bridge\n- * @buff: pointer to a user supplied buffer that has the TLV\n- * @buff_size: length of the buffer\n- * @tlv_len: length of the TLV to be deleted\n- * @mib_len: length of the returned LLDP MIB\n- * @cmd_details: pointer to command details structure or NULL\n- *\n- * Delete the specified TLV from LLDP Local MIB for the given bridge type.\n- * The firmware places the entire LLDP MIB in the response buffer.\n- **/\n-enum i40e_status_code i40e_aq_delete_lldp_tlv(struct i40e_hw *hw,\n-\t\t\t\tu8 bridge_type, void *buff, u16 buff_size,\n-\t\t\t\tu16 tlv_len, u16 *mib_len,\n-\t\t\t\tstruct i40e_asq_cmd_details *cmd_details)\n-{\n-\tstruct i40e_aq_desc desc;\n-\tstruct i40e_aqc_lldp_add_tlv *cmd =\n-\t\t(struct i40e_aqc_lldp_add_tlv *)&desc.params.raw;\n-\tenum i40e_status_code status;\n-\n-\tif (buff_size == 0 || !buff)\n-\t\treturn I40E_ERR_PARAM;\n+\ti40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_restore);\n \n-\ti40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_delete_tlv);\n+\tif (restore)\n+\t\tcmd->command |= I40E_AQ_LLDP_AGENT_RESTORE;\n \n-\t/* Indirect Command */\n-\tdesc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD));\n-\tif (buff_size > I40E_AQ_LARGE_BUF)\n-\t\tdesc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB);\n-\tdesc.datalen = CPU_TO_LE16(buff_size);\n-\tcmd->len = CPU_TO_LE16(tlv_len);\n-\tcmd->type = ((bridge_type << I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT) &\n-\t\t      I40E_AQ_LLDP_BRIDGE_TYPE_MASK);\n+\tstatus = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);\n \n-\tstatus = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details);\n-\tif (!status) {\n-\t\tif (mib_len != NULL)\n-\t\t\t*mib_len = LE16_TO_CPU(desc.datalen);\n-\t}\n+\tif (setting)\n+\t\t*setting = cmd->command & 1;\n \n \treturn status;\n }\n@@ -4500,11 +4388,13 @@ enum i40e_status_code i40e_aq_delete_lldp_tlv(struct i40e_hw *hw,\n  * i40e_aq_stop_lldp\n  * @hw: pointer to the hw struct\n  * @shutdown_agent: True if LLDP Agent needs to be Shutdown\n+ * @persist: True if stop of LLDP should be persistent across power cycles\n  * @cmd_details: pointer to command details structure or NULL\n  *\n  * Stop or Shutdown the embedded LLDP Agent\n  **/\n enum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent,\n+\t\t\t\tbool persist,\n \t\t\t\tstruct i40e_asq_cmd_details *cmd_details)\n {\n \tstruct i40e_aq_desc desc;\n@@ -4517,6 +4407,14 @@ enum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent,\n \tif (shutdown_agent)\n \t\tcmd->command |= I40E_AQ_LLDP_AGENT_SHUTDOWN;\n \n+\tif (persist) {\n+\t\tif (hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT)\n+\t\t\tcmd->command |= I40E_AQ_LLDP_AGENT_STOP_PERSIST;\n+\t\telse\n+\t\t\ti40e_debug(hw, I40E_DEBUG_ALL,\n+\t\t\t\t   \"Persistent Stop LLDP not supported by current FW version.\\n\");\n+\t}\n+\n \tstatus = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);\n \n \treturn status;\n@@ -4525,11 +4423,13 @@ enum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent,\n /**\n  * i40e_aq_start_lldp\n  * @hw: pointer to the hw struct\n+ * @persist: True if start of LLDP should be persistent across power cycles\n  * @cmd_details: pointer to command details structure or NULL\n  *\n  * Start the embedded LLDP Agent on all ports.\n  **/\n enum i40e_status_code i40e_aq_start_lldp(struct i40e_hw *hw,\n+\t\t\t\tbool persist,\n \t\t\t\tstruct i40e_asq_cmd_details *cmd_details)\n {\n \tstruct i40e_aq_desc desc;\n@@ -4540,6 +4440,15 @@ enum i40e_status_code i40e_aq_start_lldp(struct i40e_hw *hw,\n \ti40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_start);\n \n \tcmd->command = I40E_AQ_LLDP_AGENT_START;\n+\n+\tif (persist) {\n+\t\tif (hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT)\n+\t\t\tcmd->command |= I40E_AQ_LLDP_AGENT_START_PERSIST;\n+\t\telse\n+\t\t\ti40e_debug(hw, I40E_DEBUG_ALL,\n+\t\t\t\t   \"Persistent Start LLDP not supported by current FW version.\\n\");\n+\t}\n+\n \tstatus = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);\n \n \treturn status;\ndiff --git a/drivers/net/i40e/base/i40e_prototype.h b/drivers/net/i40e/base/i40e_prototype.h\nindex 0cf006dad..2f3e0bfee 100644\n--- a/drivers/net/i40e/base/i40e_prototype.h\n+++ b/drivers/net/i40e/base/i40e_prototype.h\n@@ -251,26 +251,18 @@ enum i40e_status_code i40e_aq_set_lldp_mib(struct i40e_hw *hw,\n enum i40e_status_code i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw,\n \t\t\t\tbool enable_update,\n \t\t\t\tstruct i40e_asq_cmd_details *cmd_details);\n-enum i40e_status_code i40e_aq_add_lldp_tlv(struct i40e_hw *hw, u8 bridge_type,\n-\t\t\t\tvoid *buff, u16 buff_size, u16 tlv_len,\n-\t\t\t\tu16 *mib_len,\n-\t\t\t\tstruct i40e_asq_cmd_details *cmd_details);\n-enum i40e_status_code i40e_aq_update_lldp_tlv(struct i40e_hw *hw,\n-\t\t\t\tu8 bridge_type, void *buff, u16 buff_size,\n-\t\t\t\tu16 old_len, u16 new_len, u16 offset,\n-\t\t\t\tu16 *mib_len,\n-\t\t\t\tstruct i40e_asq_cmd_details *cmd_details);\n-enum i40e_status_code i40e_aq_delete_lldp_tlv(struct i40e_hw *hw,\n-\t\t\t\tu8 bridge_type, void *buff, u16 buff_size,\n-\t\t\t\tu16 tlv_len, u16 *mib_len,\n-\t\t\t\tstruct i40e_asq_cmd_details *cmd_details);\n+enum i40e_status_code\n+i40e_aq_restore_lldp(struct i40e_hw *hw, u8 *setting, bool restore,\n+\t\t     struct i40e_asq_cmd_details *cmd_details);\n enum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent,\n+\t\t\t\tbool persist,\n \t\t\t\tstruct i40e_asq_cmd_details *cmd_details);\n enum i40e_status_code i40e_aq_set_dcb_parameters(struct i40e_hw *hw,\n \t\t\t\t\t\t bool dcb_enable,\n \t\t\t\t\t\t struct i40e_asq_cmd_details\n \t\t\t\t\t\t *cmd_details);\n enum i40e_status_code i40e_aq_start_lldp(struct i40e_hw *hw,\n+\t\t\t\tbool persist,\n \t\t\t\tstruct i40e_asq_cmd_details *cmd_details);\n enum i40e_status_code i40e_aq_get_cee_dcb_config(struct i40e_hw *hw,\n \t\t\t\tvoid *buff, u16 buff_size,\ndiff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h\nindex 0cbb13262..322300fa3 100644\n--- a/drivers/net/i40e/base/i40e_type.h\n+++ b/drivers/net/i40e/base/i40e_type.h\n@@ -742,6 +742,7 @@ struct i40e_hw {\n #define I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE  BIT_ULL(2)\n #define I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK BIT_ULL(3)\n #define I40E_HW_FLAG_FW_LLDP_STOPPABLE\t    BIT_ULL(4)\n+#define I40E_HW_FLAG_FW_LLDP_PERSISTENT     BIT_ULL(5)\n \tu64 flags;\n \n \t/* Used in set switch config AQ command */\ndiff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex d63658796..1b361c0b5 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -11574,7 +11574,7 @@ i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb)\n \t */\n \tif (sw_dcb == TRUE) {\n \t\tif (i40e_need_stop_lldp(dev)) {\n-\t\t\tret = i40e_aq_stop_lldp(hw, TRUE, NULL);\n+\t\t\tret = i40e_aq_stop_lldp(hw, TRUE, TRUE, NULL);\n \t\t\tif (ret != I40E_SUCCESS)\n \t\t\t\tPMD_INIT_LOG(DEBUG, \"Failed to stop lldp\");\n \t\t}\n@@ -11623,7 +11623,7 @@ i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb)\n \t\t\treturn -ENOTSUP;\n \t\t}\n \t} else {\n-\t\tret = i40e_aq_start_lldp(hw, NULL);\n+\t\tret = i40e_aq_start_lldp(hw, true, NULL);\n \t\tif (ret != I40E_SUCCESS)\n \t\t\tPMD_INIT_LOG(DEBUG, \"Failed to start lldp\");\n \ndiff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c\nindex fdcb1a43e..b64f55341 100644\n--- a/drivers/net/i40e/rte_pmd_i40e.c\n+++ b/drivers/net/i40e/rte_pmd_i40e.c\n@@ -1409,7 +1409,7 @@ rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map)\n \n \t/* Disable DCBx if it's the first time to set strict priority. */\n \tif (!veb->strict_prio_tc) {\n-\t\tret = i40e_aq_stop_lldp(hw, true, NULL);\n+\t\tret = i40e_aq_stop_lldp(hw, true, true, NULL);\n \t\tif (ret)\n \t\t\tPMD_DRV_LOG(INFO,\n \t\t\t\t    \"Failed to disable DCBx as it's already\"\n@@ -1464,7 +1464,7 @@ rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map)\n \n \t/* Enable DCBx again, if all the TCs' strict priority disabled. */\n \tif (!tc_map) {\n-\t\tret = i40e_aq_start_lldp(hw, NULL);\n+\t\tret = i40e_aq_start_lldp(hw, true, NULL);\n \t\tif (ret) {\n \t\t\tPMD_DRV_LOG(ERR,\n \t\t\t\t    \"Failed to enable DCBx, err(%d).\", ret);\n",
    "prefixes": [
        "v4",
        "06/36"
    ]
}