From: "Kadosh, MoriyaX" <moriyax.kadosh@intel.com>
To: "Ruinskiy, Dima" <dima.ruinskiy@intel.com>,
Matt Vollrath <tactii@gmail.com>,
<intel-wired-lan@lists.osuosl.org>
Cc: 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>, <netdev@vger.kernel.org>,
<stable@vger.kernel.org>
Subject: Re: [PATCH iwl-net v2 1/2] e1000e: fix Rx skb DMA map error sentinel
Date: Mon, 5 Oct 2026 22:47:24 +0300 [thread overview]
Message-ID: <eb7e99ce-358b-47a4-a67b-ed0bb55201b4@intel.com> (raw)
In-Reply-To: <c217a3a9-12c4-4c10-bf74-a21bf27df08b@intel.com>
On 05/10/2026 21:11, Ruinskiy, Dima wrote:
> On 13/09/2026 20:15, Matt Vollrath wrote:
>> Upon encountering a DMA_MAPPING_ERROR during skb allocation and mapping,
>> the driver would leave DMA_MAPPING_ERROR in the buffer_info->dma field.
>> This would lead several buffer_info->dma == 0 conditions down unwanted
>> paths:
>>
>> * In e1000_alloc_jumbo_rx_buffers(), it would not re-attempt the failed
>> mapping and instead write DMA_MAPPING_ERROR to the h/w descriptor on
>> the next allocation call. On cleaning or teardown it would attempt to
>> dma_unmap_page() DMA_MAPPING_ERROR. This case would only be
>> reachable at MTU > 1518 and page size > 16K.
>> * In e1000_clean_rx_ring(), it would attempt to dma_unmap_page/single()
>> DMA_MAPPING_ERROR (unless cleaned by the jumbo path first). This case
>> would be reachable at any combination of MTU and page size.
>>
>> Use buffer_info->dma = 0 as the sentinel for "DMA is not mapped." Set it
>> immediately upon detecting the failure.
>>
>> The map error value was 0 on some platforms (including most common x86)
>> until error values were unified to DMA_MAPPING_ERROR in v4.20/v5.0.
>> Since then the error handling in this driver has been incorrect on all
>> platforms.
>>
>> Signed-off-by: Matt Vollrath <tactii@gmail.com>
>> Suggested-by: Jakub Kicinski <kuba@kernel.org>
>> Fixes: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver
>> (currently for ICH9 devices only)")
>> Cc: stable@vger.kernel.org
>> ---
>> v2:
>> * Add history blurb to description.
>> ---
>> drivers/net/ethernet/intel/e1000e/netdev.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/
>> ethernet/intel/e1000e/netdev.c
>> index 844f31ab37ad..26f45ee8c7e7 100644
>> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
>> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
>> @@ -691,6 +691,7 @@ static void e1000_alloc_rx_buffers(struct
>> e1000_ring *rx_ring,
>> adapter->rx_buffer_len,
>> DMA_FROM_DEVICE);
>> if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
>> + buffer_info->dma = 0;
>> dev_err(&pdev->dev, "Rx DMA map failed\n");
>> adapter->rx_dma_failed++;
>> break;
>> @@ -791,6 +792,7 @@ static void e1000_alloc_rx_buffers_ps(struct
>> e1000_ring *rx_ring,
>> adapter->rx_ps_bsize0,
>> DMA_FROM_DEVICE);
>> if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
>> + buffer_info->dma = 0;
>> dev_err(&pdev->dev, "Rx DMA map failed\n");
>> adapter->rx_dma_failed++;
>> /* cleanup skb */
>> @@ -877,6 +879,7 @@ static void e1000_alloc_jumbo_rx_buffers(struct
>> e1000_ring *rx_ring,
>> PAGE_SIZE,
>> DMA_FROM_DEVICE);
>> if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
>> + buffer_info->dma = 0;
>> adapter->alloc_rx_buff_failed++;
>> break;
>> }
>>
>> base-commit: 78445023439506ebd83b86d40b1e428a3b309d4a
> Reviewed-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
Tested-by: Moriya Kadosh <moriyax.kadosh@intel.com>
next prev parent reply other threads:[~2026-10-05 19:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-13 17:15 [PATCH iwl-net v2 0/2] e1000e: fix Rx DMA error handling Matt Vollrath
2026-09-13 17:15 ` [PATCH iwl-net v2 1/2] e1000e: fix Rx skb DMA map error sentinel Matt Vollrath
2026-10-05 18:11 ` Ruinskiy, Dima
2026-10-05 19:47 ` Kadosh, MoriyaX [this message]
2026-09-13 17:15 ` [PATCH iwl-net v2 2/2] e1000e: fix ps_pages " Matt Vollrath
2026-10-05 18:11 ` Ruinskiy, Dima
2026-10-05 19:46 ` Kadosh, MoriyaX
2026-09-16 12:16 ` [PATCH iwl-net v2 0/2] e1000e: fix Rx DMA error handling Simon Horman
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=eb7e99ce-358b-47a4-a67b-ed0bb55201b4@intel.com \
--to=moriyax.kadosh@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=dima.ruinskiy@intel.com \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=stable@vger.kernel.org \
--cc=tactii@gmail.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