]> git.hungrycats.org Git - linux/commitdiff
igb: extend PTP timestamp adjustments to i211
authorOleksij Rempel <o.rempel@pengutronix.de>
Tue, 27 Feb 2024 18:49:41 +0000 (10:49 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2024 14:38:46 +0000 (14:38 +0000)
[ Upstream commit 0bb7b09392eb74b152719ae87b1ba5e4bf910ef0 ]

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: 3f544d2a4d5c ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/igb/igb_ptp.c

index 9cdb7a856ab6cfc2f7e9633329b20b0118fe8038..1a1575e8577af30c4b4d26f94569f1f0477ce52f 100644 (file)
@@ -826,7 +826,7 @@ static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)
 
        igb_ptp_systim_to_hwtstamp(adapter, &shhwtstamps, regval);
        /* adjust timestamp for the TX latency based on link speed */
-       if (adapter->hw.mac.type == e1000_i210) {
+       if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) {
                switch (adapter->link_speed) {
                case SPEED_10:
                        adjust = IGB_I210_TX_LATENCY_10;
@@ -872,6 +872,7 @@ int igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, void *va,
                        ktime_t *timestamp)
 {
        struct igb_adapter *adapter = q_vector->adapter;
+       struct e1000_hw *hw = &adapter->hw;
        struct skb_shared_hwtstamps ts;
        __le64 *regval = (__le64 *)va;
        int adjust = 0;
@@ -891,7 +892,7 @@ int igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, void *va,
        igb_ptp_systim_to_hwtstamp(adapter, &ts, le64_to_cpu(regval[1]));
 
        /* adjust timestamp for the RX latency based on link speed */
-       if (adapter->hw.mac.type == e1000_i210) {
+       if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) {
                switch (adapter->link_speed) {
                case SPEED_10:
                        adjust = IGB_I210_RX_LATENCY_10;