netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Piotr Kwapulinski <piotr.kwapulinski@intel.com>,
	intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, richardcochran@gmail.com,
	Milena Olech <milena.olech@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>
Subject: Re: [PATCH iwl-next] ixgbe: add PTP support for E610 device
Date: Tue, 4 Feb 2025 18:42:37 +0000	[thread overview]
Message-ID: <3f0b9a34-db37-4cd5-ae4a-bdc2855dfb72@linux.dev> (raw)
In-Reply-To: <20250204071259.15510-1-piotr.kwapulinski@intel.com>

On 04/02/2025 07:12, Piotr Kwapulinski wrote:
> Add PTP support for E610 adapter. The E610 is based on X550 and adds
> firmware managed link, enhanced security capabilities and support for
> updated server manageability. It does not introduce any new PTP features
> compared to X550.
> 
> Reviewed-by: Milena Olech <milena.olech@intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
> ---
>   drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c |  1 +
>   drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c     | 13 +++++++++++--
>   2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
> index da91c58..f03925c 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
> @@ -3185,6 +3185,7 @@ static int ixgbe_get_ts_info(struct net_device *dev,
>   	case ixgbe_mac_X550:
>   	case ixgbe_mac_X550EM_x:
>   	case ixgbe_mac_x550em_a:
> +	case ixgbe_mac_e610:
>   		info->rx_filters |= BIT(HWTSTAMP_FILTER_ALL);
>   		break;
>   	case ixgbe_mac_X540:
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
> index 9339edb..eef25e1 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
> @@ -140,6 +140,7 @@
>    * proper mult and shift to convert the cycles into nanoseconds of time.
>    */
>   #define IXGBE_X550_BASE_PERIOD 0xC80000000ULL
> +#define IXGBE_E610_BASE_PERIOD 0x333333333ULL
>   #define INCVALUE_MASK	0x7FFFFFFF
>   #define ISGN		0x80000000
>   
> @@ -415,6 +416,7 @@ static void ixgbe_ptp_convert_to_hwtstamp(struct ixgbe_adapter *adapter,
>   	case ixgbe_mac_X550:
>   	case ixgbe_mac_X550EM_x:
>   	case ixgbe_mac_x550em_a:
> +	case ixgbe_mac_e610:
>   		/* Upper 32 bits represent billions of cycles, lower 32 bits
>   		 * represent cycles. However, we use timespec64_to_ns for the
>   		 * correct math even though the units haven't been corrected
> @@ -492,11 +494,13 @@ static int ixgbe_ptp_adjfine_X550(struct ptp_clock_info *ptp, long scaled_ppm)
>   	struct ixgbe_adapter *adapter =
>   			container_of(ptp, struct ixgbe_adapter, ptp_caps);
>   	struct ixgbe_hw *hw = &adapter->hw;
> +	u64 rate, base;
>   	bool neg_adj;
> -	u64 rate;
>   	u32 inca;
>   
> -	neg_adj = diff_by_scaled_ppm(IXGBE_X550_BASE_PERIOD, scaled_ppm, &rate);
> +	base = hw->mac.type == ixgbe_mac_e610 ? IXGBE_E610_BASE_PERIOD :
> +						IXGBE_X550_BASE_PERIOD;
> +	neg_adj = diff_by_scaled_ppm(base, scaled_ppm, &rate);
>   
>   	/* warn if rate is too large */
>   	if (rate >= INCVALUE_MASK)
> @@ -559,6 +563,7 @@ static int ixgbe_ptp_gettimex(struct ptp_clock_info *ptp,
>   	case ixgbe_mac_X550:
>   	case ixgbe_mac_X550EM_x:
>   	case ixgbe_mac_x550em_a:
> +	case ixgbe_mac_e610:
>   		/* Upper 32 bits represent billions of cycles, lower 32 bits
>   		 * represent cycles. However, we use timespec64_to_ns for the
>   		 * correct math even though the units haven't been corrected
> @@ -1067,6 +1072,7 @@ static int ixgbe_ptp_set_timestamp_mode(struct ixgbe_adapter *adapter,
>   	case ixgbe_mac_X550:
>   	case ixgbe_mac_X550EM_x:
>   	case ixgbe_mac_x550em_a:
> +	case ixgbe_mac_e610:
>   		/* enable timestamping all packets only if at least some
>   		 * packets were requested. Otherwise, play nice and disable
>   		 * timestamping
> @@ -1233,6 +1239,7 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
>   		fallthrough;
>   	case ixgbe_mac_x550em_a:
>   	case ixgbe_mac_X550:
> +	case ixgbe_mac_e610:
>   		cc.read = ixgbe_ptp_read_X550;
>   		break;
>   	case ixgbe_mac_X540:
> @@ -1280,6 +1287,7 @@ static void ixgbe_ptp_init_systime(struct ixgbe_adapter *adapter)
>   	case ixgbe_mac_X550EM_x:
>   	case ixgbe_mac_x550em_a:
>   	case ixgbe_mac_X550:
> +	case ixgbe_mac_e610:
>   		tsauxc = IXGBE_READ_REG(hw, IXGBE_TSAUXC);
>   
>   		/* Reset SYSTIME registers to 0 */
> @@ -1407,6 +1415,7 @@ static long ixgbe_ptp_create_clock(struct ixgbe_adapter *adapter)
>   	case ixgbe_mac_X550:
>   	case ixgbe_mac_X550EM_x:
>   	case ixgbe_mac_x550em_a:
> +	case ixgbe_mac_e610:
>   		snprintf(adapter->ptp_caps.name, 16, "%s", netdev->name);
>   		adapter->ptp_caps.owner = THIS_MODULE;
>   		adapter->ptp_caps.max_adj = 30000000;


LGTM,
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>

  parent reply	other threads:[~2025-02-04 18:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04  7:12 [PATCH iwl-next] ixgbe: add PTP support for E610 device Piotr Kwapulinski
2025-02-04 13:37 ` Simon Horman
2025-02-04 18:42 ` Vadim Fedorenko [this message]
2025-02-11 12:44 ` [Intel-wired-lan] " R, Bharath

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=3f0b9a34-db37-4cd5-ae4a-bdc2855dfb72@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=milena.olech@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=piotr.kwapulinski@intel.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=richardcochran@gmail.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).