From: Jakub Kicinski <kuba@kernel.org>
To: Thomas Fourier <fourier.thomas@gmail.com>
Cc: Chris Snook <chris.snook@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Jeff Garzik <jeff@garzik.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v4] ethernet: atl1: Add missing DMA mapping error checks
Date: Tue, 24 Jun 2025 17:26:52 -0700 [thread overview]
Message-ID: <20250624172652.05616616@kernel.org> (raw)
In-Reply-To: <20250623092047.71769-1-fourier.thomas@gmail.com>
On Mon, 23 Jun 2025 11:20:41 +0200 Thomas Fourier wrote:
> + dma_err:
> + while (first_mapped != next_to_use) {
> + buffer_info = &tpd_ring->buffer_info[first_mapped];
> + dma_unmap_page(&adapter->pdev->dev,
> + buffer_info->dma,
> + buffer_info->length,
> + DMA_TO_DEVICE);
> + buffer_info->dma = 0;
> +
> + if (++first_mapped == tpd_ring->count)
> + first_mapped = 0;
> + }
> + return false;
> }
>
> static void atl1_tx_queue(struct atl1_adapter *adapter, u16 count,
> @@ -2419,7 +2454,10 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
> }
> }
>
> - atl1_tx_map(adapter, skb, ptpd);
> + if (!atl1_tx_map(adapter, skb, ptpd)) {
> + dev_kfree_skb_any(skb);
> + return NETDEV_TX_OK;
> + }
Code looks good but we need a counter for the drops.
Please add one in a similar way to the rx_dropped counter.
--
pw-bot: cr
prev parent reply other threads:[~2025-06-25 0:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-23 9:20 Thomas Fourier
2025-06-24 18:22 ` Simon Horman
2025-06-25 0:26 ` Jakub Kicinski [this message]
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=20250624172652.05616616@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=chris.snook@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fourier.thomas@gmail.com \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tglx@linutronix.de \
/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®