public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Damato <joe@dama.to>
To: Wang Jun <1742789905@qq.com>
Cc: 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>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	gszhai@bjtu.edu.cn, 25125332@bjtu.edu.cn, 25125283@bjtu.edu.cn,
	23120469@bjtu.edu.cn
Subject: Re: [PATCH v2] net: ns83820: fix DMA mapping error handling in hard_start_xmit
Date: Tue, 31 Mar 2026 16:49:29 -0700	[thread overview]
Message-ID: <acxdiUMDaYE5WmzX@devvm20253.cco0.facebook.com> (raw)
In-Reply-To: <tencent_EB7280CE1394ABF5035CDA078FC60A481906@qq.com>

On Tue, Mar 31, 2026 at 08:21:41PM +0800, Wang Jun wrote:
> Hi Paolo Abeni,
> 
> This is v2 of the DMA mapping error handling fix for ns83820. Changes since v1:
> 
> - Added queue restart check in error path to avoid potential TX queue stall
>   (as pointed out by the AI review)
> - Adjusted variable declarations to follow reverse christmas tree order
> - Switched from dma_unmap_single to dma_unmap_page for fragments

Usually you'd put the changelog below. Take a look at how this recent patch
does it:

https://lore.kernel.org/netdev/20260331123858.1912449-2-charles.perry@microchip.com/

> diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c
> index cdbf82affa7b..f8d037db4ffb 100644
> --- a/drivers/net/ethernet/natsemi/ns83820.c
> +++ b/drivers/net/ethernet/natsemi/ns83820.c
> @@ -1051,6 +1051,12 @@ static netdev_tx_t ns83820_hard_start_xmit(struct sk_buff *skb,
>  	int stopped = 0;
>  	int do_intr = 0;
>  	volatile __le32 *first_desc;
> +	int i;
> +	int frag_mapped_count = 0;
> +	unsigned int main_len = 0;
> +	unsigned int frag_dma_len[MAX_SKB_FRAGS];
> +	dma_addr_t main_buf = 0;
> +	dma_addr_t frag_dma_addr[MAX_SKB_FRAGS];

You mentioned it was fixed to reverse christmas tree in the changelog above,
but doesn't seem like it in the patch?

  reply	other threads:[~2026-03-31 23:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-27  1:16 [PATCH] net: ns83820: check DMA mapping errors in hard_start_xmit Wang Jun
2026-03-31 10:05 ` Paolo Abeni
2026-03-31 11:14   ` Wang Jun
2026-03-31 12:09     ` Eric Dumazet
2026-03-31 12:21   ` [PATCH v2] net: ns83820: fix DMA mapping error handling in hard_start_xmit Wang Jun
2026-03-31 23:49     ` Joe Damato [this message]
2026-04-01  1:07     ` Jakub Kicinski

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=acxdiUMDaYE5WmzX@devvm20253.cco0.facebook.com \
    --to=joe@dama.to \
    --cc=1742789905@qq.com \
    --cc=23120469@bjtu.edu.cn \
    --cc=25125283@bjtu.edu.cn \
    --cc=25125332@bjtu.edu.cn \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gszhai@bjtu.edu.cn \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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