Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1122927/?format=api
{ "id": 1122927, "url": "http://patchwork.ozlabs.org/api/patches/1122927/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190626092027.52845-1-anthony.l.nguyen@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": "<20190626092027.52845-1-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2019-06-26T09:20:12", "name": "[S22,01/16] ice: add lp_advertising flow control support", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "2ee6b3faa9b83b02b32b1e1dbfbabe2f607890ca", "submitter": { "id": 68875, "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api", "name": "Tony Nguyen", "email": "anthony.l.nguyen@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/20190626092027.52845-1-anthony.l.nguyen@intel.com/mbox/", "series": [ { "id": 116295, "url": "http://patchwork.ozlabs.org/api/series/116295/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=116295", "date": "2019-06-26T09:20:14", "name": "[S22,01/16] ice: add lp_advertising flow control support", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/116295/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1122927/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1122927/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 45Yr8w6N86z9s8m\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 27 Jun 2019 03:48:00 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 3DA8686AF2;\n\tWed, 26 Jun 2019 17:47:59 +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 0XmmPewMG1bI; Wed, 26 Jun 2019 17:47:57 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id A076786A0C;\n\tWed, 26 Jun 2019 17:47:57 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 4CBF61BF326\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 26 Jun 2019 17:47:54 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 49E94868E7\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 26 Jun 2019 17:47:54 +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 sm17lKk3j0HY for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 26 Jun 2019 17:47:52 +0000 (UTC)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 858EC843BB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 26 Jun 2019 17:47:52 +0000 (UTC)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Jun 2019 10:47:51 -0700", "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby fmsmga001.fm.intel.com with ESMTP; 26 Jun 2019 10:47:51 -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.63,420,1557212400\"; d=\"scan'208\";a=\"183218105\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 26 Jun 2019 02:20:12 -0700", "Message-Id": "<20190626092027.52845-1-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.20.1", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S22 01/16] ice: add lp_advertising flow\n\tcontrol support", "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": "From: Paul Greenwalt <paul.greenwalt@intel.com>\n\nAdd support for reporting link partner advertising when\nETHTOOL_GLINKSETTINGS defined. Get pause param reports the Tx/Rx\npause configured, and then ethtool issues ETHTOOL_GSET ioctl and\nice_get_settings_link_up reports the negotiated Tx/Rx pause. Negotiated\npause frame report per IEEE 802.3-2005 table 288-3.\n\n$ ethtool --show-pause ens6f0\nPause parameters for ens6f0:\nAutonegotiate: on\nRX: on\nTX: on\nRX negotiated: on\nTX negotiated: on\n\n$ ethtool ens6f0\nSettings for ens6f0:\n Supported ports: [ FIBRE ]\n Supported link modes: 25000baseCR/Full\n Supported pause frame use: Symmetric\n Supports auto-negotiation: Yes\n Supported FEC modes: None BaseR RS\n Advertised link modes: 25000baseCR/Full\n Advertised pause frame use: Symmetric Receive-only\n Advertised auto-negotiation: Yes\n Advertised FEC modes: None BaseR RS\n Link partner advertised link modes: Not reported\n Link partner advertised pause frame use: Symmetric\n Link partner advertised auto-negotiation: Yes\n Link partner advertised FEC modes: Not reported\n Speed: 25000Mb/s\n Duplex: Full\n Port: Direct Attach Copper\n PHYAD: 0\n Transceiver: internal\n Auto-negotiation: on\n Supports Wake-on: g\n Wake-on: g\n Current message level: 0x00000007 (7)\n drv probe link\n Link detected: yes\n\nWhen ETHTOOL_GLINKSETTINGS is not defined, get pause param reports the\nnegotiated Tx/Rx pause.\n\nSigned-off-by: Paul Greenwalt <paul.greenwalt@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_ethtool.c | 104 +++++++++++++------\n 1 file changed, 72 insertions(+), 32 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c\nindex 5c9f7a8bfd16..cfe5469b6f17 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c\n@@ -1716,6 +1716,7 @@ ice_get_settings_link_up(struct ethtool_link_ksettings *ks,\n \t\t\t struct net_device *netdev)\n {\n \tstruct ice_netdev_priv *np = netdev_priv(netdev);\n+\tstruct ice_port_info *pi = np->vsi->port_info;\n \tstruct ethtool_link_ksettings cap_ksettings;\n \tstruct ice_link_status *link_info;\n \tstruct ice_vsi *vsi = np->vsi;\n@@ -2040,6 +2041,33 @@ ice_get_settings_link_up(struct ethtool_link_ksettings *ks,\n \t\tbreak;\n \t}\n \tks->base.duplex = DUPLEX_FULL;\n+\n+\tif (link_info->an_info & ICE_AQ_AN_COMPLETED)\n+\t\tethtool_link_ksettings_add_link_mode(ks, lp_advertising,\n+\t\t\t\t\t\t Autoneg);\n+\n+\t/* Set flow control negotiated Rx/Tx pause */\n+\tswitch (pi->fc.current_mode) {\n+\tcase ICE_FC_FULL:\n+\t\tethtool_link_ksettings_add_link_mode(ks, lp_advertising, Pause);\n+\t\tbreak;\n+\tcase ICE_FC_TX_PAUSE:\n+\t\tethtool_link_ksettings_add_link_mode(ks, lp_advertising, Pause);\n+\t\tethtool_link_ksettings_add_link_mode(ks, lp_advertising,\n+\t\t\t\t\t\t Asym_Pause);\n+\t\tbreak;\n+\tcase ICE_FC_RX_PAUSE:\n+\t\tethtool_link_ksettings_add_link_mode(ks, lp_advertising,\n+\t\t\t\t\t\t Asym_Pause);\n+\t\tbreak;\n+\tcase ICE_FC_PFC:\n+\t\t/* fall through */\n+\tdefault:\n+\t\tethtool_link_ksettings_del_link_mode(ks, lp_advertising, Pause);\n+\t\tethtool_link_ksettings_del_link_mode(ks, lp_advertising,\n+\t\t\t\t\t\t Asym_Pause);\n+\t\tbreak;\n+\t}\n }\n \n /**\n@@ -2078,9 +2106,12 @@ ice_get_link_ksettings(struct net_device *netdev,\n \tstruct ice_aqc_get_phy_caps_data *caps;\n \tstruct ice_link_status *hw_link_info;\n \tstruct ice_vsi *vsi = np->vsi;\n+\tenum ice_status status;\n+\tint err = 0;\n \n \tethtool_link_ksettings_zero_link_mode(ks, supported);\n \tethtool_link_ksettings_zero_link_mode(ks, advertising);\n+\tethtool_link_ksettings_zero_link_mode(ks, lp_advertising);\n \thw_link_info = &vsi->port_info->phy.link_info;\n \n \t/* set speed and duplex */\n@@ -2125,48 +2156,36 @@ ice_get_link_ksettings(struct net_device *netdev,\n \t/* flow control is symmetric and always supported */\n \tethtool_link_ksettings_add_link_mode(ks, supported, Pause);\n \n-\tswitch (vsi->port_info->fc.req_mode) {\n-\tcase ICE_FC_FULL:\n+\tcaps = devm_kzalloc(&vsi->back->pdev->dev, sizeof(*caps), GFP_KERNEL);\n+\tif (!caps)\n+\t\treturn -ENOMEM;\n+\n+\tstatus = ice_aq_get_phy_caps(vsi->port_info, false,\n+\t\t\t\t ICE_AQC_REPORT_SW_CFG, caps, NULL);\n+\tif (status) {\n+\t\terr = -EIO;\n+\t\tgoto done;\n+\t}\n+\n+\t/* Set the advertised flow control based on the PHY capability */\n+\tif ((caps->caps & ICE_AQC_PHY_EN_TX_LINK_PAUSE) &&\n+\t (caps->caps & ICE_AQC_PHY_EN_RX_LINK_PAUSE)) {\n \t\tethtool_link_ksettings_add_link_mode(ks, advertising, Pause);\n-\t\tbreak;\n-\tcase ICE_FC_TX_PAUSE:\n \t\tethtool_link_ksettings_add_link_mode(ks, advertising,\n \t\t\t\t\t\t Asym_Pause);\n-\t\tbreak;\n-\tcase ICE_FC_RX_PAUSE:\n+\t} else if (caps->caps & ICE_AQC_PHY_EN_TX_LINK_PAUSE) {\n+\t\tethtool_link_ksettings_add_link_mode(ks, advertising,\n+\t\t\t\t\t\t Asym_Pause);\n+\t} else if (caps->caps & ICE_AQC_PHY_EN_RX_LINK_PAUSE) {\n \t\tethtool_link_ksettings_add_link_mode(ks, advertising, Pause);\n \t\tethtool_link_ksettings_add_link_mode(ks, advertising,\n \t\t\t\t\t\t Asym_Pause);\n-\t\tbreak;\n-\tcase ICE_FC_PFC:\n-\tdefault:\n+\t} else {\n \t\tethtool_link_ksettings_del_link_mode(ks, advertising, Pause);\n \t\tethtool_link_ksettings_del_link_mode(ks, advertising,\n \t\t\t\t\t\t Asym_Pause);\n-\t\tbreak;\n \t}\n \n-\tcaps = devm_kzalloc(&vsi->back->pdev->dev, sizeof(*caps), GFP_KERNEL);\n-\tif (!caps)\n-\t\tgoto done;\n-\n-\tif (ice_aq_get_phy_caps(vsi->port_info, false, ICE_AQC_REPORT_TOPO_CAP,\n-\t\t\t\tcaps, NULL))\n-\t\tnetdev_info(netdev, \"Get phy capability failed.\\n\");\n-\n-\t/* Set supported FEC modes based on PHY capability */\n-\tethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE);\n-\n-\tif (caps->link_fec_options & ICE_AQC_PHY_FEC_10G_KR_40G_KR4_EN ||\n-\t caps->link_fec_options & ICE_AQC_PHY_FEC_25G_KR_CLAUSE74_EN)\n-\t\tethtool_link_ksettings_add_link_mode(ks, supported, FEC_BASER);\n-\tif (caps->link_fec_options & ICE_AQC_PHY_FEC_25G_RS_CLAUSE91_EN)\n-\t\tethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS);\n-\n-\tif (ice_aq_get_phy_caps(vsi->port_info, false, ICE_AQC_REPORT_SW_CFG,\n-\t\t\t\tcaps, NULL))\n-\t\tnetdev_info(netdev, \"Get phy capability failed.\\n\");\n-\n \t/* Set advertised FEC modes based on PHY capability */\n \tethtool_link_ksettings_add_link_mode(ks, advertising, FEC_NONE);\n \n@@ -2178,9 +2197,25 @@ ice_get_link_ksettings(struct net_device *netdev,\n \t caps->link_fec_options & ICE_AQC_PHY_FEC_25G_RS_544_REQ)\n \t\tethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS);\n \n+\tstatus = ice_aq_get_phy_caps(vsi->port_info, false,\n+\t\t\t\t ICE_AQC_REPORT_TOPO_CAP, caps, NULL);\n+\tif (status) {\n+\t\terr = -EIO;\n+\t\tgoto done;\n+\t}\n+\n+\t/* Set supported FEC modes based on PHY capability */\n+\tethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE);\n+\n+\tif (caps->link_fec_options & ICE_AQC_PHY_FEC_10G_KR_40G_KR4_EN ||\n+\t caps->link_fec_options & ICE_AQC_PHY_FEC_25G_KR_CLAUSE74_EN)\n+\t\tethtool_link_ksettings_add_link_mode(ks, supported, FEC_BASER);\n+\tif (caps->link_fec_options & ICE_AQC_PHY_FEC_25G_RS_CLAUSE91_EN)\n+\t\tethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS);\n+\n done:\n \tdevm_kfree(&vsi->back->pdev->dev, caps);\n-\treturn 0;\n+\treturn err;\n }\n \n /**\n@@ -2817,6 +2852,11 @@ static int ice_nway_reset(struct net_device *netdev)\n * ice_get_pauseparam - Get Flow Control status\n * @netdev: network interface device structure\n * @pause: ethernet pause (flow control) parameters\n+ *\n+ * Get requested flow control status from PHY capability.\n+ * If autoneg is true, then ethtool will send the ETHTOOL_GSET ioctl which\n+ * is handled by ice_get_link_ksettings. ice_get_link_ksettings will report\n+ * the negotiated Rx/Tx pause via lp_advertising.\n */\n static void\n ice_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)\n", "prefixes": [ "S22", "01/16" ] }