get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 115007,
    "url": "http://patches.dpdk.org/api/patches/115007/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220815071306.2910599-51-qi.z.zhang@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": "<20220815071306.2910599-51-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220815071306.2910599-51-qi.z.zhang@intel.com",
    "date": "2022-08-15T07:12:46",
    "name": "[50/70] net/ice/base: add support for Auto FEC with FEC disabled",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "53db42d84c7a4372dba7a2732fe806b98adeda24",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220815071306.2910599-51-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 24307,
            "url": "http://patches.dpdk.org/api/series/24307/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24307",
            "date": "2022-08-15T07:11:56",
            "name": "ice base code update",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/24307/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/115007/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/115007/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2C494A00C3;\n\tMon, 15 Aug 2022 01:08:07 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 70A5F42C3D;\n\tMon, 15 Aug 2022 01:04:33 +0200 (CEST)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n by mails.dpdk.org (Postfix) with ESMTP id 5FF2E42C8B\n for <dev@dpdk.org>; Mon, 15 Aug 2022 01:04:29 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 Aug 2022 16:04:28 -0700",
            "from dpdk-qzhan15-test02.sh.intel.com ([10.67.115.4])\n by fmsmga005.fm.intel.com with ESMTP; 14 Aug 2022 16:04:26 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1660518269; x=1692054269;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=1VfY9/RcGoh73wPSj49O7x3V58nT5lxCCSFn09RynqM=;\n b=M67Oj+kLEn7WNbNIiSqNMW020vdAXUZI34mZSkgmklXtXn/rcDUOqIQc\n BoAgsq67g51CCEQLYbLJW90RA8KSkj+rNNnCaVVNLvVWgPhOF0ZUMk9rY\n Ht7qZqzy5IZu9yK23ON8LKzF55zsZD2Zpebp3DXgTWWZIEaJ0dJ0s1//t\n KScKnMrT4MzjH7V89PSh33b9aJ0nDmbyQNsmjdahVrE/5usfDUKtlCXDC\n CU4VnPDz5/vX3BSutq9h9twvlNQ0lI8F5acWuT7nqoGJ9Dd1gkQ7ch8fp\n AetsteIDcuM8V8B8MHIeubGkVRBJfLEiKmskLkZ78fYpgGNn97Fsrz4ed w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10439\"; a=\"293128779\"",
            "E=Sophos;i=\"5.93,237,1654585200\"; d=\"scan'208\";a=\"293128779\"",
            "E=Sophos;i=\"5.93,237,1654585200\"; d=\"scan'208\";a=\"934296842\""
        ],
        "X-ExtLoop1": "1",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "qiming.yang@intel.com",
        "Cc": "dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>,\n Paul Greenwalt <paul.greenwalt@intel.com>",
        "Subject": "[PATCH 50/70] net/ice/base: add support for Auto FEC with FEC\n disabled",
        "Date": "Mon, 15 Aug 2022 03:12:46 -0400",
        "Message-Id": "<20220815071306.2910599-51-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20220815071306.2910599-1-qi.z.zhang@intel.com>",
        "References": "<20220815071306.2910599-1-qi.z.zhang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "The default Link Establishment State Machine (LESM) behavior does\nnot allow the use of FEC disable mode if the media does not support\nFEC disabled. However users may want to override this behavior.\n\nAdd support for settng Auto FEC with FEC disabled.\n\nSigned-off-by: Paul Greenwalt <paul.greenwalt@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/ice/base/ice_adminq_cmd.h |   2 +\n drivers/net/ice/base/ice_common.c     | 129 +++++++++++++++++++-------\n drivers/net/ice/base/ice_common.h     |   2 +\n drivers/net/ice/base/ice_type.h       |  12 ++-\n 4 files changed, 111 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h\nindex 6a1b8a40f2..dc72d70dfe 100644\n--- a/drivers/net/ice/base/ice_adminq_cmd.h\n+++ b/drivers/net/ice/base/ice_adminq_cmd.h\n@@ -1439,6 +1439,7 @@ struct ice_aqc_get_phy_caps_data {\n #define ICE_AQC_PHY_FEC_25G_RS_528_REQ\t\t\tBIT(2)\n #define ICE_AQC_PHY_FEC_25G_KR_REQ\t\t\tBIT(3)\n #define ICE_AQC_PHY_FEC_25G_RS_544_REQ\t\t\tBIT(4)\n+#define ICE_AQC_PHY_FEC_DIS\t\t\t\tBIT(5)\n #define ICE_AQC_PHY_FEC_25G_RS_CLAUSE91_EN\t\tBIT(6)\n #define ICE_AQC_PHY_FEC_25G_KR_CLAUSE74_EN\t\tBIT(7)\n #define ICE_AQC_PHY_FEC_MASK\t\t\t\tMAKEMASK(0xdf, 0)\n@@ -3275,6 +3276,7 @@ enum ice_adminq_opc {\n \tice_aqc_opc_lldp_set_local_mib\t\t\t= 0x0A08,\n \tice_aqc_opc_lldp_stop_start_specific_agent\t= 0x0A09,\n \tice_aqc_opc_lldp_filter_ctrl\t\t\t= 0x0A0A,\n+\tice_execute_pending_lldp_mib\t\t\t= 0x0A0B,\n \n \t/* RSS commands */\n \tice_aqc_opc_set_rss_key\t\t\t\t= 0x0B02,\ndiff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c\nindex 2014f8361d..9a41f36fed 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -3494,8 +3494,12 @@ enum ice_fc_mode ice_caps_to_fc_mode(u8 caps)\n  */\n enum ice_fec_mode ice_caps_to_fec_mode(u8 caps, u8 fec_options)\n {\n-\tif (caps & ICE_AQC_PHY_EN_AUTO_FEC)\n-\t\treturn ICE_FEC_AUTO;\n+\tif (caps & ICE_AQC_PHY_EN_AUTO_FEC) {\n+\t\tif (fec_options & ICE_AQC_PHY_FEC_DIS)\n+\t\t\treturn ICE_FEC_DIS_AUTO;\n+\t\telse\n+\t\t\treturn ICE_FEC_AUTO;\n+\t}\n \n \tif (fec_options & (ICE_AQC_PHY_FEC_10G_KR_40G_KR4_EN |\n \t\t\t   ICE_AQC_PHY_FEC_10G_KR_40G_KR4_REQ |\n@@ -3788,6 +3792,12 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg,\n \t\t/* Clear all FEC option bits. */\n \t\tcfg->link_fec_opt &= ~ICE_AQC_PHY_FEC_MASK;\n \t\tbreak;\n+\tcase ICE_FEC_DIS_AUTO:\n+\t\t/* Set No FEC and auto FEC */\n+\t\tif (!ice_fw_supports_fec_dis_auto(hw))\n+\t\t\treturn ICE_ERR_NOT_SUPPORTED;\n+\t\tcfg->link_fec_opt |= ICE_AQC_PHY_FEC_DIS;\n+\t\t/* fall-through */\n \tcase ICE_FEC_AUTO:\n \t\t/* AND auto FEC bit, and all caps bits. */\n \t\tcfg->caps &= ICE_AQC_PHY_CAPS_MASK;\n@@ -5750,26 +5760,70 @@ ice_aq_get_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx,\n }\n \n /**\n- * ice_fw_supports_link_override\n+ * ice_is_fw_api_min_ver\n  * @hw: pointer to the hardware structure\n+ * @maj: major version\n+ * @min: minor version\n+ * @patch: patch version\n  *\n- * Checks if the firmware supports link override\n+ * Checks if the firmware is minimum version\n  */\n-bool ice_fw_supports_link_override(struct ice_hw *hw)\n+static bool ice_is_fw_api_min_ver(struct ice_hw *hw, u8 maj, u8 min, u8 patch)\n {\n-\tif (hw->api_maj_ver == ICE_FW_API_LINK_OVERRIDE_MAJ) {\n-\t\tif (hw->api_min_ver > ICE_FW_API_LINK_OVERRIDE_MIN)\n+\tif (hw->api_maj_ver == maj) {\n+\t\tif (hw->api_min_ver > min)\n+\t\t\treturn true;\n+\t\tif (hw->api_min_ver == min && hw->api_patch >= patch)\n \t\t\treturn true;\n-\t\tif (hw->api_min_ver == ICE_FW_API_LINK_OVERRIDE_MIN &&\n-\t\t    hw->api_patch >= ICE_FW_API_LINK_OVERRIDE_PATCH)\n+\t} else if (hw->api_maj_ver > maj) {\n+\t\treturn true;\n+\t}\n+\n+\treturn false;\n+}\n+\n+/**\n+ * ice_is_fw_min_ver\n+ * @hw: pointer to the hardware structure\n+ * @branch: branch version\n+ * @maj: major version\n+ * @min: minor version\n+ * @patch: patch version\n+ *\n+ * Checks if the firmware is minimum version\n+ */\n+static bool ice_is_fw_min_ver(struct ice_hw *hw, u8 branch, u8 maj, u8 min,\n+\t\t\t      u8 patch)\n+{\n+\tif (hw->fw_branch == branch) {\n+\t\tif (hw->fw_maj_ver > maj)\n \t\t\treturn true;\n-\t} else if (hw->api_maj_ver > ICE_FW_API_LINK_OVERRIDE_MAJ) {\n+\t\tif (hw->fw_maj_ver == maj) {\n+\t\t\tif (hw->fw_min_ver > min)\n+\t\t\t\treturn true;\n+\t\t\tif (hw->fw_min_ver == min && hw->fw_patch >= patch)\n+\t\t\t\treturn true;\n+\t\t}\n+\t} else if (hw->fw_branch > branch) {\n \t\treturn true;\n \t}\n \n \treturn false;\n }\n \n+/**\n+ * ice_fw_supports_link_override\n+ * @hw: pointer to the hardware structure\n+ *\n+ * Checks if the firmware supports link override\n+ */\n+bool ice_fw_supports_link_override(struct ice_hw *hw)\n+{\n+\treturn ice_is_fw_api_min_ver(hw, ICE_FW_API_LINK_OVERRIDE_MAJ,\n+\t\t\t\t     ICE_FW_API_LINK_OVERRIDE_MIN,\n+\t\t\t\t     ICE_FW_API_LINK_OVERRIDE_PATCH);\n+}\n+\n /**\n  * ice_get_link_default_override\n  * @ldo: pointer to the link default override struct\n@@ -5897,19 +5951,12 @@ ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,\n  */\n bool ice_fw_supports_lldp_fltr_ctrl(struct ice_hw *hw)\n {\n-\tif (hw->mac_type != ICE_MAC_E810)\n+\tif (hw->mac_type != ICE_MAC_E810 && hw->mac_type != ICE_MAC_GENERIC)\n \t\treturn false;\n \n-\tif (hw->api_maj_ver == ICE_FW_API_LLDP_FLTR_MAJ) {\n-\t\tif (hw->api_min_ver > ICE_FW_API_LLDP_FLTR_MIN)\n-\t\t\treturn true;\n-\t\tif (hw->api_min_ver == ICE_FW_API_LLDP_FLTR_MIN &&\n-\t\t    hw->api_patch >= ICE_FW_API_LLDP_FLTR_PATCH)\n-\t\t\treturn true;\n-\t} else if (hw->api_maj_ver > ICE_FW_API_LLDP_FLTR_MAJ) {\n-\t\treturn true;\n-\t}\n-\treturn false;\n+\treturn ice_is_fw_api_min_ver(hw, ICE_FW_API_LLDP_FLTR_MAJ,\n+\t\t\t\t     ICE_FW_API_LLDP_FLTR_MIN,\n+\t\t\t\t     ICE_FW_API_LLDP_FLTR_PATCH);\n }\n \n /**\n@@ -5938,6 +5985,19 @@ ice_lldp_fltr_add_remove(struct ice_hw *hw, u16 vsi_num, bool add)\n \treturn ice_aq_send_cmd(hw, &desc, NULL, 0, NULL);\n }\n \n+/**\n+ * ice_lldp_execute_pending_mib - execute LLDP pending MIB request\n+ * @hw: pointer to HW struct\n+ */\n+enum ice_status ice_lldp_execute_pending_mib(struct ice_hw *hw)\n+{\n+\tstruct ice_aq_desc desc;\n+\n+\tice_fill_dflt_direct_cmd_desc(&desc, ice_execute_pending_lldp_mib);\n+\n+\treturn ice_aq_send_cmd(hw, &desc, NULL, 0, NULL);\n+}\n+\n /**\n  * ice_fw_supports_report_dflt_cfg\n  * @hw: pointer to the hardware structure\n@@ -5946,16 +6006,23 @@ ice_lldp_fltr_add_remove(struct ice_hw *hw, u16 vsi_num, bool add)\n  */\n bool ice_fw_supports_report_dflt_cfg(struct ice_hw *hw)\n {\n-\tif (hw->api_maj_ver == ICE_FW_API_REPORT_DFLT_CFG_MAJ) {\n-\t\tif (hw->api_min_ver > ICE_FW_API_REPORT_DFLT_CFG_MIN)\n-\t\t\treturn true;\n-\t\tif (hw->api_min_ver == ICE_FW_API_REPORT_DFLT_CFG_MIN &&\n-\t\t    hw->api_patch >= ICE_FW_API_REPORT_DFLT_CFG_PATCH)\n-\t\t\treturn true;\n-\t} else if (hw->api_maj_ver > ICE_FW_API_REPORT_DFLT_CFG_MAJ) {\n-\t\treturn true;\n-\t}\n-\treturn false;\n+\treturn ice_is_fw_api_min_ver(hw, ICE_FW_API_REPORT_DFLT_CFG_MAJ,\n+\t\t\t\t     ICE_FW_API_REPORT_DFLT_CFG_MIN,\n+\t\t\t\t     ICE_FW_API_REPORT_DFLT_CFG_PATCH);\n+}\n+\n+/**\n+ * ice_fw_supports_fec_dis_auto\n+ * @hw: pointer to the hardware structure\n+ *\n+ * Checks if the firmware supports FEC disable in Auto FEC mode\n+ */\n+bool ice_fw_supports_fec_dis_auto(struct ice_hw *hw)\n+{\n+\treturn ice_is_fw_min_ver(hw, ICE_FW_FEC_DIS_AUTO_BRANCH,\n+\t\t\t\t ICE_FW_FEC_DIS_AUTO_MAJ,\n+\t\t\t\t ICE_FW_FEC_DIS_AUTO_MIN,\n+\t\t\t\t ICE_FW_FEC_DIS_AUTO_PATCH);\n }\n /**\n  * ice_is_fw_auto_drop_supported\ndiff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h\nindex b15cf240f9..ac13a979b1 100644\n--- a/drivers/net/ice/base/ice_common.h\n+++ b/drivers/net/ice/base/ice_common.h\n@@ -167,6 +167,7 @@ enum ice_status\n ice_aq_set_phy_cfg(struct ice_hw *hw, struct ice_port_info *pi,\n \t\t   struct ice_aqc_set_phy_cfg_data *cfg, struct ice_sq_cd *cd);\n bool ice_fw_supports_link_override(struct ice_hw *hw);\n+bool ice_fw_supports_fec_dis_auto(struct ice_hw *hw);\n enum ice_status\n ice_get_link_default_override(struct ice_link_default_override_tlv *ldo,\n \t\t\t      struct ice_port_info *pi);\n@@ -282,6 +283,7 @@ ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,\n bool ice_fw_supports_lldp_fltr_ctrl(struct ice_hw *hw);\n enum ice_status\n ice_lldp_fltr_add_remove(struct ice_hw *hw, u16 vsi_num, bool add);\n+enum ice_status ice_lldp_execute_pending_mib(struct ice_hw *hw);\n enum ice_status\n ice_aq_read_i2c(struct ice_hw *hw, struct ice_aqc_link_topo_addr topo_addr,\n \t\tu16 bus_addr, __le16 addr, u8 params, u8 *data,\ndiff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h\nindex cdfef47e94..af56849482 100644\n--- a/drivers/net/ice/base/ice_type.h\n+++ b/drivers/net/ice/base/ice_type.h\n@@ -180,7 +180,8 @@ enum ice_fec_mode {\n \tICE_FEC_NONE = 0,\n \tICE_FEC_RS,\n \tICE_FEC_BASER,\n-\tICE_FEC_AUTO\n+\tICE_FEC_AUTO,\n+\tICE_FEC_DIS_AUTO\n };\n \n struct ice_phy_cache_mode_data {\n@@ -1514,9 +1515,14 @@ struct ice_aq_get_set_rss_lut_params {\n #define ICE_FW_API_REPORT_DFLT_CFG_MIN\t\t7\n \n #define ICE_FW_API_REPORT_DFLT_CFG_PATCH\t3\n+\n+/* FW version for FEC disable in Auto FEC mode */\n+#define ICE_FW_FEC_DIS_AUTO_BRANCH\t\t1\n+#define ICE_FW_FEC_DIS_AUTO_MAJ\t\t\t7\n+#define ICE_FW_FEC_DIS_AUTO_MIN\t\t\t0\n+#define ICE_FW_FEC_DIS_AUTO_PATCH\t\t5\n+\n /* AQ API version for FW auto drop reports */\n #define ICE_FW_API_AUTO_DROP_MAJ\t\t1\n #define ICE_FW_API_AUTO_DROP_MIN\t\t4\n-\n-\n #endif /* _ICE_TYPE_H_ */\n",
    "prefixes": [
        "50/70"
    ]
}