netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Matt Jared <matthew.a.jared@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 07/16] i40e: Fix multiple link up messages
Date: Thu,  8 Oct 2015 18:32:45 -0700	[thread overview]
Message-ID: <1444354374-24351-8-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1444354374-24351-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Matt Jared <matthew.a.jared@intel.com>

This patch addresses an issue where multiple link up messages can be logged
resulting from aq link status timing when link properties are changed (fc,
speed, etc.); solved by using a single function to handle status printing
and adding a mechanism to track whether link state (up or down) has
actually changed.

Change-ID: Ied6ed6e49dc397c77d992adc0bc9ed3767152b9d
Signed-off-by: Matt Jared <matthew.a.jared@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e.h         | 2 ++
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 4 ++--
 drivers/net/ethernet/intel/i40e/i40e_main.c    | 5 ++++-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index a662e39..0c73404 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -537,6 +537,7 @@ struct i40e_vsi {
 	u16 idx;               /* index in pf->vsi[] */
 	u16 veb_idx;           /* index of VEB parent */
 	struct kobject *kobj;  /* sysfs object */
+	bool current_isup;     /* Sync 'link up' logging */
 
 	/* VSI specific handlers */
 	irqreturn_t (*irq_handler)(int irq, void *data);
@@ -791,4 +792,5 @@ int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi *vsi);
 i40e_status i40e_get_npar_bw_setting(struct i40e_pf *pf);
 i40e_status i40e_set_npar_bw_setting(struct i40e_pf *pf);
 i40e_status i40e_commit_npar_bw_setting(struct i40e_pf *pf);
+void i40e_print_link_message(struct i40e_vsi *vsi, bool isup);
 #endif /* _I40E_H_ */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index ef471fc..f2b4f8b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -690,7 +690,7 @@ static int i40e_set_settings(struct net_device *netdev,
 			/* Tell the OS link is going down, the link will go
 			 * back up when fw says it is ready asynchronously
 			 */
-			netdev_info(netdev, "PHY settings change requested, NIC Link is going down.\n");
+			i40e_print_link_message(vsi, false);
 			netif_carrier_off(netdev);
 			netif_tx_stop_all_queues(netdev);
 		}
@@ -834,7 +834,7 @@ static int i40e_set_pauseparam(struct net_device *netdev,
 	/* Tell the OS link is going down, the link will go back up when fw
 	 * says it is ready asynchronously
 	 */
-	netdev_info(netdev, "Flow control settings change requested, NIC Link is going down.\n");
+	i40e_print_link_message(vsi, false);
 	netif_carrier_off(netdev);
 	netif_tx_stop_all_queues(netdev);
 
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 94953568..e05e6aa 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4837,11 +4837,14 @@ out:
  * i40e_print_link_message - print link up or down
  * @vsi: the VSI for which link needs a message
  */
-static void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
+void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
 {
 	char speed[SPEED_SIZE] = "Unknown";
 	char fc[FC_SIZE] = "RX/TX";
 
+	if (vsi->current_isup == isup)
+		return;
+	vsi->current_isup = isup;
 	if (!isup) {
 		netdev_info(vsi->netdev, "NIC Link is Down\n");
 		return;
-- 
2.4.3

  parent reply	other threads:[~2015-10-09  1:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09  1:32 [net-next 00/16][pull request] Intel Wired LAN Driver Updates 2015-10-08 Jeff Kirsher
2015-10-09  1:32 ` [net-next 01/16] i40e: fix erroneous WARN_ON Jeff Kirsher
2015-10-09  1:32 ` [net-next 02/16] i40e: inline interrupt enable Jeff Kirsher
2015-10-09  1:32 ` [net-next 03/16] i40e: add more verbose error messages Jeff Kirsher
2015-10-09  1:32 ` [net-next 04/16] i40e: Add parsing for CEE DCBX TLVs Jeff Kirsher
2015-10-09  1:32 ` [net-next 05/16] i40e/i40evf: Store CEE DCBX DesiredCfg and RemoteCfg Jeff Kirsher
2015-10-09  1:32 ` [net-next 06/16] i40e: Fix for extra Flow Director filter in table after error Jeff Kirsher
2015-10-09  1:32 ` Jeff Kirsher [this message]
2015-10-09  1:32 ` [net-next 08/16] i40e: add switch for link polling Jeff Kirsher
2015-10-09  1:32 ` [net-next 09/16] i40e/i40evf: Explicitly assign enum index for VSI type Jeff Kirsher
2015-10-09  1:32 ` [net-next 10/16] i40e: Support FW CEE DCB UP to TC map nibble swap Jeff Kirsher
2015-10-09  1:32 ` [net-next 11/16] i40evf: detect reset more reliably Jeff Kirsher
2015-10-09  1:32 ` [net-next 12/16] i40e/i40evf: clean up some code Jeff Kirsher
2015-10-09  1:32 ` [net-next 13/16] i40e: refactor code to remove indent Jeff Kirsher
2015-10-09  1:32 ` [net-next 14/16] i40evf: use capabilities flags properly Jeff Kirsher
2015-10-09  1:32 ` [net-next 15/16] i40e/i40evf: pass QOS handle to VF Jeff Kirsher
2015-10-09  1:32 ` [net-next 16/16] i40e: print neato new features Jeff Kirsher
2015-10-09 14:23 ` [net-next 00/16][pull request] Intel Wired LAN Driver Updates 2015-10-08 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=1444354374-24351-8-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=jogreene@redhat.com \
    --cc=matthew.a.jared@intel.com \
    --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).