Subject: Re: [Intel-wired-lan] [PATCH iwl-next v5 02/12] ice: support Rx timestamp on flex descriptor

From: Rahul Rameshbabu <[email-masked]>
Date: Thu, 18 Apr 2024 11:57:04 -0700

On Thu, 18 Apr, 2024 01:24:50 -0400 Mateusz Polchlopek <[email-masked]> wrote:
> From: Simei Su <[email-masked]>
>
> To support Rx timestamp offload, VIRTCHNL_OP_1588_PTP_CAPS is sent by
> the VF to request PTP capability and responded by the PF what capability
> is enabled for that VF.
>
> Hardware captures timestamps which contain only 32 bits of nominal
> nanoseconds, as opposed to the 64bit timestamps that the stack expects.
> To convert 32b to 64b, we need a current PHC time.
> VIRTCHNL_OP_1588_PTP_GET_TIME is sent by the VF and responded by the
> PF with the current PHC time.
>
> Reviewed-by: Wojciech Drewek <[email-masked]>
> Signed-off-by: Simei Su <[email-masked]>
> Co-developed-by: Mateusz Polchlopek <[email-masked]>
> Signed-off-by: Mateusz Polchlopek <[email-masked]>
> ---
<snip>
> @@ -1779,9 +1782,17 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
>  				rxdid = ICE_RXDID_LEGACY_1;
>  			}
>  
> -			ice_write_qrxflxp_cntxt(&vsi->back->hw,
> -						vsi->rxq_map[q_idx],
> -						rxdid, 0x03, false);
> +			if (vf->driver_caps &
> +			    VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC &&
> +			    vf->driver_caps & VIRTCHNL_VF_CAP_PTP &&
> +			    qpi->rxq.flags & VIRTCHNL_PTP_RX_TSTAMP)

Just a general suggestion, any reason we cannot use test_bit, set_bit,
clear_bit, etc for these flags?

> +				ice_write_qrxflxp_cntxt(&vsi->back->hw,
> +							vsi->rxq_map[q_idx],
> +							rxdid, 0x03, true);
> +			else
> +				ice_write_qrxflxp_cntxt(&vsi->back->hw,
> +							vsi->rxq_map[q_idx],
> +							rxdid, 0x03, false);
>  		}
>  	}
>  
<snip>

--
Thanks,

Rahul Rameshbabu