RE: [Intel-wired-lan] [RFC PATCHv2 1/1] idpf: Fix header clobber in IDPF with SWIOTLB enabled

From: Loktionov, Aleksandr

Date: Mon Mar 02 2026 - 02:18:02 EST




> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf
> Of Steve Rutherford
> Sent: Friday, February 27, 2026 9:35 PM
> To: Nguyen, Anthony L <anthony.l.nguyen@xxxxxxxxx>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@xxxxxxxxx>; Lobakin, Aleksander
> <aleksander.lobakin@xxxxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>;
> Jakub Kicinski <kuba@xxxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>;
> intel-wired-lan@xxxxxxxxxxxxxxxx
> Cc: netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; David
> Decotigny <decot@xxxxxxxxxx>; Singhai, Anjali
> <anjali.singhai@xxxxxxxxx>; Samudrala, Sridhar
> <sridhar.samudrala@xxxxxxxxx>; Brian Vazquez <brianvv@xxxxxxxxxx>; Li
> Li <boolli@xxxxxxxxxx>; Tantilov, Emil S <emil.s.tantilov@xxxxxxxxx>;
> Steve Rutherford <srutherford@xxxxxxxxxx>
> Subject: [Intel-wired-lan] [RFC PATCHv2 1/1] idpf: Fix header clobber
> in IDPF with SWIOTLB enabled
>
> When SWIOTLB and header split are enabled, IDPF sees empty packets in
> the rx queue.
>
> This is caused by libeth_rx_sync_for_cpu clobbering the synthesized
> header in the workaround (i.e. overflow) path. After the header is
> synthesized by idpf_rx_hsplit_wa, the sync call pulls from the empty
> SWIOTLB buffer, effectively zeroing out the buffer.
>
> This skips the extra sync in the workaround path in most cases. The
> one exception is that it calls sync to trigger a recycle the header
> buffer when it fails to find a header in the payload.
>
> Fixes: 90912f9f4f2d1 ("idpf: convert header split mode to libeth +
> napi_build_skb()")
> Signed-off-by: Steve Rutherford <srutherford@xxxxxxxxxx>
> ---
> drivers/net/ethernet/intel/idpf/idpf_txrx.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
> b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
> index 3ddf7b1e85ef..946203a6bd86 100644
> --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
> +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
> @@ -3007,9 +3007,14 @@ static int idpf_rx_splitq_clean(struct
> idpf_rx_queue *rxq, int budget)
> u64_stats_update_begin(&rxq->stats_sync);
> u64_stats_inc(&rxq->q_stats.hsplit_buf_ovf);
> u64_stats_update_end(&rxq->stats_sync);
> - }
>
> - if (libeth_rx_sync_for_cpu(hdr, hdr_len)) {
> + /* Recycle the hdr buffer if unused.*/
Just a nit - please add space before */

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@xxxxxxxxx>

> + if (!hdr_len)
> + libeth_rx_sync_for_cpu(hdr, 0);
> + } else if (!libeth_rx_sync_for_cpu(hdr, hdr_len))
> + hdr_len = 0;
> +
> + if (hdr_len) {
> skb = idpf_rx_build_skb(hdr, hdr_len);
> if (!skb)
> break;
> --
> 2.53.0.473.g4a7958ca14-goog