Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/821433/?format=api
{ "id": 821433, "url": "http://patchwork.ozlabs.org/api/patches/821433/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20171004175839.28364-14-alan.brady@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": "<20171004175839.28364-14-alan.brady@intel.com>", "list_archive_url": null, "date": "2017-10-04T17:58:39", "name": "[13/13,net-next] i40e: convert i40e_set_link_ksettings to new API", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "723ea5c9a5ee0d9f1bd1911a2b12e4b382cefe3c", "submitter": { "id": 69551, "url": "http://patchwork.ozlabs.org/api/people/69551/?format=api", "name": "Alan Brady", "email": "alan.brady@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/20171004175839.28364-14-alan.brady@intel.com/mbox/", "series": [ { "id": 6427, "url": "http://patchwork.ozlabs.org/api/series/6427/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=6427", "date": "2017-10-04T17:58:26", "name": "i40e: refactor ethtool interface", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/6427/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/821433/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/821433/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@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>)", "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y6kHx4Gkrz9t7n\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 5 Oct 2017 05:02:05 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id D33AB888FB;\n\tWed, 4 Oct 2017 18:02:03 +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 fvyB+OVefUZr; Wed, 4 Oct 2017 18:02:02 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id D635488907;\n\tWed, 4 Oct 2017 18:02:00 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id CCA311C25C5\n\tfor <intel-wired-lan@osuosl.org>;\n\tWed, 4 Oct 2017 18:01:47 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id C019587A1B\n\tfor <intel-wired-lan@osuosl.org>;\n\tWed, 4 Oct 2017 18:01:47 +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 T8xnXlVWy5PV for <intel-wired-lan@osuosl.org>;\n\tWed, 4 Oct 2017 18:01:45 +0000 (UTC)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 996B287A21\n\tfor <intel-wired-lan@osuosl.org>;\n\tWed, 4 Oct 2017 18:01:45 +0000 (UTC)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t04 Oct 2017 11:01:45 -0700", "from dev1-atbrady.jf.intel.com ([10.165.248.38])\n\tby FMSMGA003.fm.intel.com with ESMTP; 04 Oct 2017 11:01:45 -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.42,478,1500966000\"; d=\"scan'208\";a=\"906754445\"", "From": "Alan Brady <alan.brady@intel.com>", "To": "intel-wired-lan@osuosl.org", "Date": "Wed, 4 Oct 2017 10:58:39 -0700", "Message-Id": "<20171004175839.28364-14-alan.brady@intel.com>", "X-Mailer": "git-send-email 2.14.1", "In-Reply-To": "<20171004175839.28364-1-alan.brady@intel.com>", "References": "<20171004175839.28364-1-alan.brady@intel.com>", "Subject": "[Intel-wired-lan] [PATCH 13/13 net-next] i40e: convert\n\ti40e_set_link_ksettings to new API", "X-BeenThere": "intel-wired-lan@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.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>", "MIME-Version": "1.0", "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": "This finishes off the conversion to the new ethtool API by removing the\nold macros being used in i40e_set_link_ksettings and replacing them with\nshiny new ones.\n\nThis conversion also allows us to provide link speed support for new 25G\nand 10G macros which is included here as well.\n\nSigned-off-by: Alan Brady <alan.brady@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 94 ++++++++++++++++----------\n 1 file changed, 58 insertions(+), 36 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex f25cdd4cb860..489aecd3f5dc 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -855,9 +855,7 @@ static int i40e_set_link_ksettings(struct net_device *netdev,\n \ti40e_status status = 0;\n \tint timeout = 50;\n \tint err = 0;\n-\tu32 autoneg;\n-\tu32 advertise;\n-\tu32 tmp;\n+\tu8 autoneg;\n \n \t/* Changing port settings is not supported if this isn't the\n \t * port's controlling PF\n@@ -885,28 +883,35 @@ static int i40e_set_link_ksettings(struct net_device *netdev,\n \t/* copy the ksettings to copy_ks to avoid modifying the origin */\n \tmemcpy(©_ks, ks, sizeof(struct ethtool_link_ksettings));\n \n+\t/* save autoneg out of ksettings */\n+\tautoneg = copy_ks.base.autoneg;\n+\n+\tmemset(&safe_ks, 0, sizeof(safe_ks));\n+\t/* Get link modes supported by hardware... */\n+\ti40e_phy_type_to_ethtool(pf, &safe_ks);\n+\t/* ...and check against modes requested by user.\n+\t * Return an error if unsupported mode was set.\n+\t */\n+\tif (!bitmap_subset(copy_ks.link_modes.advertising,\n+\t\t\t safe_ks.link_modes.supported,\n+\t\t\t __ETHTOOL_LINK_MODE_MASK_NBITS))\n+\t\treturn -EINVAL;\n+\n \t/* get our own copy of the bits to check against */\n \tmemset(&safe_ks, 0, sizeof(struct ethtool_link_ksettings));\n+\tsafe_ks.base.cmd = copy_ks.base.cmd;\n+\tsafe_ks.base.link_mode_masks_nwords =\n+\t\tcopy_ks.base.link_mode_masks_nwords;\n \ti40e_get_link_ksettings(netdev, &safe_ks);\n \n-\t/* save autoneg and speed out of ksettings */\n-\tautoneg = ks->base.autoneg;\n-\tethtool_convert_link_mode_to_legacy_u32(&advertise,\n-\t\t\t\t\t\tks->link_modes.advertising);\n-\n-\t/* set autoneg and speed back to what they currently are */\n+\t/* set autoneg back to what it currently is */\n \tcopy_ks.base.autoneg = safe_ks.base.autoneg;\n-\tethtool_convert_link_mode_to_legacy_u32(\n-\t\t&tmp, safe_ks.link_modes.advertising);\n-\tethtool_convert_legacy_u32_to_link_mode(\n-\t\tcopy_ks.link_modes.advertising, tmp);\n \n-\tcopy_ks.base.cmd = safe_ks.base.cmd;\n-\n-\t/* If copy_ks and safe_ks are not the same now, then they are\n-\t * trying to set something that we do not support\n+\t/* If copy_ks.base and safe_ks.base are not the same now, then they are\n+\t * trying to set something that we do not support.\n \t */\n-\tif (memcmp(©_ks, &safe_ks, sizeof(struct ethtool_link_ksettings)))\n+\tif (memcmp(©_ks.base, &safe_ks.base,\n+\t\t sizeof(struct ethtool_link_settings)))\n \t\treturn -EOPNOTSUPP;\n \n \twhile (test_and_set_bit(__I40E_CONFIG_BUSY, pf->state)) {\n@@ -967,28 +972,45 @@ static int i40e_set_link_ksettings(struct net_device *netdev,\n \t\t}\n \t}\n \n-\tethtool_convert_link_mode_to_legacy_u32(&tmp,\n-\t\t\t\t\t\tsafe_ks.link_modes.supported);\n-\tif (advertise & ~tmp) {\n-\t\terr = -EINVAL;\n-\t\tgoto done;\n-\t}\n-\n-\tif (advertise & ADVERTISED_100baseT_Full)\n+\tif (ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 100baseT_Full))\n \t\tconfig.link_speed |= I40E_LINK_SPEED_100MB;\n-\tif (advertise & ADVERTISED_1000baseT_Full ||\n-\t advertise & ADVERTISED_1000baseKX_Full)\n+\tif (ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 1000baseT_Full) ||\n+\t ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 1000baseX_Full) ||\n+\t ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 1000baseKX_Full))\n \t\tconfig.link_speed |= I40E_LINK_SPEED_1GB;\n-\tif (advertise & ADVERTISED_10000baseT_Full ||\n-\t advertise & ADVERTISED_10000baseKX4_Full ||\n-\t advertise & ADVERTISED_10000baseKR_Full)\n+\tif (ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 10000baseT_Full) ||\n+\t ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 10000baseKX4_Full) ||\n+\t ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 10000baseKR_Full) ||\n+\t ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 10000baseCR_Full) ||\n+\t ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 10000baseSR_Full))\n \t\tconfig.link_speed |= I40E_LINK_SPEED_10GB;\n-\tif (advertise & ADVERTISED_20000baseKR2_Full)\n+\tif (ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 20000baseKR2_Full))\n \t\tconfig.link_speed |= I40E_LINK_SPEED_20GB;\n-\tif (advertise & ADVERTISED_40000baseKR4_Full ||\n-\t advertise & ADVERTISED_40000baseCR4_Full ||\n-\t advertise & ADVERTISED_40000baseSR4_Full ||\n-\t advertise & ADVERTISED_40000baseLR4_Full)\n+\tif (ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 25000baseCR_Full) ||\n+\t ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 25000baseKR_Full) ||\n+\t ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 25000baseSR_Full))\n+\t\tconfig.link_speed |= I40E_LINK_SPEED_25GB;\n+\tif (ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 40000baseKR4_Full) ||\n+\t ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 40000baseCR4_Full) ||\n+\t ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 40000baseSR4_Full) ||\n+\t ethtool_link_ksettings_test_link_mode(ks, advertising,\n+\t\t\t\t\t\t 40000baseLR4_Full))\n \t\tconfig.link_speed |= I40E_LINK_SPEED_40GB;\n \n \t/* If speed didn't get set, set it to what it currently is.\n", "prefixes": [ "13/13", "net-next" ] }