Skip to contentSkip to conversation

igc: Fix igc_ptp_rx_pktstamp()

PATCH New Jithu Joseph 1 participant 1 message Mar 10, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v7 1/1 igc: Fix igc_ptp_rx_pktstamp()

From: Andre Guedes <[email protected]>

The comment describing the timestamps layout in the packet buffer is wrong and the code is actually retrieving the timestamp in Timer 1 reference instead of Timer 0. This hasn't been a big issue so far because hardware is configured to report both timestamps using Timer 0 (see IGC_SRRCTL register configuration in igc_ptp_enable_rx_timestamp() helper). This patch fixes the comment and the code so we retrieve the timestamp in Timer 0 reference as expected.

This patch also takes the opportunity to get rid of the hw.mac.type check since it is not required.

Fixes 81b055205e8ba ("igc: Add support for RX timestamping")

---
Changes in v7:
- Split this patch from the rest of the "igc: Add XDP support" series
https://patchwork.ozlabs.org/project/intel-wired-lan/cover/20210210215848.24514-1-vedang.patel at intel.com/ as the maintainer wants this patch to take a different upstream path
- Fix sparse warnings in igc_ptp_rx_pktstamp() by changing
the function parameter type from u32 *va to __le32 *va
- Added Tested-by: Dvora Fuxbrumer

---
 drivers/net/ethernet/intel/igc/igc.h     |  2 +-
 drivers/net/ethernet/intel/igc/igc_ptp.c | 72 +++++++++++++-----------
 2 files changed, 41 insertions(+), 33 deletions(-)
drivers/net/ethernet/intel/igc/igc.h +1 -1
index 5d2809dfd06a..1b08a7dc7bc4 100644
@@ -547,7 +547,7 @@ void igc_ptp_init(struct igc_adapter *adapter);
 void igc_ptp_reset(struct igc_adapter *adapter);
 void igc_ptp_suspend(struct igc_adapter *adapter);
 void igc_ptp_stop(struct igc_adapter *adapter);
-void igc_ptp_rx_pktstamp(struct igc_q_vector *q_vector, void *va,
+void igc_ptp_rx_pktstamp(struct igc_q_vector *q_vector, __le32 *va,
 			 struct sk_buff *skb);
 int igc_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr);
 int igc_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr);
drivers/net/ethernet/intel/igc/igc_ptp.c +40 -32

86 lines not on this page · raw message

base-commit: 86ce6656ac13cf8448cf90550fcdaba8b708aade

Signature · 1 line
2.17.1