netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 01/11] ice: Do autoneg based on VSI state
Date: Tue, 20 Nov 2018 12:22:37 -0800	[thread overview]
Message-ID: <20181120202247.10743-2-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20181120202247.10743-1-jeffrey.t.kirsher@intel.com>

From: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>

If VSI state is up, we should do autoneg with link up, otherwise
with link down.

Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index 648acdb4c644..4d3e3113741d 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -1392,17 +1392,17 @@ static int ice_nway_reset(struct net_device *netdev)
 {
 	/* restart autonegotiation */
 	struct ice_netdev_priv *np = netdev_priv(netdev);
-	struct ice_link_status *hw_link_info;
 	struct ice_vsi *vsi = np->vsi;
 	struct ice_port_info *pi;
 	enum ice_status status;
-	bool link_up;
 
 	pi = vsi->port_info;
-	hw_link_info = &pi->phy.link_info;
-	link_up = hw_link_info->link_info & ICE_AQ_LINK_UP;
+	/* If VSI state is up, then restart autoneg with link up */
+	if (!test_bit(__ICE_DOWN, vsi->back->state))
+		status = ice_aq_set_link_restart_an(pi, true, NULL);
+	else
+		status = ice_aq_set_link_restart_an(pi, false, NULL);
 
-	status = ice_aq_set_link_restart_an(pi, link_up, NULL);
 	if (status) {
 		netdev_info(netdev, "link restart failed, err %d aq_err %d\n",
 			    status, pi->hw->adminq.sq_last_status);
-- 
2.19.1

  reply	other threads:[~2018-11-21  6:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20 20:22 [net-next 00/11][pull request] 100GbE Intel Wired LAN Driver Updates 2018-11-20 Jeff Kirsher
2018-11-20 20:22 ` Jeff Kirsher [this message]
2018-11-20 20:22 ` [net-next 02/11] ice: Cleanup duplicate control queue code Jeff Kirsher
2018-11-20 20:22 ` [net-next 03/11] ice: Pass the return value of ice_init_def_sw_recp() Jeff Kirsher
2018-11-20 20:22 ` [net-next 04/11] ice: Do not set LAN_EN for MAC-VLAN filters Jeff Kirsher
2018-11-20 20:22 ` [net-next 05/11] ice: Constify global structures that can/should be Jeff Kirsher
2018-11-20 20:22 ` [net-next 06/11] ice: Fix return value from NAPI poll Jeff Kirsher
2018-11-20 20:22 ` [net-next 07/11] ice: Cleanup ice_tx_timeout() Jeff Kirsher
2018-11-20 20:22 ` [net-next 08/11] ice: Cleanup short function signatures Jeff Kirsher
2018-11-20 20:22 ` [net-next 09/11] ice: Cosmetic formatting changes Jeff Kirsher
2018-11-20 20:22 ` [net-next 10/11] ice: Use Tx|Rx in comments Jeff Kirsher
2018-11-20 20:22 ` [net-next 11/11] ice: Fix possible NULL pointer de-reference Jeff Kirsher
2018-11-21  4:59 ` [net-next 00/11][pull request] 100GbE Intel Wired LAN Driver Updates 2018-11-20 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181120202247.10743-2-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=akeem.g.abodunrin@intel.com \
    --cc=anirudh.venkataramanan@intel.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).