On 11/29/2024 4:49 Willem de Bruijn wrote:

>> Add Rx timestamp function when the Rx timestamp value is read directly
>> from the Rx descriptor. In order to extend the Rx timestamp value to 64
>> bit in hot path, the PHC time is cached in the receive groups.
>> Add supported Rx timestamp modes.
>> 
>> Reviewed-by: Alexander Lobakin <[email protected]>
>> Signed-off-by: Milena Olech <[email protected]>
>> ---
>> v1 -> v2: extend commit message
>> 
>>  drivers/net/ethernet/intel/idpf/idpf_ptp.c  | 77 ++++++++++++++++++++-
>>  drivers/net/ethernet/intel/idpf/idpf_txrx.c | 30 ++++++++
>>  drivers/net/ethernet/intel/idpf/idpf_txrx.h |  7 +-
>>  3 files changed, 111 insertions(+), 3 deletions(-)
>> 
>> +/**
>> + * idpf_ptp_set_rx_tstamp - Enable or disable Rx timestamping
>> + * @vport: Virtual port structure
>> + * @rx_filter: bool value for whether timestamps are enabled or disabled
>> + */
>> +static void idpf_ptp_set_rx_tstamp(struct idpf_vport *vport, int rx_filter)
>> +{
>> +    vport->tstamp_config.rx_filter = rx_filter;
>> +
>> +    if (rx_filter == HWTSTAMP_FILTER_NONE)
>> +            return;
>> +
>
>Same question as v1:
>
>Should this clear the bit if it was previously set, instead of
>returning immediately?
>
>If not, why not. The function comment says enable or disable.
>

Will fix in v3.
I'll clear PTP bit when the rx_filter is equal to HWTSTAMP_FILTER_NONE.

>> +    for (u16 i = 0; i < vport->num_rxq_grp; i++) {
>> +            struct idpf_rxq_group *grp = &vport->rxq_grps[i];
>> +            u16 j;
>> +
>> +            if (idpf_is_queue_model_split(vport->rxq_model)) {
>> +                    for (j = 0; j < grp->singleq.num_rxq; j++)
>> +                            idpf_queue_set(PTP, grp->singleq.rxqs[j]);
>> +            } else {
>> +                    for (j = 0; j < grp->splitq.num_rxq_sets; j++)
>> +                            idpf_queue_set(PTP,
>> +                                           &grp->splitq.rxq_sets[j]->rxq);
>> +            }
>> +    }
>> +}

Regards,
Milena

Reply via email to