Subject: Re: [PATCH net 2/4] igc: Check if hardware TX timestamping is enabled earlier

From: Vinicius Costa Gomes <[email-masked]>
Date: Thu, 01 Jun 2023 14:21:35 -0700

Hi,

Jakub Kicinski <[email-masked]> writes:

> On Tue, 30 May 2023 10:49:26 -0700 Tony Nguyen wrote:
>> -	if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
>> +	if (unlikely(adapter->tstamp_config.tx_type == HWTSTAMP_TX_ON &&
>> +		     skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
>>  		/* FIXME: add support for retrieving timestamps from
>>  		 * the other timer registers before skipping the
>>  		 * timestamping request.
>> @@ -1586,7 +1587,7 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
>>  		unsigned long flags;
>>  
>>  		spin_lock_irqsave(&adapter->ptp_tx_lock, flags);
>> -		if (adapter->tstamp_config.tx_type == HWTSTAMP_TX_ON && !adapter->ptp_tx_skb) {
>> +		if (!adapter->ptp_tx_skb) {
>
> AFAICT the cancel / cleanup path is not synchronized (I mean for
> accesses to adapter->tstamp_config) so this looks racy to me :(
>

As far as I can see, the racy behavior wasn't introduced here, can I
propose the fix as a follow up patch? Or do you prefer that I re-spin
this series?

Cheers,
-- 
Vinicius