From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Yusuke Suzuki <yus-suzuki@uf.jp.nec.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, guru.anbalagane@oracle.com,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 13/21] ixgbe: Fix incorrect bitwise operations of PTP Rx timestamp flags
Date: Fri, 30 Dec 2016 01:33:33 -0800 [thread overview]
Message-ID: <20161230093341.14674-14-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20161230093341.14674-1-jeffrey.t.kirsher@intel.com>
From: Yusuke Suzuki <yus-suzuki@uf.jp.nec.com>
Rx timestamp does not work on 82599 and X540 because bitwise operation
of RX_HWTSTAMP flags is incorrect and ixgbe_ptp_rx_hwtstamp() is never
called. This patch fixes it to enable Rx timestamp on 82599 and X540.
Without this fix:
ptp4l[278.730]: selected /dev/ptp8 as PTP clock
ptp4l[278.733]: port 1: INITIALIZING to LISTENING on INITIALIZE
ptp4l[278.733]: port 0: INITIALIZING to LISTENING on INITIALIZE
ptp4l[278.834]: port 1: received SYNC without timestamp
ptp4l[278.835]: port 1: new foreign master 1c3947.fffe.60f9cc-1
ptp4l[279.834]: port 1: received SYNC without timestamp
ptp4l[280.834]: port 1: received SYNC without timestamp
ptp4l[281.834]: port 1: received SYNC without timestamp
ptp4l[282.834]: port 1: received SYNC without timestamp
ptp4l[282.835]: selected best master clock 1c3947.fffe.60f9cc
ptp4l[282.835]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE
ptp4l[283.834]: port 1: received SYNC without timestamp
With this fix:
ptp4l[239.154]: selected /dev/ptp8 as PTP clock
ptp4l[239.157]: port 1: INITIALIZING to LISTENING on INITIALIZE
ptp4l[239.157]: port 0: INITIALIZING to LISTENING on INITIALIZE
ptp4l[240.989]: port 1: new foreign master 1c3947.fffe.60f9cc-1
ptp4l[244.989]: selected best master clock 1c3947.fffe.60f9cc
ptp4l[244.989]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE
ptp4l[246.977]: master offset -899583339542096 s0 freq +0 path delay 16222
ptp4l[247.977]: master offset -899583339617265 s1 freq -75169 path delay 16177
ptp4l[248.977]: master offset -130 s2 freq -75299 path delay 16177
ptp4l[248.977]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
ptp4l[249.977]: master offset -9 s2 freq -75217 path delay 16177
ptp4l[250.977]: master offset 88 s2 freq -75123 path delay 16132
Fixes: a9763f3cb54c ("ixgbe: Update PTP to support X550EM_x devices")
Signed-off-by: Yusuke Suzuki <yus-suzuki@uf.jp.nec.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index 1efb404..ef0635e 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -858,14 +858,14 @@ static int ixgbe_ptp_set_timestamp_mode(struct ixgbe_adapter *adapter,
case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
tsync_rx_ctl |= IXGBE_TSYNCRXCTL_TYPE_L4_V1;
tsync_rx_mtrl |= IXGBE_RXMTRL_V1_SYNC_MSG;
- adapter->flags &= ~(IXGBE_FLAG_RX_HWTSTAMP_ENABLED |
- IXGBE_FLAG_RX_HWTSTAMP_IN_REGISTER);
+ adapter->flags |= (IXGBE_FLAG_RX_HWTSTAMP_ENABLED |
+ IXGBE_FLAG_RX_HWTSTAMP_IN_REGISTER);
break;
case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
tsync_rx_ctl |= IXGBE_TSYNCRXCTL_TYPE_L4_V1;
tsync_rx_mtrl |= IXGBE_RXMTRL_V1_DELAY_REQ_MSG;
- adapter->flags &= ~(IXGBE_FLAG_RX_HWTSTAMP_ENABLED |
- IXGBE_FLAG_RX_HWTSTAMP_IN_REGISTER);
+ adapter->flags |= (IXGBE_FLAG_RX_HWTSTAMP_ENABLED |
+ IXGBE_FLAG_RX_HWTSTAMP_IN_REGISTER);
break;
case HWTSTAMP_FILTER_PTP_V2_EVENT:
case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
@@ -879,8 +879,8 @@ static int ixgbe_ptp_set_timestamp_mode(struct ixgbe_adapter *adapter,
tsync_rx_ctl |= IXGBE_TSYNCRXCTL_TYPE_EVENT_V2;
is_l2 = true;
config->rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
- adapter->flags &= ~(IXGBE_FLAG_RX_HWTSTAMP_ENABLED |
- IXGBE_FLAG_RX_HWTSTAMP_IN_REGISTER);
+ adapter->flags |= (IXGBE_FLAG_RX_HWTSTAMP_ENABLED |
+ IXGBE_FLAG_RX_HWTSTAMP_IN_REGISTER);
break;
case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
case HWTSTAMP_FILTER_ALL:
--
2.9.3
next prev parent reply other threads:[~2016-12-30 9:33 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-30 9:33 [net-next 00/21][pull request] 10GbE Intel Wired LAN Driver Updates 2016-12-29 Jeff Kirsher
2016-12-30 9:33 ` [net-next 01/21] ixgbe: do not disable FEC from the driver Jeff Kirsher
2016-12-30 9:33 ` [net-next 02/21] ixgbe: Report driver version to firmware for x550 devices Jeff Kirsher
2016-12-30 9:33 ` [net-next 03/21] ixgbe: Fix check for ixgbe_phy_x550em_ext_t reset Jeff Kirsher
2016-12-30 9:33 ` [net-next 04/21] ixgbe: add mask for 64 RSS queues Jeff Kirsher
2016-12-30 9:33 ` [net-next 05/21] ixgbe: Add bounds check for x540 LED functions Jeff Kirsher
2016-12-30 9:33 ` [net-next 06/21] ixgbe: Reduce I2C retry count on X550 devices Jeff Kirsher
2016-12-30 9:33 ` [net-next 07/21] ixgbe: Fix reporting of 100Mb capability Jeff Kirsher
2016-12-30 9:33 ` [net-next 08/21] ixgbe: handle close/suspend race with netif_device_detach/present Jeff Kirsher
2016-12-30 9:33 ` [net-next 09/21] ixgbevf: handle race between close and suspend on shutdown Jeff Kirsher
2016-12-30 9:33 ` [net-next 10/21] ixgbe: test for trust in macvlan adjustments for VF Jeff Kirsher
2016-12-30 9:33 ` [net-next 11/21] ixgbe: fix AER error handling Jeff Kirsher
2016-12-30 9:33 ` [net-next 12/21] ixgbevf: " Jeff Kirsher
2016-12-30 10:38 ` Sergei Shtylyov
2016-12-30 9:33 ` Jeff Kirsher [this message]
2016-12-30 9:33 ` [net-next 14/21] ixgbevf: restore hw_addr on resume or error Jeff Kirsher
2016-12-30 9:33 ` [net-next 15/21] ixgbe: Configure advertised speeds correctly for KR/KX backplane Jeff Kirsher
2016-12-30 11:01 ` Sergei Shtylyov
2016-12-30 13:01 ` Rosen, Rami
2016-12-30 9:33 ` [net-next 16/21] ixgbe: Fix issues with EEPROM access Jeff Kirsher
2016-12-30 9:33 ` [net-next 17/21] ixgbe: Remove unused firmware version functions and method Jeff Kirsher
2016-12-30 9:33 ` [net-next 18/21] ixgbe: Implement firmware interface to access some PHYs Jeff Kirsher
2016-12-30 9:33 ` [net-next 19/21] ixgbe: Implement support for firmware-controlled PHYs Jeff Kirsher
2016-12-30 9:33 ` [net-next 20/21] ixgbevf: Add support for VF promiscuous mode Jeff Kirsher
2016-12-30 9:33 ` [net-next 21/21] ixgbe: Add PF " 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=20161230093341.14674-14-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=guru.anbalagane@oracle.com \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
--cc=yus-suzuki@uf.jp.nec.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).