From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Mark Rustad <mark.d.rustad@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/18] ixgbe: Limit SFP polling rate
Date: Wed, 23 Sep 2015 23:59:30 -0700 [thread overview]
Message-ID: <1443077981-55791-8-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1443077981-55791-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Mark Rustad <mark.d.rustad@intel.com>
Reduce the frequency of polling for SFP modules. Because the
service task sometimes runs at high rates, we can poll for
SFPs too often. When an SFP is not present, the I2C timeouts
that result are very costly. So, prevent SFP polling from
being done more than once every two seconds. To reduce latency,
the poll time is cleared in a couple of cases to permit the
next service task execution to poll the SFP module.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 2 ++
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index a699c99..dda0f67 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -594,6 +594,7 @@ struct ixgbe_mac_addr {
/* default to trying for four seconds */
#define IXGBE_TRY_LINK_TIMEOUT (4 * HZ)
+#define IXGBE_SFP_POLL_JIFFIES (2 * HZ) /* SFP poll every 2 seconds */
/* board specific private data structure */
struct ixgbe_adapter {
@@ -707,6 +708,7 @@ struct ixgbe_adapter {
u32 link_speed;
bool link_up;
+ unsigned long sfp_poll_time;
unsigned long link_check_timeout;
struct timer_list service_timer;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 369204c..9986be5 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -2509,6 +2509,7 @@ static void ixgbe_check_sfp_event(struct ixgbe_adapter *adapter, u32 eicr)
IXGBE_WRITE_REG(hw, IXGBE_EICR, eicr_mask);
if (!test_bit(__IXGBE_DOWN, &adapter->state)) {
adapter->flags2 |= IXGBE_FLAG2_SFP_NEEDS_RESET;
+ adapter->sfp_poll_time = 0;
ixgbe_service_event_schedule(adapter);
}
}
@@ -4804,6 +4805,7 @@ static void ixgbe_sfp_link_config(struct ixgbe_adapter *adapter)
adapter->flags2 |= IXGBE_FLAG2_SEARCH_FOR_SFP;
adapter->flags2 |= IXGBE_FLAG2_SFP_NEEDS_RESET;
+ adapter->sfp_poll_time = 0;
}
/**
@@ -6709,10 +6711,16 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
!(adapter->flags2 & IXGBE_FLAG2_SFP_NEEDS_RESET))
return;
+ if (adapter->sfp_poll_time &&
+ time_after(adapter->sfp_poll_time, jiffies))
+ return; /* If not yet time to poll for SFP */
+
/* someone else is in init, wait until next service event */
if (test_and_set_bit(__IXGBE_IN_SFP_INIT, &adapter->state))
return;
+ adapter->sfp_poll_time = jiffies + IXGBE_SFP_POLL_JIFFIES - 1;
+
err = hw->phy.ops.identify_sfp(hw);
if (err == IXGBE_ERR_SFP_NOT_SUPPORTED)
goto sfp_out;
--
2.4.3
next prev parent reply other threads:[~2015-09-24 6:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-24 6:59 [net-next 00/18][pull request] Intel Wired LAN Driver Updates 2015-09-23 Jeff Kirsher
2015-09-24 6:59 ` [net-next 01/18] ixgbe: Clear I2C destination location Jeff Kirsher
2015-09-24 6:59 ` [net-next 02/18] ixgbe: Allow reduced delays during SFP detection Jeff Kirsher
2015-09-24 6:59 ` [net-next 03/18] ixgbe: Add X550EM_x dual-speed SFP+ support Jeff Kirsher
2015-09-24 6:59 ` [net-next 04/18] ixgbe: Fix 1G and 10G link stability for X550EM_x SFP+ Jeff Kirsher
2015-09-24 6:59 ` [net-next 05/18] ixgbe: Add logic to reset CS4227 when needed Jeff Kirsher
2015-09-24 6:59 ` [net-next 06/18] ixgbe: Allow SFP+ on more than 82598 and 82599 Jeff Kirsher
2015-09-24 6:59 ` Jeff Kirsher [this message]
2015-09-24 6:59 ` [net-next 08/18] ixgbe: Add I2C bus mux support Jeff Kirsher
2015-09-24 6:59 ` [net-next 09/18] ixgbe: Correct error path in semaphore handling Jeff Kirsher
2015-09-24 6:59 ` [net-next 10/18] ixgbe: Correct setting of RDRXCTL register for X550* devices Jeff Kirsher
2015-09-24 6:59 ` [net-next 11/18] ixgbe: Add small packet padding support for X550 Jeff Kirsher
2015-09-24 6:59 ` [net-next 12/18] ixgbe: Update ixgbe_disable_pcie_master flow for X550* Jeff Kirsher
2015-09-24 6:59 ` [net-next 13/18] ixgbe: Add new X550EM SFP+ device ID Jeff Kirsher
2015-09-24 6:59 ` [net-next 14/18] ixgbe: Correct several flaws with with DCA setup Jeff Kirsher
2015-09-24 6:59 ` [net-next 15/18] ixgbe: Only clear adapter_stopped if ixgbe_setup_fc succeeded Jeff Kirsher
2015-09-24 6:59 ` [net-next 16/18] ixgbe: Fix FCRTH value in VM-to-VM loopback mode Jeff Kirsher
2015-09-24 6:59 ` [net-next 17/18] ixgbe: X540 thermal warning interrupt not a GPI Jeff Kirsher
2015-09-24 6:59 ` [net-next 18/18] ixgbe: Advance version to 4.2.1 Jeff Kirsher
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=1443077981-55791-8-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=jogreene@redhat.com \
--cc=mark.d.rustad@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).