From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F1C0A94A for ; Thu, 1 Jun 2023 06:10:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEEFDC433D2; Thu, 1 Jun 2023 06:10:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685599831; bh=fIPgNhfboYHlCutR5fCKllpOQFyZqltZTQ8EQg1nrUc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZaRrgrSpAvoTr/cZ05simuKBcTh5hg0Va2gtkE5stKlUOmiEK548QTld1m6VC1jow 5w+dmFfo2g5OYbNtGf6nCAFDV4LRLwAWoLQ6jhRFPucvlPuq3R5gs1ltfHyWyBKFyn wMFdSUAnDv5bln/ngQeUz6Wd2JZNBVFZKhHVz/TZrZ1HHMYTGg42VqdEcRFgaYC09V soszEa3no62jZURj6acmH4YbhWSQfIYEXl3woYSmXjz6DvOhmKyguEV+Q+vdj5hQDy PtbuCvIaIFuge0S+ADFLvc4DtHI2G9kqVfNvhCMURehW7CCXOUQjE0tJCEztsKU0rf p2OqLMkGOC7Uw== Date: Wed, 31 May 2023 23:10:29 -0700 From: Jakub Kicinski To: Tony Nguyen Cc: davem@davemloft.net, pabeni@redhat.com, edumazet@google.com, netdev@vger.kernel.org, Vinicius Costa Gomes , sasha.neftin@intel.com, richardcochran@gmail.com, Vladimir Oltean , Naama Meir Subject: Re: [PATCH net 2/4] igc: Check if hardware TX timestamping is enabled earlier Message-ID: <20230531231029.36822957@kernel.org> In-Reply-To: <20230530174928.2516291-3-anthony.l.nguyen@intel.com> References: <20230530174928.2516291-1-anthony.l.nguyen@intel.com> <20230530174928.2516291-3-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 :(