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.tanti...@intel.com> > Signed-off-by: Emil Tantilov <emil.s.tanti...@intel.com> > Co-developed-by: Pavan Kumar Linga <pavan.kumar.li...@intel.com> > Signed-off-by: Pavan Kumar Linga <pavan.kumar.li...@intel.com> > Reviewed-by: Alexander Lobakin <aleksander.loba...@intel.com> > Signed-off-by: Milena Olech <milena.ol...@intel.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; > + } ...