Netdev List
 help / color / mirror / Atom feed
From: Thomas Fourier <fourier.thomas@gmail.com>
To: Daniel Machon <daniel.machon@microchip.com>
Cc: Iyappan Subramanian <iyappan@os.amperecomputing.com>,
	Keyur Chudgar <keyur@os.amperecomputing.com>,
	Quan Nguyen <quan@os.amperecomputing.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"open list:NETWORKING DRIVERS" <netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] drivers: net: xgene: Fix dma_unmap_single() size
Date: Thu, 15 Oct 2026 14:37:32 +0200	[thread overview]
Message-ID: <69babd27-4f50-4637-9c00-e9d3efc76e0f@gmail.com> (raw)
In-Reply-To: <20261014200253.boklssmfbnwairjy@DEN-DL-M70577.microsemi.net>

Hi Daniel,
> Hi Thomas,
> 
>> In xgene_enet_refill_pagepool(), the skb->data is dma-mapped with length
> 
> To me, it looks like the mapping happens in xgene_enet_refill_bufpool() and not
> xgene_enet_refill_pagepool().>
>> len which is set to XGENE_ENET_STD_MTU which equals 1536. However, in
>> xgene_enet_delete_bufpool(), the same buffer is unmapped with length
>> XGENE_ENET_MAX_MTU which is 9600. This may erroneously unmap other
>> DMA buffers or cause other issues.
>>
>> Change unmap length to XGENE_ENET_STD_MTU.
>>
>> Fixes: 6e434627bce2 ("drivers: net: xgene: fix: Add dma_unmap_single")
> 
> That commit mapped and unmapped with XGENE_ENET_MAX_MTU. At that point, there
> was no mismatch. I think the mismatch came with:
> 
> Fixes: a9380b0f7be8 ("drivers: net: xgene: Add support for Jumbo frame")
> 
>> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
>> ---
>>   drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
>> index 507db46daf2b..2ddcbf27014e 100644
>> --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
>> +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
>> @@ -185,7 +185,7 @@ static void xgene_enet_delete_bufpool(struct xgene_enet_desc_ring *buf_pool)
>>   
>>   			raw_desc = &buf_pool->raw_desc16[i];
>>   			dma_addr = GET_VAL(DATAADDR, le64_to_cpu(raw_desc->m1));
>> -			dma_unmap_single(dev, dma_addr, XGENE_ENET_MAX_MTU,
>> +			dma_unmap_single(dev, dma_addr, XGENE_ENET_STD_MTU,
>>   					 DMA_FROM_DEVICE);
>>   		}
>>   	}
>> -- 
>> 2.53.0
>>
> 
> /Daniel

Thank you for your comments, I agree with both, I am submitting a v2.
Best,
Thomas

      reply	other threads:[~2026-10-15 12:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14  8:48 [PATCH net-next] drivers: net: xgene: Fix dma_unmap_single() size Thomas Fourier
2026-10-14  9:05 ` netdev-bot+sinfo
2026-10-14 20:02 ` Daniel Machon
2026-10-15 12:37   ` Thomas Fourier [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=69babd27-4f50-4637-9c00-e9d3efc76e0f@gmail.com \
    --to=fourier.thomas@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=daniel.machon@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=iyappan@os.amperecomputing.com \
    --cc=keyur@os.amperecomputing.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=quan@os.amperecomputing.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