mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: Alexander Lobakin <aleksander.lobakin@intel.com>,
	Michal Kubiak <michal.kubiak@intel.com>,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Simon Horman <horms@kernel.org>,
	nxne.cnse.osdt.itp.upstreaming@intel.com, bpf@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH iwl-next v4 02/13] idpf: fix Rx descriptor ready check barrier in splitq
Date: Mon, 11 Aug 2025 18:10:33 +0200	[thread overview]
Message-ID: <20250811161044.32329-3-aleksander.lobakin@intel.com> (raw)
In-Reply-To: <20250811161044.32329-1-aleksander.lobakin@intel.com>

No idea what the current barrier position was meant for. At that point,
nothing is read from the descriptor, only the pointer to the actual one
is fetched.
The correct barrier usage here is after the generation check, so that
only the first qword is read if the descriptor is not yet ready and we
need to stop polling. Debatable on coherent DMA as the Rx descriptor
size is <= cacheline size, but anyway, the current barrier position
only makes the codegen worse.

Fixes: 3a8845af66ed ("idpf: add RX splitq napi poll support")
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
---
 drivers/net/ethernet/intel/idpf/idpf_txrx.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
index 68b3857c803b..72459fc1af79 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
@@ -3186,18 +3186,14 @@ static int idpf_rx_splitq_clean(struct idpf_rx_queue *rxq, int budget)
 		/* get the Rx desc from Rx queue based on 'next_to_clean' */
 		rx_desc = &rxq->rx[ntc].flex_adv_nic_3_wb;
 
-		/* This memory barrier is needed to keep us from reading
-		 * any other fields out of the rx_desc
-		 */
-		dma_rmb();
-
 		/* if the descriptor isn't done, no work yet to do */
 		gen_id = le16_get_bits(rx_desc->pktlen_gen_bufq_id,
 				       VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_M);
-
 		if (idpf_queue_has(GEN_CHK, rxq) != gen_id)
 			break;
 
+		dma_rmb();
+
 		rxdid = FIELD_GET(VIRTCHNL2_RX_FLEX_DESC_ADV_RXDID_M,
 				  rx_desc->rxdid_ucast);
 		if (rxdid != VIRTCHNL2_RXDID_2_FLEX_SPLITQ) {
-- 
2.50.1


  parent reply	other threads:[~2025-08-11 16:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-11 16:10 [PATCH iwl-next v4 00/13] idpf: add XDP support Alexander Lobakin
2025-08-11 16:10 ` [PATCH iwl-next v4 01/13] xdp, libeth: make the xdp_init_buff() micro-optimization generic Alexander Lobakin
2025-08-11 16:10 ` Alexander Lobakin [this message]
2025-08-11 16:10 ` [PATCH iwl-next v4 03/13] idpf: use a saner limit for default number of queues to allocate Alexander Lobakin
2025-08-11 16:10 ` [PATCH iwl-next v4 04/13] idpf: link NAPIs to queues Alexander Lobakin
2025-08-11 16:10 ` [PATCH iwl-next v4 05/13] idpf: add 4-byte completion descriptor definition Alexander Lobakin
2025-08-11 16:10 ` [PATCH iwl-next v4 06/13] idpf: remove SW marker handling from NAPI Alexander Lobakin
2025-08-11 16:10 ` [PATCH iwl-next v4 07/13] idpf: add support for nointerrupt queues Alexander Lobakin
2025-08-11 16:10 ` [PATCH iwl-next v4 08/13] idpf: prepare structures to support XDP Alexander Lobakin
2025-08-11 16:10 ` [PATCH iwl-next v4 09/13] idpf: implement XDP_SETUP_PROG in ndo_bpf for splitq Alexander Lobakin
2025-08-11 16:10 ` [PATCH iwl-next v4 10/13] idpf: use generic functions to build xdp_buff and skb Alexander Lobakin
2025-08-11 16:10 ` [PATCH iwl-next v4 11/13] idpf: add support for XDP on Rx Alexander Lobakin
2025-08-11 16:10 ` [PATCH iwl-next v4 12/13] idpf: add support for .ndo_xdp_xmit() Alexander Lobakin
2025-08-11 16:10 ` [PATCH iwl-next v4 13/13] idpf: add XDP RSS hash hint Alexander Lobakin
2025-08-13  1:45 ` [PATCH iwl-next v4 00/13] idpf: add XDP support Jakub Kicinski
2025-08-22 15:26 ` Alexander Lobakin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250811161044.32329-3-aleksander.lobakin@intel.com \
    --to=aleksander.lobakin@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=michal.kubiak@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nxne.cnse.osdt.itp.upstreaming@intel.com \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®