From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (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 A11BA44160B for ; Wed, 29 Jul 2026 22:27:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785364028; cv=none; b=GrJPIzZ3Xz8cVXAYrs108VgScxmqJ0n2YxVJUjIZuSeuGWCMx+Bp8a4zuxex/6I6+LBtClwMzt+xWxaw+exoViAz/ZWsb1rknnX9L6R67v0Y1mpv7O4Kw+FEZVMFyMexwAScCJpfi9LMSHBDHXtmycgRfaEF1fAuPoqVVxok0O0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785364028; c=relaxed/simple; bh=r1c+CaBhW5s4wXFD2O6k3jFF+p8PGPmXib9duAj+dtw=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=IfHuGTGfwalUUneMkXsYh0mnq50sUZD7CpwC0VUACku3rheGXYYupNxmOp7BLgYXcvOXPasRWwCgMlmAWxb3S/qvSz4OD2iUu+hU14lVhpNaNCB2iD0m5lhzLYpZEq5tPZ1QFABP/VJjbuyGqb95GUfpQp+QRCg0O/D7fnTmfpI= 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=KPdG9xoO; arc=none smtp.client-ip=209.85.214.198 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="KPdG9xoO" Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2ccb6f6a3f4so2351485ad.1 for ; Wed, 29 Jul 2026 15:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785364026; x=1785968826; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=6i9gxS0ccvnf11VUuXna08dr0rnR4es/fvIWpwBhRHA=; b=KPdG9xoOeeAkYwv6rNeVc5TFkPwRqXwfsC+TcpzDrN11WI2y8npCLKWpgqycMjN/qF rsAtx5ARHDpyzr2Dgl+SsJxlPaxeixFDNne+rsIvyrr5X4011QQ5uwiO49gEoBXGCTmE D3Slza//jAE8CdvMd9tR+Hdjn+ANl3ZKuOn+sGOE9sN7m20Hmyejt1F2f6hBhaV6xJya Zn1lUKdsuQRDrnUsMiZt9YghiV1FpDpncfkk8e+gFKKchgUtOi1JFItFF4iMk2ce/dNH qTBcywDrSrVWozsEPwhmeiQjNejsDErBn5fRYz7gVwdlqZI18rBRVNVMPPH1hwG4nBA9 XrWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785364026; x=1785968826; h=content-type:cc:to:from:subject:message-id:mime-version:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6i9gxS0ccvnf11VUuXna08dr0rnR4es/fvIWpwBhRHA=; b=sulTyBvXu9Mj336TJD6wOQj8nSFpGyLP1ZJfdBR4fU1bbVPMz9tiv5QJRJkifPlQgt 5JUFBn58DUMquPE2ru5LsEkrP9WAMClMe3xJprtbTUIt3MKl7una216+1BOvpHrLm8fK RbtxvFA7J8ElnFZh10g+lju62anbqcap9JWdKv7YbjQ66V6ODQbZQdIOgO13gnQOirAy Gpgfzt0XEw8os3wxJVv7comJcdDcdLz88CERDW/BtnNa1etZVY0KVbGxOZWSsDJarR9W 3C10lcUE/c233fNrD86COYsi/HTiPC4wRehpuQ4h/+8ULkUfAKIAKx5Fltxb9uyFIQkR oe5Q== X-Forwarded-Encrypted: i=1; AHgh+RpVTFfDRW79N1cOcMaB26vN8per/1DTE/rJJ4kjAIDdgB2pOlR5MNSfaehQUfKH6xvhVSKLCnUe++6RSvk=@vger.kernel.org X-Gm-Message-State: AOJu0YyXrMI/FIEfwd5meKJcjrrRQUmVp4yKeobHYOMjIsAipFdyg1I5 zcTsGAgJ/CWk3oQXlu1FqAU+NA4LCPyVPa1CzxQ8RU/PiTYKcq+/GmPuSY67QyifkZLNlzIhN9t n+OOoeJrq X-Received: from plhz9.prod.google.com ([2002:a17:902:d9c9:b0:2ca:c400:4a09]) (user=jrhilke job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:d54f:b0:2ce:803c:6f09 with SMTP id d9443c01a7336-2d035eece1emr1289925ad.18.1785364025721; Wed, 29 Jul 2026 15:27:05 -0700 (PDT) Date: Wed, 29 Jul 2026 22:26:55 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAC9+amoC/2XM3QoCIRCG4VsJjzP8GZ21o+4jIlKnTag1dkOK2 HvPogOjw2+Y532yicZEE1svnmykkqaUhzq65YKF02HoiadYN1NCWYECeer9vui9Bw5OOggSNOr A6v91pGO6f1rbXd2nNN3y+PikC7yv34oUTaUAF9xYQlIGbQhy0+fcn2kV8oW9M8W0FFpqKnXSC E0xetf5P2obqlRLbaXCk4zKOdlF+KPY0q6lWClYaYNGMOjsD53n+QWJXeg2VAEAAA== X-Change-Id: 20260707-igb_v3_b4-49194c14373c X-Developer-Key: i=jrhilke@google.com; a=ed25519; pk=cK+Urrh214DoCHywJiTwhMP+zcs1ofpGrewToO/i/3A= X-Developer-Signature: v=1; a=ed25519-sha256; t=1785364025; l=4280; i=jrhilke@google.com; s=20260710; h=from:subject:message-id; bh=r1c+CaBhW5s4wXFD2O6k3jFF+p8PGPmXib9duAj+dtw=; b=GvZyKrMoebAjcDDlHpBwLITYvFjBc8UxGxjmlTe7z78CFZom1l0u1GemCj7aUoJII1+yOy7th 7cDIB3fSI19CZcMppmbdegaPL19XcAoeU/u4gVi0fAcGCsp6EgDot1c X-Mailer: b4 0.14.3 Message-ID: <20260729-igb_v3_b4-v8-0-3ed236272b4e@google.com> Subject: [PATCH v8 0/6] vfio: selftests: Add driver for Intel Ethernet Gigabit Controller (IGB) From: Josh Hilke To: David Matlack , Alex Williamson Cc: Shuah Khan , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, Vipin Sharma , Josh Hilke , Alex Williamson Content-Type: text/plain; charset="utf-8" This v8 of a series which adds a VFIO selftest driver for the Intel Gigabit Ethernet controller (IGB), specifically targeting the 82576 device. IGB is fully virtualized in QEMU, making it suitable for running VFIO selftests without specialized hardware. v7: https://lore.kernel.org/kvm/20260722-igb_v3_b4-v6-0-0be1d29918d4@google.com/ Version 8 caps the retry logic in vfio_pci_device_reset() so that it doesn't loop forever, and rebases the series onto linux-next. Testing ======= - VFIO selftests builds clean at every commit - vfio_pci_driver_test passes using IGB driver + QEMU. Use the following command to run the tests: vng \ --run arch/x86/boot/bzImage \ --user root \ --disable-microvm \ --memory 32G \ --cpus 8 \ --qemu-opts="-M q35,accel=kvm,kernel-irqchip=split" \ --qemu-opts="-device intel-iommu,intremap=on,caching-mode=on,device-iotlb=on" \ --qemu-opts="-netdev user,id=net0 -device igb,netdev=net0,addr=09.0" \ --append "console=ttyS0 earlyprintk=ttyS0 intel_iommu=on iommu=pt" \ --exec "modprobe vfio-pci && \ ./tools/testing/selftests/vfio/scripts/setup.sh 0000:00:09.0 && \ ./tools/testing/selftests/vfio/scripts/run.sh ./tools/testing/selftests/vfio/vfio_pci_driver_test" -------- Changelog: v7 -> v8: - Rebase onto linux-next branch. (Alex) - Implement retry limit in vfio_pci_device_reset(). (Alex) - Carry David's reviewed-by tag onto the patches that haven't been touched since v6. v6 -> v7: - Allow the driver to be used on any architecture. (Alex) - Fix regression in reset logic for the physical device. (Alex) v5 -> v6: - Retry on EAGAIN during device reset to handle transient lock contention (Sashiko). v4 -> v5: - Reordered igb_remove() to reset the device before disabling MSI-X (Sashiko) - Refactored hardware reset logic into igb_reset() helper. - Simplified reset completion check to usleep + assertion instead of retry loop (Sashiko). - Allow arbitrary test data by enabling Multicast Promiscuous (MPE) and Broadcast Accept (BAM) modes (Sashiko). - Fixed igb_send_msi() to use MSIX_VECTOR_MASK instead of magic number (Sashiko). v3 -> v4 - Enable MSI-X mode in GPIE (Sashiko) - Fix hardware initilization order to avoid race conditions (Alex/Sashiko) - Add memory barrier to prevent speculative reads (Alex/Sashiko) - Clean up stale references in commit messages and comments (Alex/Sashiko) - Add a comment to address software/firmware semaphore (Alex/Sashiko) v2 -> v3 - Poll reset bit and document the required wait time (David/Sashiko) - Fix the logic for enabling PCI_COMMAND_MEMORY (David/Sashiko) - Fail the test if autonegotation fails (David/Sashiko) - Handle endianness conversions (David/Sashiko) - Use real IGB headers at the start of the series (David) - Add E1000_TXD_CMD_IFCS to the TX descriptor command word (Sashiko) v1 -> v2 - Removed the chunking loop in igb_memcpy_start() (David) - Removed redundant writes to status_error and hdr_addr (David) - Include official IGB header files (David) Signed-off-by: Josh Hilke --- Alex Williamson (4): vfio: selftests: igb: Use PHY internal loopback on 82576 vfio: selftests: Add helpers to re-enable interrupts vfio: selftests: igb: Factor hardware programming into igb_hw_init() vfio: selftests: igb: Recover after DMA-read faults Josh Hilke (2): vfio: selftests: igb: Add driver for Intel 82576 device vfio: selftests: Retry on EAGAIN during device reset .../selftests/vfio/lib/drivers/igb/e1000_82575.h | 1 + .../selftests/vfio/lib/drivers/igb/e1000_defines.h | 1 + .../selftests/vfio/lib/drivers/igb/e1000_regs.h | 1 + tools/testing/selftests/vfio/lib/drivers/igb/igb.c | 579 +++++++++++++++++++++ .../vfio/lib/include/libvfio/vfio_pci_device.h | 15 + tools/testing/selftests/vfio/lib/libvfio.mk | 1 + tools/testing/selftests/vfio/lib/vfio_pci_device.c | 42 +- tools/testing/selftests/vfio/lib/vfio_pci_driver.c | 3 +- 8 files changed, 641 insertions(+), 2 deletions(-) --- base-commit: 550cab3931e84e8a7701155f4dc40c0e4069d390 change-id: 20260707-igb_v3_b4-49194c14373c Best regards, -- Josh Hilke