From: Thomas Fourier <fourier.thomas@gmail.com>
Cc: Thomas Fourier <fourier.thomas@gmail.com>,
Shannon Nelson <shannon.nelson@amd.com>,
Brett Creeley <brett.creeley@amd.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>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Stanislav Fomichev <sdf@fomichev.me>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
Caleb Sander Mateos <csander@purestorage.com>,
Taehee Yoo <ap420073@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org
Subject: [PATCH net] ethernet: ionic: Fix DMA mapping test in `ionic_xdp_post_frame()`
Date: Tue, 17 Jun 2025 11:18:36 +0200 [thread overview]
Message-ID: <20250617091842.29732-2-fourier.thomas@gmail.com> (raw)
The `ionic_tx_map_frag()` wrapper function is used which returns 0 or a
valid DMA address. Testing that pointer with `dma_mapping_error()`could
be eroneous since the error value exptected by `dma_mapping_error()` is
not 0 but `DMA_MAPPING_ERROR` which is often ~0.
Fixes: ac8813c0ab7d ("ionic: convert Rx queue buffers to use page_pool")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
index 2ac59564ded1..beefdc43013e 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
@@ -357,7 +357,7 @@ static int ionic_xdp_post_frame(struct ionic_queue *q, struct xdp_frame *frame,
} else {
dma_addr = ionic_tx_map_frag(q, frag, 0,
skb_frag_size(frag));
- if (dma_mapping_error(q->dev, dma_addr)) {
+ if (!dma_addr) {
ionic_tx_desc_unmap_bufs(q, desc_info);
return -EIO;
}
--
2.43.0
next reply other threads:[~2025-06-17 9:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-17 9:18 Thomas Fourier [this message]
2025-06-17 14:35 ` Michal Swiatkowski
2025-06-17 15:01 ` Alexander Lobakin
2025-06-17 16:56 ` Brett Creeley
2025-06-17 18:57 ` [PATCH net,v2] ethernet: ionic: Fix DMA mapping tests Thomas Fourier
2025-06-18 23:15 ` Brett Creeley
2025-06-18 17:05 ` [PATCH net] ethernet: ionic: Fix DMA mapping test in `ionic_xdp_post_frame()` 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=20250617091842.29732-2-fourier.thomas@gmail.com \
--to=fourier.thomas@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=ap420073@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brett.creeley@amd.com \
--cc=csander@purestorage.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=shannon.nelson@amd.com \
--cc=vladimir.oltean@nxp.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®