From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Jacob Keller <jacob.e.keller@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 15/17] i40e: when Rx timestamps disabled set specific mode
Date: Thu, 15 Jan 2015 04:19:26 -0800 [thread overview]
Message-ID: <1421324368-6860-16-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1421324368-6860-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jacob Keller <jacob.e.keller@intel.com>
Instead of leaving the Rx timestamps in the same mode as before if we
disable the Rx logic, we can set it into a mode that has the fewest
possible timestamps generated. To do this, select only V1 mode, but do
not enable UDP packet recognition. This should eliminate all (or at
least almost all) Rx timestamps, since V1 packets are always over UDP.
Change-ID: If847288e0030a716e059c4c33ab114f2cf038f05
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_ptp.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
index a55d47e..0fd5af8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -478,7 +478,12 @@ static int i40e_ptp_set_timestamp_mode(struct i40e_pf *pf,
switch (config->rx_filter) {
case HWTSTAMP_FILTER_NONE:
pf->ptp_rx = false;
- tsyntype = 0;
+ /* We set the type to V1, but do not enable UDP packet
+ * recognition. In this way, we should be as close to
+ * disabling PTP Rx timestamps as possible since V1 packets
+ * are always UDP, since L2 packets are a V2 feature.
+ */
+ tsyntype = I40E_PRTTSYN_CTL1_TSYNTYPE_V1;
break;
case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
@@ -532,17 +537,18 @@ static int i40e_ptp_set_timestamp_mode(struct i40e_pf *pf,
regval &= ~I40E_PFINT_ICR0_ENA_TIMESYNC_MASK;
wr32(hw, I40E_PFINT_ICR0_ENA, regval);
- /* There is no simple on/off switch for Rx. To "disable" Rx support,
- * ignore any received timestamps, rather than turn off the clock.
+ /* Although there is no simple on/off switch for Rx, we "disable" Rx
+ * timestamps by setting to V1 only mode and clear the UDP
+ * recognition. This ought to disable all PTP Rx timestamps as V1
+ * packets are always over UDP. Note that software is configured to
+ * ignore Rx timestamps via the pf->ptp_rx flag.
*/
- if (pf->ptp_rx) {
- regval = rd32(hw, I40E_PRTTSYN_CTL1);
- /* clear everything but the enable bit */
- regval &= I40E_PRTTSYN_CTL1_TSYNENA_MASK;
- /* now enable bits for desired Rx timestamps */
- regval |= tsyntype;
- wr32(hw, I40E_PRTTSYN_CTL1, regval);
- }
+ regval = rd32(hw, I40E_PRTTSYN_CTL1);
+ /* clear everything but the enable bit */
+ regval &= I40E_PRTTSYN_CTL1_TSYNENA_MASK;
+ /* now enable bits for desired Rx timestamps */
+ regval |= tsyntype;
+ wr32(hw, I40E_PRTTSYN_CTL1, regval);
return 0;
}
--
1.9.3
next prev parent reply other threads:[~2015-01-15 12:19 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-15 12:19 [net-next 00/17][pull request] Intel Wired LAN Driver Updates 2015-01-15 Jeff Kirsher
2015-01-15 12:19 ` [net-next 01/17] i40e/i40evf: AdminQ updates ww36 Jeff Kirsher
2015-01-15 12:19 ` [net-next 02/17] i40e/i40evf: Increase ASQ timeout Jeff Kirsher
2015-01-15 12:19 ` [net-next 03/17] i40e: fix proc/int descriptions Jeff Kirsher
2015-01-15 12:19 ` [net-next 04/17] i40e: don't give up on DCB error after reset Jeff Kirsher
2015-01-15 12:19 ` [net-next 05/17] i40e: Add define for interrupt name string len Jeff Kirsher
2015-01-15 12:19 ` [net-next 06/17] i40e: Dump Stats string removed from debugfs help command Jeff Kirsher
2015-01-15 12:19 ` [net-next 07/17] i40e/i40evf: Bump i40e/i40evf versions Jeff Kirsher
2015-01-15 12:19 ` [net-next 08/17] i40e: only enable PTP interrupt cause if PTP is enabled Jeff Kirsher
2015-01-15 12:19 ` [net-next 09/17] i40e: check I40E_FLAG_PTP before handling Tx or Rx timestamps Jeff Kirsher
2015-01-15 12:19 ` [net-next 10/17] i40e: clean up PTP log messages Jeff Kirsher
2015-01-15 12:34 ` David Laight
2015-01-15 15:01 ` Nelson, Shannon
2015-01-15 20:38 ` David Miller
2015-01-15 22:44 ` Nelson, Shannon
2015-01-15 23:12 ` David Miller
2015-01-15 12:19 ` [net-next 11/17] i40e: Issue "Stop LLDP" command for firmware older than v4.3 Jeff Kirsher
2015-01-15 12:19 ` [net-next 12/17] i40e: add more struct size checks Jeff Kirsher
2015-01-15 12:19 ` [net-next 13/17] i40e: AQ API updates for new commands Jeff Kirsher
2015-01-15 17:14 ` Or Gerlitz
2015-01-15 17:19 ` Nelson, Shannon
2015-01-15 18:04 ` Or Gerlitz
2015-01-15 12:19 ` [net-next 14/17] i40e: use same check for Rx hang as for Rx timestamps Jeff Kirsher
2015-01-15 12:19 ` Jeff Kirsher [this message]
2015-01-15 12:19 ` [net-next 16/17] i40e: Support for NPAR iSCSI partition with DCB Jeff Kirsher
2015-01-15 17:11 ` Or Gerlitz
2015-01-15 12:19 ` [net-next 17/17] i40e/i40evf: Bump i40e and i40evf versions 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=1421324368-6860-16-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=jacob.e.keller@intel.com \
--cc=jogreene@redhat.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).