From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f201.google.com (mail-dy1-f201.google.com [74.125.82.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 645FA393DF4 for ; Fri, 27 Feb 2026 20:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772224541; cv=none; b=rQDD/FGJ7hHoItZLXCp79PcstRfzXGXc2sqr/j4vABDXykWGtgXUcKOcSkHT0m0o8/aQZqM8p2iX1b8GApguTkNAZvdBvDEAqmFN77AQFkFTzcRuecIPXK/NVqQnvlaM05+nS0SrOXG/Q4DZS0I5qm77+9xKqTTe+dQoxqAYp+0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772224541; c=relaxed/simple; bh=8K0QwXam/iW69cfggpb5/Uon8UQmkG8ThPmq64TvNL8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=KddbG55irJH/3kZSCzJbJZHpv4eOLnmsHpeIejSdatUDbqL3a3xjDhrBnZM+qGj7OTulSiMwqvVqN1FEPNx5bm58sgp4yoI0J/TDcjwxZ3iAaznozMt3JSFsTdswbuPZ/vlmddRtnOJcvSORjT9GX7lqfRns0pwOd74uEUFHZNA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--srutherford.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=buaT/Zd6; arc=none smtp.client-ip=74.125.82.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--srutherford.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="buaT/Zd6" Received: by mail-dy1-f201.google.com with SMTP id 5a478bee46e88-2bdc0bb5ea0so2068409eec.1 for ; Fri, 27 Feb 2026 12:35:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772224539; x=1772829339; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Tc/Ht2b5cgI4g8P5Sjsh2iQU8CklCHOBQlWuRX9SNTQ=; b=buaT/Zd6bCwgjVVYqC5eAUFtVjCf1VfB6QFOXUMgYgHLMi3K+vs0EfbpgD0dvSopLP x6RAFHZHOSI95dq/sgBkW7k2QS8n4KE8GPLf8bHhomTUMG1vIdIQu/l5EGK8yi+wWTDY Tt72GCPxIalYW3J4fyEsWMY3uNeyVg7VgQM9/OciVptouYJ7kJv5yqq69a5tWnQ2zaws M0hUj5p9QLZEcetQ6b3hiQll1p6V4sHyWo8u9IvPcew1D7nAi7vw0XbglDF5tUVMXofz 40bUZhzBDKHtwxYK3l1hh9PoVIdg3vIBoaWnXBjjaPYWJZ8doLUhHFfbUr/bxMJBTxhI BniA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772224539; x=1772829339; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Tc/Ht2b5cgI4g8P5Sjsh2iQU8CklCHOBQlWuRX9SNTQ=; b=LFYIfcCwFQ1xnsa+3LQz3J22LY5n4Pkk8ZKVkEQhQF5DPes9IwGa8jPvplxJn1fLWy oz7CRTJC4cxY45qzoUvPiGVX0eJjA3RuT0s6S78mxfbV9a9fEk+FRBA0z6kJ+RHfjNE/ 4IBABu8heuCPdWHoV5fSZq4kEBEnjbh3JcrKMm3cgHtTj7MzTNsHEtbT1g8DbtD5Av76 oKUB+ubF7CSJ12wWELwxGFcGUjXWUEMRXj9yC86BXGCeP7uCtgOfTOTMnA/B4WnFtbPR +XE8Z7HKXahDMkhtDgtJ2YelyQfCHlx3H1ssxXuEAkFI3Qcjout54CiDg4KIJ+Cw/pWi V8qQ== X-Forwarded-Encrypted: i=1; AJvYcCXa4nx2U80B6r0Z2Mo3x6dpASRnIHDY+B4+RuErFcKB2ajawRfL8uT5kz6nc/dfXLEIvjUUSlTit3wEEls=@vger.kernel.org X-Gm-Message-State: AOJu0Yzn5Kfs44TsMBGcRRFOVO62n5OvzfEnQO1M6Ww5GBg9TvoVZKmi ef0Q11CShBHFGUV/iYgzQiv9KaLTxmr2RKa9tKebO2/6DF1nssE0VpFbwza37z6uQ3fjNVgXtG1 XkdzAP8EbBScK3UmpKmH3539NCA== X-Received: from dycmf14.prod.google.com ([2002:a05:693c:248e:b0:2ba:9d01:ecf2]) (user=srutherford job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:d506:b0:2bd:cebf:e48e with SMTP id 5a478bee46e88-2bde1c3f057mr1355544eec.7.1772224539217; Fri, 27 Feb 2026 12:35:39 -0800 (PST) Date: Fri, 27 Feb 2026 20:34:57 +0000 In-Reply-To: <20260227203457.558196-1-srutherford@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260227203457.558196-1-srutherford@google.com> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog Message-ID: <20260227203457.558196-2-srutherford@google.com> Subject: [RFC PATCHv2 1/1] idpf: Fix header clobber in IDPF with SWIOTLB enabled From: Steve Rutherford To: Tony Nguyen , Przemek Kitszel , aleksander.lobakin@intel.com, "David S. Miller" , Jakub Kicinski , Eric Dumazet , intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, David Decotigny , Anjali Singhai , Sridhar Samudrala , Brian Vazquez , Li Li , emil.s.tantilov@intel.com, Steve Rutherford Content-Type: text/plain; charset="UTF-8" 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 --- 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.*/ + 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