From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796122865; b=D/B0ul4Z80SBmbjtTyyt0acXTt25Oh7Po5eTgfq/JQk0HeklSu+EW3YaUQtUwyYml5BZ HKX8O20wMUQZx30lTJ0MR22DEPb4kLmCWsK07Bn0wGvd33SFm0PDUq7BkCBeI34gi4D5h vUUwirlcUM+wJOmTqfLusUy+D7aUOUUbDR8m1XsE18vWfzBYVf4W7ZdzDJn1MQmrjeVoO snTiAugQbAecVAGIaqar3VZh0ogCdWh/x41VQoNZBYqgUf4qTR8ikyCgC1WZgR6hMbi/U E9GM+wus6JoA6QoF+RD5Ah8kqnP1d/PIC1rEsl2fCXVyiEMeNABEeHUGw/LG9aRcA9Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796122865; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=fsVklzjLZ22znfj5YIAQhmlmrGiygnMWe14j6EI4Eq8=; b=Mbp27GlNYIE59FbHyK9Qrbe967xW2MtErHbIzr3TEWvPzVyHCQXhb6NRtD7+C6WaZYVo Rphq816x2yR2E+4uhHJIWujEifxHRV/zYZGIefTYtTD9gsOlc1STtWhJLWzVl0hLvSq8c b4jefk6j3rLqyTK4LGR8O4nOFDcGXZrjVtn/zdDfXni5Rzef377lWYE85t6g/jWDX7P1u q5ptl4phESVu79bEqn56RhL8EDDXcKoF3xAjUA6spvelRVXL1uK1JWiC1HD3y6O2AbujZ u0p7LY/v+CANdWcrM32ej5tmU8hBpXw3f7yHfLP7xfI0dseSRieqcQTM24jAjS3cUYQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Niky7cr4; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 865EF606A31A; Tue, 1 Dec 2026 11:01:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Niky7cr4 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E16581F000C1; Tue, 1 Dec 2026 11:01:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796122865; bh=fsVklzjLZ22znfj5YIAQhmlmrGiygnMWe14j6EI4Eq8=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Niky7cr4ocJiB5rnhBOfl4Pks0pvqeFBHMzL7tF/ebsl/MmQRFo8xMCPKTl5uDVg/ sU1c1QFIkCmDH14X6vEtRWK8pY4RWmK3K1WYCYTNZQMVdypoXZJwCQntqXYW9SHYDt as13fZ9flztAOjKc6ZFbk92FI8tAFiA9mNpmYuYYuF/WIgQQV7AigFZcvivWp2GCgZ KrPGIxvoRmQJfDkP8hOuqjqu5y2x2xwnwFCBrpnG4xk0oO8czVx6yqgqLi/2TC5Ykv A7vQoRo9ot3Ff1HZzmNrxmG9inQo/j6pluMHBhFNIUV/2RYomf5AmePW3KI9KMlYUX oic4I5ETdcWSQ== Date: Tue, 1 Dec 2026 11:00:59 +0000 From: Simon Horman To: Florian Fainelli Cc: netdev@vger.kernel.org, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , Russell King , Jijie Shao , Runyu Xiao , David Yang , Herbert Valerio Riedel , Danny Kukawka , Mugunthan V N , Sebastian Hesselbarth , open list , Manuel Lauss Subject: Re: [PATCH net v4 05/10] net: au1000: serialize TX completion with packet submission Message-ID: <20261201110059.GS804035@horms.kernel.org> References: <20261121004809.1690280-1-f.fainelli@gmail.com> <20261121004809.1690280-6-f.fainelli@gmail.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261121004809.1690280-6-f.fainelli@gmail.com> On Fri, Nov 20, 2026 at 04:48:04PM -0800, Florian Fainelli wrote: > TX completion runs in hard IRQ context while ndo_start_xmit updates the > same descriptors and ring state without locking. An interrupt between > netif_stop_queue() and setting tx_full can miss the wakeup and leave the > queue stopped until the watchdog runs. Use the existing IRQ-safe device > lock in both paths to serialize reclamation and queue state changes. > Keep the packet copy and padding outside this lock so uncached DMA > buffer writes do not extend the IRQ-disabled critical section. > > When submission reclaims a completed descriptor at tx_head, advance > tx_tail and clear TX_T_DONE before dropping the lock so the interrupt > handler cannot reclaim it twice. The TX queue lock reserves the idle > descriptor while its buffer is filled; completion stops at a descriptor > without TX_T_DONE and never accesses its payload. Reacquire the device > lock to publish the length, DMA ownership and tx_head together. Consume > the copied skb after releasing the lock with dev_consume_skb_any(), > which also handles netpoll entry with hardware interrupts disabled. > > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Signed-off-by: Florian Fainelli Reviewed-by: Simon Horman