[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241115134502.GQ1062410@kernel.org>
Date: Fri, 15 Nov 2024 13:45:02 +0000
From: Simon Horman <horms@...nel.org>
To: Milena Olech <milena.olech@...el.com>
Cc: intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
anthony.l.nguyen@...el.com, przemyslaw.kitszel@...el.com,
Emil Tantilov <emil.s.tantilov@...el.com>,
Pavan Kumar Linga <pavan.kumar.linga@...el.com>,
Alexander Lobakin <aleksander.lobakin@...el.com>
Subject: Re: [PATCH iwl-net 07/10] idpf: add Tx timestamp capabilities
negotiation
On Wed, Nov 13, 2024 at 04:46:19PM +0100, Milena Olech wrote:
> Tx timestamp capabilities are negotiated for the uplink Vport.
> Driver receives information about the number of available Tx timestamp
> latches, the size of Tx timestamp value and the set of indexes used
> for Tx timestamping.
>
> Add function to get the Tx timestamp capabilities and parse the uplink
> vport flag.
>
> Co-developed-by: Emil Tantilov <emil.s.tantilov@...el.com>
> Signed-off-by: Emil Tantilov <emil.s.tantilov@...el.com>
> Co-developed-by: Pavan Kumar Linga <pavan.kumar.linga@...el.com>
> Signed-off-by: Pavan Kumar Linga <pavan.kumar.linga@...el.com>
> Reviewed-by: Alexander Lobakin <aleksander.lobakin@...el.com>
> Signed-off-by: Milena Olech <milena.olech@...el.com>
...
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl_ptp.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl_ptp.c
...
> +/**
> + * idpf_ptp_get_vport_tstamps_caps - Send virtchnl to get tstamps caps for vport
> + * @vport: Virtual port structure
> + *
> + * Send virtchnl get vport tstamps caps message to receive the set of tstamp
> + * capabilities per vport.
> + *
> + * Return: 0 on success, -errno otherwise.
> + */
> +int idpf_ptp_get_vport_tstamps_caps(struct idpf_vport *vport)
...
> + for (u16 i = 0; i < tstamp_caps->num_entries; i++) {
> + u32 offset_l, offset_h;
It looks like the type of offset_l and offset_h should be __le32
to match the values that are stored in them.
Flagged by Sparse.
> +
> + ptp_tx_tstamp = ptp_tx_tstamps + i;
> + tx_tstamp_latch_caps = rcv_tx_tstamp_caps->tstamp_latches[i];
> +
> + if (tstamp_access != IDPF_PTP_DIRECT)
> + goto skip_offsets;
> +
> + offset_l = tx_tstamp_latch_caps.tx_latch_reg_offset_l;
> + offset_h = tx_tstamp_latch_caps.tx_latch_reg_offset_h;
> + ptp_tx_tstamp->tx_latch_reg_offset_l = le32_to_cpu(offset_l);
> + ptp_tx_tstamp->tx_latch_reg_offset_h = le32_to_cpu(offset_h);
> +
> +skip_offsets:
> + ptp_tx_tstamp->idx = tx_tstamp_latch_caps.index;
> +
> + list_add(&ptp_tx_tstamp->list_member,
> + &tstamp_caps->latches_free);
> +
> + tstamp_caps->tx_tstamp_status[i].state = IDPF_PTP_FREE;
> + }
...
Powered by blists - more mailing lists