Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/512643/?format=api
{ "id": 512643, "url": "http://patchwork.ozlabs.org/api/patches/512643/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1441065295-234333-14-git-send-email-catherine.sullivan@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": "<1441065295-234333-14-git-send-email-catherine.sullivan@intel.com>", "list_archive_url": null, "date": "2015-08-31T23:54:53", "name": "[next,S14,13/15] i40e/i40evf: Add module_types and update_link_info", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "59b6d4b709031b56fe4f6a6b8dc528b6e8402821", "submitter": { "id": 13931, "url": "http://patchwork.ozlabs.org/api/people/13931/?format=api", "name": "Catherine Sullivan", "email": "catherine.sullivan@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/1441065295-234333-14-git-send-email-catherine.sullivan@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/512643/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/512643/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.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" ], "Received": [ "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ozlabs.org (Postfix) with ESMTP id 41297140663\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 1 Sep 2015 09:54:16 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id EBC08A3641;\n\tMon, 31 Aug 2015 23:54:15 +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 P-i7T1Yh-ezt; Mon, 31 Aug 2015 23:54:14 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 17DE5A36CB;\n\tMon, 31 Aug 2015 23:54:13 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id AD15A1C1009\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 31 Aug 2015 23:54:11 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id A7A3F33CFD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 31 Aug 2015 23:54:11 +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 y5qYWl8GFsuX for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 31 Aug 2015 23:54:10 +0000 (UTC)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby silver.osuosl.org (Postfix) with ESMTP id B99DF3315B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 31 Aug 2015 23:54:10 +0000 (UTC)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga102.fm.intel.com with ESMTP; 31 Aug 2015 16:54:10 -0700", "from catheri1-tigger.jf.intel.com ([134.134.176.92])\n\tby orsmga003.jf.intel.com with ESMTP; 31 Aug 2015 16:54:10 -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-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.17,445,1437462000\"; d=\"scan'208\";a=\"635798472\"", "From": "Catherine Sullivan <catherine.sullivan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Mon, 31 Aug 2015 19:54:53 -0400", "Message-Id": "<1441065295-234333-14-git-send-email-catherine.sullivan@intel.com>", "X-Mailer": "git-send-email 1.9.3", "In-Reply-To": "<1441065295-234333-1-git-send-email-catherine.sullivan@intel.com>", "References": "<1441065295-234333-1-git-send-email-catherine.sullivan@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S14 13/15] i40e/i40evf: Add\n\tmodule_types and update_link_info", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "Add a module_types variable to the link_info struct to save the module\ninformation from get_phy_capabilities. This information can be used to\ndetermine which speeds the module supports.\n\nAlso add a new function update_link_info which updates the module_types\nparameter and then calls get_link_info. This function should be called\nin place of get_link_info so that the module_types variable stays\nup-to-date with the rest of the link information.\n\nThe EAS table does not reflect the values that are actually returned,\nso instead, basing these values on the Ethernet compliance codes\nspecified in table 33 of SFF-8436 as these have been accurate.\n\nUse the new variable in ethtool to differentiate between a 10G/1G dual\nspeed fiber module and a 10G only module.\n\nSigned-off-by: Catherine Sullivan <catherine.sullivan@intel.com>\nChange-ID: Ib7585cce321319c10ce15180054c41a6cbd41389\n---\n drivers/net/ethernet/intel/i40e/i40e_common.c | 30 +++++++++++++++++++++---\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 16 +++++++++----\n drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-\n drivers/net/ethernet/intel/i40e/i40e_prototype.h | 1 +\n drivers/net/ethernet/intel/i40e/i40e_type.h | 18 ++++++++++++++\n drivers/net/ethernet/intel/i40evf/i40e_type.h | 18 ++++++++++++++\n 6 files changed, 76 insertions(+), 9 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c\nindex d9519ce..c1d0dca 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_common.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c\n@@ -1717,14 +1717,14 @@ enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,\n \t\t\t*aq_failures |= I40E_SET_FC_AQ_FAIL_SET;\n \t}\n \t/* Update the link info */\n-\tstatus = i40e_aq_get_link_info(hw, true, NULL, NULL);\n+\tstatus = i40e_update_link_info(hw);\n \tif (status) {\n \t\t/* Wait a little bit (on 40G cards it sometimes takes a really\n \t\t * long time for link to come back from the atomic reset)\n \t\t * and try once more\n \t\t */\n \t\tmsleep(1000);\n-\t\tstatus = i40e_aq_get_link_info(hw, true, NULL, NULL);\n+\t\tstatus = i40e_update_link_info(hw);\n \t}\n \tif (status)\n \t\t*aq_failures |= I40E_SET_FC_AQ_FAIL_UPDATE;\n@@ -2315,7 +2315,7 @@ i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up)\n \ti40e_status status = 0;\n \n \tif (hw->phy.get_link_info) {\n-\t\tstatus = i40e_aq_get_link_info(hw, true, NULL, NULL);\n+\t\tstatus = i40e_update_link_info(hw);\n \n \t\tif (status)\n \t\t\ti40e_debug(hw, I40E_DEBUG_LINK, \"get link failed: status %d\\n\",\n@@ -2328,6 +2328,30 @@ i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up)\n }\n \n /**\n+ * i40e_updatelink_status - update status of the HW network link\n+ * @hw: pointer to the hw struct\n+ **/\n+i40e_status i40e_update_link_info(struct i40e_hw *hw)\n+{\n+\tstruct i40e_aq_get_phy_abilities_resp abilities;\n+\ti40e_status status = 0;\n+\n+\tstatus = i40e_aq_get_link_info(hw, true, NULL, NULL);\n+\tif (status)\n+\t\treturn status;\n+\n+\tstatus = i40e_aq_get_phy_capabilities(hw, false, false, &abilities,\n+\t\t\t\t\t NULL);\n+\tif (status)\n+\t\treturn status;\n+\n+\tmemcpy(hw->phy.link_info.module_type, &abilities.module_type,\n+\t sizeof(hw->phy.link_info.module_type));\n+\n+\treturn status;\n+}\n+\n+/**\n * i40e_aq_add_veb - Insert a VEB between the VSI and the MAC\n * @hw: pointer to the hw struct\n * @uplink_seid: the MAC or other gizmo SEID\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex 148f614..46019e9 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -307,12 +307,18 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,\n \tcase I40E_PHY_TYPE_10GBASE_LR:\n \tcase I40E_PHY_TYPE_1000BASE_SX:\n \tcase I40E_PHY_TYPE_1000BASE_LX:\n-\t\tecmd->supported = SUPPORTED_10000baseT_Full |\n-\t\t\t\t SUPPORTED_1000baseT_Full;\n+\t\tecmd->supported = SUPPORTED_10000baseT_Full;\n+\t\tif (hw_link_info->module_type[2] &\n+\t\t I40E_MODULE_TYPE_1000BASE_SX ||\n+\t\t hw_link_info->module_type[2] &\n+\t\t I40E_MODULE_TYPE_1000BASE_LX) {\n+\t\t\tecmd->supported |= SUPPORTED_1000baseT_Full;\n+\t\t\tif (hw_link_info->requested_speeds &\n+\t\t\t I40E_LINK_SPEED_1GB)\n+\t\t\t\tecmd->advertising |= ADVERTISED_1000baseT_Full;\n+\t\t}\n \t\tif (hw_link_info->requested_speeds & I40E_LINK_SPEED_10GB)\n \t\t\tecmd->advertising |= ADVERTISED_10000baseT_Full;\n-\t\tif (hw_link_info->requested_speeds & I40E_LINK_SPEED_1GB)\n-\t\t\tecmd->advertising |= ADVERTISED_1000baseT_Full;\n \t\tbreak;\n \tcase I40E_PHY_TYPE_1000BASE_KX:\n \t\tecmd->supported = SUPPORTED_Autoneg |\n@@ -704,7 +710,7 @@ static int i40e_set_settings(struct net_device *netdev,\n \t\t\treturn -EAGAIN;\n \t\t}\n \n-\t\tstatus = i40e_aq_get_link_info(hw, true, NULL, NULL);\n+\t\tstatus = i40e_update_link_info(hw);\n \t\tif (status)\n \t\t\tnetdev_info(netdev, \"Updating link info failed with err %s aq_err %s\\n\",\n \t\t\t\t i40e_stat_str(hw, status),\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex ae2d630..722a26c 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -9764,7 +9764,7 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit)\n \t\ti40e_config_rss(pf);\n \n \t/* fill in link information and enable LSE reporting */\n-\ti40e_aq_get_link_info(&pf->hw, true, NULL, NULL);\n+\ti40e_update_link_info(&pf->hw);\n \ti40e_link_event(pf);\n \n \t/* Initialize user-specific link properties */\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h\nindex 757bf2c..0e2bfb1ad 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h\n@@ -265,6 +265,7 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw);\n void i40e_clear_hw(struct i40e_hw *hw);\n void i40e_clear_pxe_mode(struct i40e_hw *hw);\n i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up);\n+i40e_status i40e_update_link_info(struct i40e_hw *hw);\n i40e_status i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr);\n i40e_status i40e_read_bw_from_alt_ram(struct i40e_hw *hw,\n \t\t\t\t u32 *max_bw, u32 *min_bw, bool *min_valid,\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h\nindex 102d0c4..0a450ac 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_type.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h\n@@ -167,6 +167,24 @@ struct i40e_link_status {\n \tbool crc_enable;\n \tu8 pacing;\n \tu8 requested_speeds;\n+\tu8 module_type[3];\n+\t/* 1st byte: module identifier */\n+#define I40E_MODULE_TYPE_SFP\t\t0x03\n+#define I40E_MODULE_TYPE_QSFP\t\t0x0D\n+\t/* 2nd byte: ethernet compliance codes for 10/40G */\n+#define I40E_MODULE_TYPE_40G_ACTIVE\t0x01\n+#define I40E_MODULE_TYPE_40G_LR4\t0x02\n+#define I40E_MODULE_TYPE_40G_SR4\t0x04\n+#define I40E_MODULE_TYPE_40G_CR4\t0x08\n+#define I40E_MODULE_TYPE_10G_BASE_SR\t0x10\n+#define I40E_MODULE_TYPE_10G_BASE_LR\t0x20\n+#define I40E_MODULE_TYPE_10G_BASE_LRM\t0x40\n+#define I40E_MODULE_TYPE_10G_BASE_ER\t0x80\n+\t/* 3rd byte: ethernet compliance codes for 1G */\n+#define I40E_MODULE_TYPE_1000BASE_SX\t0x01\n+#define I40E_MODULE_TYPE_1000BASE_LX\t0x02\n+#define I40E_MODULE_TYPE_1000BASE_CX\t0x04\n+#define I40E_MODULE_TYPE_1000BASE_T\t0x08\n };\n \n struct i40e_phy_info {\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h\nindex 6dbace3..f3155e3 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_type.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h\n@@ -167,6 +167,24 @@ struct i40e_link_status {\n \tbool crc_enable;\n \tu8 pacing;\n \tu8 requested_speeds;\n+\tu8 module_type[3];\n+\t/* 1st byte: module identifier */\n+#define I40E_MODULE_TYPE_SFP\t\t0x03\n+#define I40E_MODULE_TYPE_QSFP\t\t0x0D\n+\t/* 2nd byte: ethernet compliance codes for 10/40G */\n+#define I40E_MODULE_TYPE_40G_ACTIVE\t0x01\n+#define I40E_MODULE_TYPE_40G_LR4\t0x02\n+#define I40E_MODULE_TYPE_40G_SR4\t0x04\n+#define I40E_MODULE_TYPE_40G_CR4\t0x08\n+#define I40E_MODULE_TYPE_10G_BASE_SR\t0x10\n+#define I40E_MODULE_TYPE_10G_BASE_LR\t0x20\n+#define I40E_MODULE_TYPE_10G_BASE_LRM\t0x40\n+#define I40E_MODULE_TYPE_10G_BASE_ER\t0x80\n+\t/* 3rd byte: ethernet compliance codes for 1G */\n+#define I40E_MODULE_TYPE_1000BASE_SX\t0x01\n+#define I40E_MODULE_TYPE_1000BASE_LX\t0x02\n+#define I40E_MODULE_TYPE_1000BASE_CX\t0x04\n+#define I40E_MODULE_TYPE_1000BASE_T\t0x08\n };\n \n struct i40e_phy_info {\n", "prefixes": [ "next", "S14", "13/15" ] }