From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (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 5702B3D0937 for ; Tue, 26 May 2026 23:54:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779839707; cv=none; b=XPT4cQNHgBf/eJCfs9ALwJQ9Xni62WPANPMwMCqE/OVPRsogScxz4X9LBygxKTjhAaZRVV3v0Zm0u1ovEZW9I1/JxeZ+G5OWfCahvG4e0Nu12tP5pKnD/mI4hxzAjSuk1CuwPqYbyfxa71rNEtCX5kFw3VDhc4oTsyJIrWqqJso= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779839707; c=relaxed/simple; bh=CkH0Vzpqcgvxa7Y2LQJUZJmUrJFwjbVNSoXMV7tcqZE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=XGUBnn9808NPrlI3ZXq2Puzb8ff5HfhZrTyUaPfBn8APrJFW2Gqfm0JeQNlhk7ggMjoFu7NHqh+4doGFt6PnRu/iY9TDCqU0qjIsFWTBVAm5fpMxfJZdSrl6llDZSrOR9uH/t+GLP58pDxjik/djBXpgxRM8RGzp3KnzxYyfbCk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jrhilke.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=EHms+Axk; arc=none smtp.client-ip=209.85.210.202 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--jrhilke.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EHms+Axk" Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-83544d05c5aso5567798b3a.2 for ; Tue, 26 May 2026 16:54:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1779839689; x=1780444489; 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=W0Hu/D8rAuWKbGc4lHoFkn5GJfHnwhou62SLjESXk+s=; b=EHms+Axkefp8PwSTahgdtD2/Sisow1YdDbwPFldOw1JaAOZe6OILHgqMiAx2UiS1Z6 Qe2cr9VG6d2ayLtpZjMVdmmQPRkBpcdptEEmwrnBZxL2wpvKrIsZhcHr3JN9j6uRHj/V g3iLtT3Cm98vhM1R+9G8O2E//zWCtNwDSLs+saijUrRq46xD9EqhpPsRdOXTDi1Q85UC D9PlRs1r1Rqjqiwcac5cktHVXoXwzVSrZNTcupgntUB5IMT7jWDRYtStCzkc7GNszs55 8qiDoO4EMVh6YI5uFfuLNflxqdr+psbOSAoT36T6nCrdFUfdPwc2sn0exV+yPUQ8tkMV duIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779839689; x=1780444489; 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=W0Hu/D8rAuWKbGc4lHoFkn5GJfHnwhou62SLjESXk+s=; b=bZmzzC7TSA2ZCxf1TaTemR+QBaCCkMu30aLum9VJLnZ3bzx13GDfSSdLn+IOW3X/07 3e0WaXqVLyp/8XUD+uSCZlgOAZ/FB6Qd6guXKpuGn/9cmpmKqVhYK63OMgAN5rHBHhmV 6SryPSTYGuq/2DXlriI2KR79o21LdPSr+hhYmV49Pp0azhLXImvifj/SANNmhzFWRNX/ /qIgd4D6SEkn+a9Bb5W/60Uak49OM70aWPjTRUL/GMYgtxET7927ydiYS6liZTTFTPf5 tj/sqpxLDdTB1d2tVWp3y0JE0saGUDiGgqdEAD10QHGIoHA6WY43fXf96HeJFaFHek+V jdWg== X-Forwarded-Encrypted: i=1; AFNElJ9Lm6rVtl2h/tjvjTFEsz+y0gj3efnNyQjdzPzP65l+VslmX9Iivvjvf50Q9ZtEVSGQuul4eCTyt1fZlzw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx9Cb6roqLlGzg+OTSUuCKiSffShpdYUy3UM+h6cBLaH5gOA3Y9 HaVbIwflEJCvauzs0myUXmraoK3N7DpWiLW3aS0WhN8Rg0h2rKTJ9QN4H85XrU0MWoIVjqO4bZ/ q0d3u1/HS X-Received: from pfblu13.prod.google.com ([2002:a05:6a00:748d:b0:82f:ad57:40bb]) (user=jrhilke job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:22c6:b0:836:900e:8743 with SMTP id d2e1a72fcca58-8415f35d58amr21464806b3a.36.1779839688895; Tue, 26 May 2026 16:54:48 -0700 (PDT) Date: Tue, 26 May 2026 23:54:13 +0000 In-Reply-To: <20260526235417.2058313-1-jrhilke@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260526235417.2058313-1-jrhilke@google.com> X-Mailer: git-send-email 2.54.0.794.g4f17f83d09-goog Message-ID: <20260526235417.2058313-7-jrhilke@google.com> Subject: [PATCH v2 06/10] selftests/vfio: igb: Disable PCIe completion timeout retries From: Josh Hilke To: Alex Williamson , David Matlack Cc: Vipin Sharma , Shuah Khan , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Josh Hilke , Alex Williamson Content-Type: text/plain; charset="UTF-8" From: Alex Williamson The mix_and_match test intentionally submits TX descriptors with an unmapped source IOVA so that the DMA read fails. By default the 82576 re-sends the request after a PCIe completion timeout (datasheet section 8.6.1, GCR.Completion_Timeout_Resend, bit 16, initial value 1b). On real hardware this turns a single fault into a stream of retried reads, keeping PCIe AER and IOMMU error handling busy and interfering with reset recovery. Clear GCR.Completion_Timeout_Resend during device initialization so a failed read fails once and stays failed. Assisted-by: Claude:claude-opus-4-7 Signed-off-by: Alex Williamson --- tools/testing/selftests/vfio/lib/drivers/igb/igb.c | 12 ++++++++++++ .../selftests/vfio/lib/drivers/igb/registers.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/tools/testing/selftests/vfio/lib/drivers/igb/igb.c b/tools/testing/selftests/vfio/lib/drivers/igb/igb.c index 879c21780f5b..89537f8345d1 100644 --- a/tools/testing/selftests/vfio/lib/drivers/igb/igb.c +++ b/tools/testing/selftests/vfio/lib/drivers/igb/igb.c @@ -209,6 +209,18 @@ static void igb_init(struct vfio_pci_device *device) vfio_pci_config_writew(device, PCI_COMMAND, cmd_reg); } + /* + * Disable DMA re-send on PCIe completion timeout (82576 datasheet + * section 8.6.1, GCR.Completion_Timeout_Resend, bit 16). The + * mix_and_match test intentionally submits descriptors targeting + * unmapped IOVAs; with the default (set) value, the device keeps + * retrying the failed read indefinitely, which keeps PCIe AER and + * IOMMU error handling busy and interferes with reset recovery. + */ + ctrl = igb_read32(igb, IGB_GCR); + ctrl &= ~IGB_GCR_CMPL_TMOUT_RESEND; + igb_write32(igb, IGB_GCR, ctrl); + /* Configure PHY internal loopback for testing. */ if (igb_setup_loopback(igb)) return; diff --git a/tools/testing/selftests/vfio/lib/drivers/igb/registers.h b/tools/testing/selftests/vfio/lib/drivers/igb/registers.h index a133a208ed08..3f04bcaa44ba 100644 --- a/tools/testing/selftests/vfio/lib/drivers/igb/registers.h +++ b/tools/testing/selftests/vfio/lib/drivers/igb/registers.h @@ -73,6 +73,8 @@ #define IGB_RAH0 0x05404 /* Receive Address High 0 */ #define IGB_VMOLR0 0x05AD0 /* VM Offload Layout Register 0 */ +#define IGB_GCR 0x05B00 /* PCIe Control */ +#define IGB_GCR_CMPL_TMOUT_RESEND BIT(16) /* Re-send on completion timeout */ #define IGB_VMOLR_LPE 0x00010000 /* Long Packet Enable */ #define IGB_VMOLR_BAM 0x08000000 /* Broadcast Accept Mode */ -- 2.54.0.794.g4f17f83d09-goog