Skip to content

Commit 0bb7b09

Browse files
oleremkuba-moo
authored andcommitted
igb: extend PTP timestamp adjustments to i211
The i211 requires the same PTP timestamp adjustments as the i210, according to its datasheet. To ensure consistent timestamping across different platforms, this change extends the existing adjustments to include the i211. The adjustment result are tested and comparable for i210 and i211 based systems. Fixes: 3f544d2 ("igb: adjust PTP timestamps for Tx/Rx latency") Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Link: https://lore.kernel.org/r/20240227184942.362710-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 743ad09 commit 0bb7b09

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/net/ethernet/intel/igb/igb_ptp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)
957957

958958
igb_ptp_systim_to_hwtstamp(adapter, &shhwtstamps, regval);
959959
/* adjust timestamp for the TX latency based on link speed */
960-
if (adapter->hw.mac.type == e1000_i210) {
960+
if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) {
961961
switch (adapter->link_speed) {
962962
case SPEED_10:
963963
adjust = IGB_I210_TX_LATENCY_10;
@@ -1003,6 +1003,7 @@ int igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, void *va,
10031003
ktime_t *timestamp)
10041004
{
10051005
struct igb_adapter *adapter = q_vector->adapter;
1006+
struct e1000_hw *hw = &adapter->hw;
10061007
struct skb_shared_hwtstamps ts;
10071008
__le64 *regval = (__le64 *)va;
10081009
int adjust = 0;
@@ -1022,7 +1023,7 @@ int igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, void *va,
10221023
igb_ptp_systim_to_hwtstamp(adapter, &ts, le64_to_cpu(regval[1]));
10231024

10241025
/* adjust timestamp for the RX latency based on link speed */
1025-
if (adapter->hw.mac.type == e1000_i210) {
1026+
if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) {
10261027
switch (adapter->link_speed) {
10271028
case SPEED_10:
10281029
adjust = IGB_I210_RX_LATENCY_10;

0 commit comments

Comments
 (0)