* [PATCH iwl-net] i40e: remove redundant memory barrier when cleaning Tx descs
@ 2025-08-22 15:16 Maciej Fijalkowski
2025-08-22 19:42 ` [Intel-wired-lan] " Loktionov, Aleksandr
0 siblings, 1 reply; 2+ messages in thread
From: Maciej Fijalkowski @ 2025-08-22 15:16 UTC (permalink / raw)
To: intel-wired-lan
Cc: netdev, anthony.l.nguyen, przemyslaw.kitszel, magnus.karlsson,
Maciej Fijalkowski
i40e has a feature which writes to memory location last descriptor
successfully sent. Memory barrier in i40e_clean_tx_irq() was used to
avoid forward-reading descriptor fields in case DD bit was not set.
Having mentioned feature in place implies that such situation will not
happen as we know in advance how many descriptors HW has dealt with.
Besides, this barrier placement was wrong. Idea is to have this
protection *after* reading DD bit from HW descriptor, not before.
Digging through git history showed me that indeed barrier was before DD
bit check, anyways the commit introducing i40e_get_head() should have
wiped it out altogether.
Also, there was one commit doing s/read_barrier_depends/smp_rmb when get
head feature was already in place, but it was only theoretical based on
ixgbe experiences, which is different in these terms as that driver has
to read DD bit from HW descriptor.
Fixes: 1943d8ba9507 ("i40e/i40evf: enable hardware feature head write back")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 048c33039130..b194eae03208 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -948,9 +948,6 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,
if (!eop_desc)
break;
- /* prevent any other reads prior to eop_desc */
- smp_rmb();
-
i40e_trace(clean_tx_irq, tx_ring, tx_desc, tx_buf);
/* we have caught up to head, no work left to do */
if (tx_head == tx_desc)
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [Intel-wired-lan] [PATCH iwl-net] i40e: remove redundant memory barrier when cleaning Tx descs
2025-08-22 15:16 [PATCH iwl-net] i40e: remove redundant memory barrier when cleaning Tx descs Maciej Fijalkowski
@ 2025-08-22 19:42 ` Loktionov, Aleksandr
0 siblings, 0 replies; 2+ messages in thread
From: Loktionov, Aleksandr @ 2025-08-22 19:42 UTC (permalink / raw)
To: Fijalkowski, Maciej, intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, Nguyen, Anthony L, Kitszel, Przemyslaw,
Karlsson, Magnus, Fijalkowski, Maciej
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Maciej Fijalkowski
> Sent: Friday, August 22, 2025 5:16 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: netdev@vger.kernel.org; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Karlsson, Magnus
> <magnus.karlsson@intel.com>; Fijalkowski, Maciej
> <maciej.fijalkowski@intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-net] i40e: remove redundant
> memory barrier when cleaning Tx descs
>
> i40e has a feature which writes to memory location last descriptor
> successfully sent. Memory barrier in i40e_clean_tx_irq() was used to
> avoid forward-reading descriptor fields in case DD bit was not set.
> Having mentioned feature in place implies that such situation will not
> happen as we know in advance how many descriptors HW has dealt with.
>
> Besides, this barrier placement was wrong. Idea is to have this
> protection *after* reading DD bit from HW descriptor, not before.
> Digging through git history showed me that indeed barrier was before
> DD bit check, anyways the commit introducing i40e_get_head() should
> have wiped it out altogether.
>
> Also, there was one commit doing s/read_barrier_depends/smp_rmb when
> get head feature was already in place, but it was only theoretical
> based on ixgbe experiences, which is different in these terms as that
> driver has to read DD bit from HW descriptor.
>
> Fixes: 1943d8ba9507 ("i40e/i40evf: enable hardware feature head write
> back")
> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
> drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> index 048c33039130..b194eae03208 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> @@ -948,9 +948,6 @@ static bool i40e_clean_tx_irq(struct i40e_vsi
> *vsi,
> if (!eop_desc)
> break;
>
> - /* prevent any other reads prior to eop_desc */
> - smp_rmb();
> -
> i40e_trace(clean_tx_irq, tx_ring, tx_desc, tx_buf);
> /* we have caught up to head, no work left to do */
> if (tx_head == tx_desc)
> --
> 2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-22 19:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-22 15:16 [PATCH iwl-net] i40e: remove redundant memory barrier when cleaning Tx descs Maciej Fijalkowski
2025-08-22 19:42 ` [Intel-wired-lan] " Loktionov, Aleksandr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).