On 7/18/2024 3:52 AM, Sergey Temerkhanov wrote:
Use struct ice_adapter to hold shared PTP data and control PTP
related actions instead of auxbus. This allows significant code
simplification and faster access to the container fields used in
the PTP support code.

Move the PTP port list to the ice_adapter container to simplify
the code and avoid race conditions which could occur due to the
synchronous nature of the initialization/access and
certain memory saving can be achieved by moving PTP data into
the ice_adapter itself.

Signed-off-by: Sergey Temerkhanov <[email protected]>
Reviewed-by: Przemek Kitszel <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
---

...

@@ -2967,6 +2967,50 @@ void ice_ptp_rebuild(struct ice_pf *pf, enum 
ice_reset_req reset_type)
        dev_err(ice_pf_to_dev(pf), "PTP reset failed %d\n", err);
  }
+static inline bool ice_is_primary(struct ice_hw *hw)

no 'inline' for c files please.

+{
+       return ice_is_e825c(hw) && ice_is_dual(hw) ?
+               !!(hw->dev_caps.nac_topo.mode & ICE_NAC_TOPO_PRIMARY_M) : true;
+}
+

...

--- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.h
+++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.h
@@ -468,6 +468,11 @@ static inline u64 ice_get_base_incval(struct ice_hw *hw)
        }
  }
+static inline bool ice_is_dual(struct ice_hw *hw)
+{
+        return !!(hw->dev_caps.nac_topo.mode & ICE_NAC_TOPO_DUAL_M);
+}

Please use tabs:

ERROR: code indent should use tabs where possible
#408: FILE: drivers/net/ethernet/intel/ice/ice_ptp_hw.h:473:
+        return !!(hw->dev_caps.nac_topo.mode & ICE_NAC_TOPO_DUAL_M);$

WARNING: please, no spaces at the start of a line
#408: FILE: drivers/net/ethernet/intel/ice/ice_ptp_hw.h:473:
+        return !!(hw->dev_caps.nac_topo.mode & ICE_NAC_TOPO_DUAL_M);$

Thanks,
Tony

+
  #define PFTSYN_SEM_BYTES      4
#define ICE_PTP_CLOCK_INDEX_0 0x00

Reply via email to