Thanks to rapido , it's become much simpler to test Linux device drivers for real PCIe devices in VMs.
The advantages of this approach are:
the host is protected from memory corruption errors caused by buggy kernel drivers
the PCI peripheral can be physically installed in a multi-use machine, reducing hardware & lab requirements
debugging info is easily available
the development cycle is short and simple - rapid even :)
Here's a screen cast showing the workflow for a simple developer test: (thanks to termtosvg )
(termtosvg) [root@BBB rapido]# (termtosvg) [root@BBB rapido]# . (termtosvg) [root@BBB rapido]# ./ (termtosvg) [root@BBB rapido]# ./r (termtosvg) [root@BBB rapido]# ./ra (termtosvg) [root@BBB rapido]# ./rap (termtosvg) [root@BBB rapido]# ./rapi (termtosvg) [root@BBB rapido]# ./rapid (termtosvg) [root@BBB rapido]# ./rapido (termtosvg) [root@BBB rapido]# ./rapido (termtosvg) [root@BBB rapido]# ./rapido c (termtosvg) [root@BBB rapido]# ./rapido cu (termtosvg) [root@BBB rapido]# ./rapido cut (termtosvg) [root@BBB rapido]# ./rapido cut (termtosvg) [root@BBB rapido]# ./rapido cut n (termtosvg) [root@BBB rapido]# ./rapido cut ne (termtosvg) [root@BBB rapido]# ./rapido cut net (termtosvg) [root@BBB rapido]# ./rapido cut net- (termtosvg) [root@BBB rapido]# ./rapido cut net-t (termtosvg) [root@BBB rapido]# ./rapido cut net-te (termtosvg) [root@BBB rapido]# ./rapido cut net-tes (termtosvg) [root@BBB rapido]# ./rapido cut net-test (termtosvg) [root@BBB rapido]# ./rapido cut net-test- (termtosvg) [root@BBB rapido]# ./rapido cut net-test-e (termtosvg) [root@BBB rapido]# ./rapido cut net-test- (termtosvg) [root@BBB rapido]# ./rapido cut net-test-t (termtosvg) [root@BBB rapido]# ./rapido cut net-test-tn (termtosvg) [root@BBB rapido]# ./rapido cut net-test-tn4 (termtosvg) [root@BBB rapido]# ./rapido cut net-test-tn40 (termtosvg) [root@BBB rapido]# ./rapido cut net-test-tn40x (termtosvg) [root@BBB rapido]# ./rapido cut net-test-tn40xx (termtosvg) [root@BBB rapido]# ./rapido cut net-test-tn40xx SeaBIOS (version 1.16.2-2.fc39 SeaBIOS (version 1.16.2-2.fc39) iPXE (https://ipxe.org) 00:02.0 CA00 PCI2.10 PnP PMM+1EFCBEB0+1EF0BEB0 CA00 Press Ctrl-B to configure Booting from ROM.. [ 0.000000][ T0] Linux version 6.6.1 (acooks@BBB) (gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4), GNU ld version 2.40-13.fc39)3 [ 0.000000][ T0] Command line: rapido.vm_num=1 rd.systemd.unit=dracut- [ 0.000000][ T0] Command line: rapido.vm_num=1 rd.systemd.unit=dracut-cmdline.service console=ttyS0 net.ifnames=0 systemd.mac1 [ 0.000000][ T0] BIOS-provided physical RAM map: [ 0.000000][ T0] BIOS-e820: [mem [ 0.000000][ T0] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable [ 0.000000][ T0] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved [ 0.000000][ T0] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved [ [ 0.000000][ T0] BIOS-e820: [mem 0x0000000000100000-0x000000001ffdefff] usable [ 0.000000][ T0] BIOS-e820: [mem 0x000000001ffdf000-0x000000001fffffff] reserved [ 0.000000][ T0] BIOS-e820: [mem 0x00000000b0000000-0x00000000bfffffff] [ 0.000000][ T0] BIOS-e820: [mem 0x00000000b0000000-0x00000000bfffffff] reserved [ 0.000000][ T0] BIOS-e820: [mem 0x00000000fed1c000-0x00000000fed1ffff] reserved [ 0.000000][ T0] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved [ 0.000000][ T0] BIOS-e820: [mem 0x00000000fffc0000-0x00000000f [ 0.000000][ T0] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved [ 0.000000][ T0] NX (Execute Disable) protection: active [ 0.000000][ T0] APIC: Static calls initialized [ 0.000000][ T0] SMBIOS 3.0.0 present. [ 0.000000][ T0] DMI: QEMU Standard PC [ 0.000000][ T0] DMI: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-2.fc39 04/01/2014 [ 0.000000][ T0] Hypervisor detected: KVM [ 0.000000][ T0] kvm-clock: Using msrs 4b564d01 and 4b564d00 [ 0.000001][ T0] kvm-clock: using sched offset of 108884991 c [ 0.000001][ T0] kvm-clock: using sched offset of 108884991 cycles [ 0.000004][ T0] clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns [ 0.000011][ T0] tsc: Detected 3494.400 MHz processor [ 0.000893][ T0] e820: update [mem 0x00000000-0 [ 0.000893][ T0] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved [ 0.000902][ T0] e820: remove [mem 0x000a0000-0x000fffff] usable [ 0.000910][ T0] last_pfn = 0x1ffdf max_arch_pfn = 0x400000000 [ 0.000930][ T0] MTRR map: 4 entries (3 fixed + 1 variable; max 19), built from 8 v [ 0.000930][ T0] MTRR map: 4 entries (3 fixed + 1 variable; max 19), built from 8 variable MTRRs [ 0.000934][ T0] x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT [ 0.003504][ T0] found SMP MP-table at [mem 0x000f5bd0-0x000f5bdf] [ 0.005884][ T0] RAMDISK: [mem 0x1de9d000-0x1ffcffff] [ 0.005888 [ 0.005888][ T0] ACPI: Early table checksum verification disabled [ 0.005892][ T0] ACPI: RSDP 0x00000000000F5A10 000014 (v00 BOCHS ) [ 0.005903][ T0] ACPI: RSDT 0x000000001FFE24C5 00003C (v01 BOCHS BXPC 00000001 BXPC 00000001) [ 0.005903][ T0] ACPI: RSDT 0x000000001FFE24C5 00003C (v01 BOCHS BXPC 00000001 BXPC 00000001) [ 0.005914][ T0] ACPI: FACP 0x000000001FFE2215 0000F4 (v03 BOCHS BXPC 00000001 BXPC 00000001) [ 0.005926][ T0] ACPI: DSDT 0x000000001FFE0040 0021D5 (v01 BOCHS BXPC 00000001 BXPC 00000001) [ 0.005934][ T0] ACPI: F [ 0.005934][ T0] ACPI: FACS 0x000000001FFE0000 000040 [ 0.005942][ T0] ACPI: APIC 0x000000001FFE2309 000090 (v03 BOCHS BXPC 00000001 BXPC 00000001) [ 0.005950][ T0] ACPI: HPET 0x000000001FFE2399 000038 (v01 BOCHS BXPC 00000001 BXP [ 0.005950][ T0] ACPI: HPET 0x000000001FFE2399 000038 (v01 BOCHS BXPC 00000001 BXPC 00000001) [ 0.005959][ T0] ACPI: MCFG 0x000000001FFE23D1 00003C (v01 BOCHS BXPC 00000001 BXPC 00000001) [ 0.005967][ T0] ACPI: DMAR 0x000000001FFE240D 000090 (v01 BOCHS BXPC 00000001 BXPC 00000001) [ 0.0 [ 0.005976][ T0] ACPI: WAET 0x000000001FFE249D 000028 (v01 BOCHS BXPC 00000001 BXPC 00000001) [ 0.005984][ T0] ACPI: Reserving FACP table memory at [mem 0x1ffe2215-0x1ffe2308] [ 0.005987][ T0] ACPI: Reserving DSDT tabl [ 0.005987][ T0] ACPI: Reserving DSDT table memory at [mem 0x1ffe0040-0x1ffe2214] [ 0.005990][ T0] ACPI: Reserving FACS table memory at [mem 0x1ffe0000-0x1ffe003f] [ 0.005993][ T0] ACPI: Reserving APIC table memory at [mem 0x1ffe2309-0x1ffe2398] [ 0.005 [ 0.005996][ T0] ACPI: Reserving HPET table memory at [mem 0x1ffe2399-0x1ffe23d0] [ 0.005999][ T0] ACPI: Reserving MCFG table memory at [mem 0x1ffe23d1-0x1ffe240c] [ 0.006002][ T0] ACPI: Reserving DMAR table memory at [mem [ 0.006002][ T0] ACPI: Reserving DMAR table memory at [mem 0x1ffe240d-0x1ffe249c] [ 0.006005][ T0] ACPI: Reserving WAET table memory at [mem 0x1ffe249d-0x1ffe24c4] [ 0.006048][ T0] Zone ranges: [ 0.006050][ T0] DMA [mem 0x0000000000001000-0x0000000000ffffff] [ 0.00 [ 0.006056][ T0] DMA32 [mem 0x0000000001000000-0x000000001ffdefff] [ 0.006062][ T0] Normal empty [ 0.006065][ T0] Movable zone start for each node [ 0.006067][ T0] Early memory node ranges [ 0.006068][ T0] node 0: [ 0.006068][ T0] node 0: [mem 0x0000000000001000-0x000000000009efff] [ 0.006071][ T0] node 0: [mem 0x0000000000100000-0x000000001ffdefff] [ 0.006073][ T0] Initmem setup node 0 [mem 0x0000000000001000-0x000000001ffdefff] [ 0.006085][ T0] [ 0.006085][ T0] On node 0, zone DMA: 1 pages in unavailable ranges [ 0.006196][ T0] On node 0, zone DMA: 97 pages in unavailable ranges [ 0.009639][ T0] On node 0, zone DMA32: 33 pages in unavailable ranges [ 0.015558][ T0] kasan: KernelAddress [ 0.015558][ T0] kasan: KernelAddressSanitizer initialized [ 0.015777][ T0] ACPI: PM-Timer IO Port: 0x608 [ 0.015788][ T0] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1]) [ 0.015833][ T0] IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23 [ 0.015833][ T0] IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23 [ 0.015838][ T0] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) [ 0.015842][ T0] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level) [ 0.015845][ T0] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high [ 0.015845][ T0] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) [ 0.015847][ T0] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level) [ 0.015850][ T0] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level) [ 0.015858][ T0] ACPI: Using ACPI (MADT) for S [ 0.015858][ T0] ACPI: Using ACPI (MADT) for SMP configuration information [ 0.015860][ T0] ACPI: HPET id: 0x8086a201 base: 0xfed00000 [ 0.015865][ T0] TSC deadline timer available [ 0.015867][ T0] smpboot: Allowing 4 CPUs, 0 hotplug CPUs [ 0.015903][ [ 0.015903][ T0] kvm-guest: APIC: eoi() replaced with kvm_guest_apic_eoi_write() [ 0.015913][ T0] kvm-guest: KVM setup pv remote TLB flush [ 0.015916][ T0] kvm-guest: setup PV sched yield [ 0.015948][ T0] [mem 0x20000000-0xaf [ 0.015948][ T0] [mem 0x20000000-0xafffffff] available for PCI devices [ 0.015950][ T0] Booting paravirtualized kernel on KVM [ 0.015953][ T0] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns [ 0.02028 [ 0.020280][ T0] setup_percpu: NR_CPUS:64 nr_cpumask_bits:4 nr_cpu_ids:4 nr_node_ids:1 [ 0.022251][ T0] percpu: Embedded 515 pages/cpu s2070824 r8192 d30424 u4194304 [ 0.022264][ T0] pcpu-alloc: s2070824 [ 0.022264][ T0] pcpu-alloc: s2070824 r8192 d30424 u4194304 alloc=2*2097152 [ 0.022269][ T0] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [ 0.022330][ T0] Kernel command line: rapido.vm_num=1 rd.systemd.unit=dracut-cmdline.service console=ttyS0 net.ifnames=0 systm [ 0.022330][ T0] Kernel command line: rapido.vm_num=1 rd.systemd.unit=dracut-cmdline.service console=ttyS0 net.ifnames=0 syst1 [ 0.022465][ T0] random: crng init done [ 0.022510][ T0] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes, linea [ 0.022510][ T0] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes, linear) [ 0.022536][ T0] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes, linear) [ 0.022677][ T0] Built 1 zonelists, mobility grouping on. Total pages: 128735 [ 0.022830][ T0] mem auto-init: stack:all(zero), heap allo [ 0.022830][ T0] mem auto-init: stack:all(zero), heap alloc:off, heap free:off [ 0.022834][ T0] stackdepot: allocating hash table via alloc_large_system_hash [ 0.023474][ T0] stackdepot hash table entries: 1048576 (order: 11, 8388608 bytes, linear) [ 0.038744][ T0] Memory: 341308K/523764K available (122 [ 0.038744][ T0] Memory: 341308K/523764K available (12288K kernel code, 6239K rwdata, 4456K rodata, 3040K init, 16516K bss, 1) [ 0.039467][ T0] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1 [ 0.041196][ T0] Running RCU self tests [ 0 [ 0.041198][ T0] Running RCU synchronous self tests [ 0.041216][ T0] rcu: Hierarchical RCU implementation. [ 0.041218][ T0] rcu: RCU lockdep checking is enabled. [ 0.041220][ T0] rcu: RCU restricting CPUs from NR_CPUS=64 to n [ 0.041220][ T0] rcu: RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4. [ 0.041224][ T0] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.041226][ T0] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4 [ 0.041397][ T0] Running RCU synchronous self [ 0.041397][ T0] Running RCU synchronous self tests [ 0.057669][ T0] NR_IRQS: 4352, nr_irqs: 456, preallocated irqs: 16 [ 0.058629][ T0] rcu: srcu_init: Setting srcu_struct sizes based on contention. [ 0.058745][ T0] kfence: initialized - using 2097152 bytes for 255 obje [ 0.058745][ T0] kfence: initialized - using 2097152 bytes for 255 objects at 0x(____ptrval____)-0x(____ptrval____) [ 0.063713][ T0] Console: colour VGA+ 80x25 [ 0.063772][ T0] printk: console [ttyS0] enabled [ 0.100715][ T0] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc [ 0.100715][ T0] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar [ 0.101118][ T0] ... MAX_LOCKDEP_SUBCLASSES: 8 [ 0.101371][ T0] ... MAX_LOCK_DEPTH: 48 [ 0.101631][ T0] ... MAX_LOCKDEP_KEYS: 8192 [ 0.101859][ T0] ... CLASSHASH_SIZE: [ 0.101859][ T0] ... CLASSHASH_SIZE: 4096 [ 0.102106][ T0] ... MAX_LOCKDEP_ENTRIES: 32768 [ 0.102339][ T0] ... MAX_LOCKDEP_CHAINS: 65536 [ 0.102569][ T0] ... CHAINHASH_SIZE: 32768 [ 0.102792][ T0] memory used by lock dependency info: [ 0.102792][ T0] memory used by lock dependency info: 7005 kB [ 0.103095][ T0] memory used for stack traces: 4224 kB [ 0.103369][ T0] per task-struct memory footprint: 2688 bytes [ 0.103824][ T0] ACPI: Core revision 20230628 [ 0.105030][ T0] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns [ 0.105675][ T0] APIC: Switch to symmetric I/O mode setup [ 0.105941][ T0 [ 0.105941][ T0] DMAR: Host address width 39 [ 0.106185][ T0] DMAR: DRHD base: 0x000000fed90000 flags: 0x0 [ 0.106621][ T0] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap d2008c22260286 ecap f00f5e [ 0.106621][ T0] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap d2008c22260286 ecap f00f5e [ 0.107058][ T0] DMAR: ATSR flags: 0x1 [ 0.107282][ T0] DMAR-IR: IOAPIC id 0 under DRHD base 0xfed90000 IOMMU 0 [ 0.107628][ T0] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping. [ 0.107628][ T0] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping. [ 0.108693][ T0] DMAR-IR: Enabled IRQ remapping in x2apic mode [ 0.109002 [ 0.109002][ T0] x2apic enabled [ 0.109407][ T0] APIC: Switched APIC routing to: cluster x2apic [ 0.109768][ T0] kvm-guest: APIC: send_IPI_mask() replaced with [ 0.109768][ T0] kvm-guest: APIC: send_IPI_mask() replaced with kvm_send_ipi_mask() [ 0.110144][ T0] kvm-guest: APIC: send_IPI_mask_allbutself() replaced with kvm_send_ipi_mask_allbutself() [ 0.110599][ T0] kvm-guest: setup PV IPIs [ 0.113725][ T0] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1 [ 0.114176][ T0] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x325ea749ca1, max_idle_ns: 440795373125 ns [ 0.11468 [ 0.114687][ T0] Calibrating delay loop (skipped) preset value.. 6988.80 BogoMIPS (lpj=13977600) [ 0.115147][ T0] x86/cpu: User Mode Instruction Prevention (UMIP) activated [ 0.115479][ T0] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0 [ 0.115746][ T0] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0 [ 0.116037][ T0] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization [ 0.116444][ T0] Spectre V2 : Mitigation: Enhanced / Automatic IBRS [ 0.116707 [ 0.116707][ T0] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch [ 0.117065][ T0] Spectre V2 : Spectre v2 / PBRSB-eIBRS: Retire a single CALL on VMEXIT [ 0.117392][ T0] Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier [ 0.118694][ T0] Speculative Store Bypass: Mitigation: Speculative Store Bypass disabled via prctl [ 0.119084][ T0] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' [ 0.119435][ T0] x86/fpu: Supporting XSAVE feature 0x002: 'SSE regist [ 0.119435][ T0] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' [ 0.119729][ T0] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' [ 0.120026][ T0] x86/fpu: Supporting XSAVE feature 0x200: 'Protection Keys User registers' [ 0.120388][ T0] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256 [ 0.1 [ 0.120673][ T0] x86/fpu: xstate_offset[9]: 832, xstate_sizes[9]: 8 [ 0.120959][ T0] x86/fpu: Enabled xstate features 0x207, context size is 840 bytes, using 'compacted' format. [ 0.123244][ T0] debug: unmapping init [mem 0xffffffff82ddb000-0xffffffff82ddefff] [ 0.123617][ T0] pid_max: default: 32768 minimum: 301 [ 0.124873][ T0] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes, linear) [ 0.125218][ T0] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes, linear) [ 0.129105][ T0] Running RCU synchronous self tests [ 0.129329][ T0] Running RCU synchronous self tests [ 0.129948][ T1] smpboot: CPU0: Intel( [ 0.129948][ T1] smpboot: CPU0: Intel(R) Core(TM) i5-14600K (family: 0x6, model: 0xb7, stepping: 0x1) [ 0.130686][ T1] Performance Events: unsupported p6 CPU model 183 no PMU driver, software events only. [ 0.130686][ T1] signal: max sigframe size: 3632 [ 0.130686][ T1] rcu: Hierarchic [ 0.130686][ T1] rcu: Hierarchical SRCU implementation. [ 0.130686][ T1] rcu: Max phase no-delay instances is 1000. [ 0.130686][ T1] NMI watchdog: Perf NMI watchdog permanently disabled [ 0.131241][ T1] smp: Bringing up secondary CPUs ... [ 0.132459][ T1] smpboot: x86: Booting SMP configuration: [ 0.132713][ T1] .... node #0, CPUs: #1 #2 #3 [ 0.134855][ T1] smp: Brought up 1 node, 4 CPUs [ 0.135110][ T1] smpboot: Max logical packages: 1 [ 0.135314][ T1] smpboot: Total of 4 processors activated (27955.20 BogoMIPS) [ 0.139282][ T1] devtmpfs: initialized [ 0.143852][ T1] Running RCU synchronous self tests [ 0.143861][ T1] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.144315][ T1] futex hash table entries: 1024 (order: 5, 131072 bytes, linear) [ 0.148148][ T1] NET: Registered PF_NETLINK/PF_ROUTE protocol family [ 0.152219][ T1] thermal_sys: Registered thermal governor 'step_wise' [ 0.152224][ T1] thermal_sys: Registered thermal governor 'user_space' [ 0.152631][ T1] cpuidle: using governor menu [ 0.154419][ T1] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0xb0000000-0xbfffffff] (base 0xb0000000) [ 0.154695][ T1] PCI: MMCONFIG at [mem 0xb0000000-0xbfffffff] reserved as E820 entry [ 0.155080][ T1] PCI: Using configuration type 1 f [ 0.155080][ T1] PCI: Using configuration type 1 for base access [ 0.159501][ T1] ACPI: Added _OSI(Module Device) [ 0.159721][ T1] ACPI: Added _OSI(Processor Device) [ 0.159933][ T1] ACPI: Added _OSI(3.0 _SCP Extensions) [ 0.160155][ T1] ACPI: Added _OSI(Processor Aggregator Device) [ 0.260313][ T1] ACPI: 1 ACPI AML tables successfully acquired and loaded [ 0.271676][ T1] ACPI: _OSC evaluation for CPUs failed, trying _PDC [ 0.279940][ T1] ACPI: Interpreter enabled [ 0.280287][ T1] ACPI: PM: (supports S0 S5) [ 0.280497][ T1] ACPI: Using IOAPIC for interrupt routing [ 0.281327][ T1] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug [ 0.281778][ T1] PCI: Using E820 reservations for host bridge windows [ 0.285989][ T1] ACPI: Enabled 2 GPEs in block 00 to 3F [ 0.381744][ T1] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff]) [ 0.382160][ T1] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3] [ 0.386240][ T1] acpi PNP0A08:00: _OSC: platform does not support [PCIeHotplug LTR DPC] [ 0.393036][ T1] acpi PNP0A08:00: _OSC: OS now controls [PME AER PCIeCapability] [ 0.394943][ T1] PCI host bridge to bus 0000:00 [ 0.395177][ T1] pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7 window] [ 0.395537][ T1] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window] [ 0.395913][ [ 0.395913][ T1] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window] [ 0.396301][ T1] pci_bus 0000:00: root bus resource [mem 0x20000000-0xafffffff window] [ 0.396700][ T1] pci_bus 0000:00: root bus resource [mem 0xc0000000-0xf [ 0.396700][ T1] pci_bus 0000:00: root bus resource [mem 0xc0000000-0xfebfffff window] [ 0.397103][ T1] pci_bus 0000:00: root bus resource [mem 0x100000000-0x8ffffffff window] [ 0.397480][ T1] pci_bus 0000:00: root bus resource [bus 00-ff] [ [ 0.397996][ T1] pci_bus 0000:00: scanning bus [ 0.398330][ T1] pci 0000:00:00.0: [8086:29c0] type 00 class 0x060000 [ 0.399572][ T1] pci 0000:00:00.0: EDR: Notify handler installed [ 0.401641][ T1] pci 0000:00:01.0: [1234:1111] type 00 class 0x030000 [ 0.402692][ T1] pci 0000:00:01.0: reg 0x10: [mem 0xfd000000-0xfdffffff pref] [ 0.404650][ T1] pci 0000:00:01.0: reg 0x18: [mem 0xfebd0000-0xfebd0fff] [ 0.407898][ T1] pci 0000:00:01.0: reg 0x30: [mem 0xfebc0000-0xfebcffff pref] [ 0.408376][ T1] pci 0000:00:01.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff] [ 0.409431][ T1] pci 0000:00:01.0: EDR: Notify handler installed [ 0.411492][ T1] pci 0000:00:02.0: [1af4:1000] type 00 class 0x020000 [ 0.412757][ T1] pci 0000:00:02.0: reg 0x10: [io 0xc040-0xc05f] [ 0.413542][ T1] pci 0000:00:02.0: reg 0x14: [mem 0xfebd1000-0xf [ 0.413542][ T1] pci 0000:00:02.0: reg 0x14: [mem 0xfebd1000-0xfebd1fff] [ 0.415364][ T1] pci 0000:00:02.0: reg 0x20: [mem 0xfe010000-0xfe013fff 64bit pref] [ 0.416570][ T1] pci 0000:00:02.0: reg 0x30: [mem 0xfeb80000-0xfebbffff pref] [ 0.417791][ T1] pci 0000:00:02.0: EDR: Notify handler installed [ 0.419780][ T1] pci 0000:00:03.0: [1af4:1005] type 00 class 0x00ff00 [ 0.420988][ T1] pci 0000:00:03.0: reg 0x10: [io 0xc060-0xc07f] [ 0.422103][ T1] pci 0000:00:03.0: reg 0x14: [mem 0xfebd2000-0xfebd2fff] [ 0.423863][ T1] pci 0000:00:03.0: reg 0x20: [mem 0xfe014000-0xfe017fff 64bit pref] [ 0.425524][ T1] pci 0000:00:03.0: EDR: Notify handler installed [ 0.427526][ T1] pci 0000:00:04.0: [1fc9:4022] type 00 class 0x020000 [ 0.428248][ T1] pci 0000:00:04.0: reg 0x10: [mem 0xfe000000-0 [ 0.428248][ T1] pci 0000:00:04.0: reg 0x10: [mem 0xfe000000-0xfe00ffff 64bit pref] [ 0.430483][ T1] pci 0000:00:04.0: supports D1 D2 [ 0.431420][ T1] pci 0000:00:04.0: EDR: Notify handler installed [ 0.433565][ T1] pci 0000:00:1f.0: [8086:2918] type 00 class 0x060100 [ 0.434160][ T1] pci 0000:00:1f.0: quirk: [io 0x0600-0x067f] claimed by ICH6 ACPI/GPIO/TCO [ 0.435182][ T1] pci 0000:00:1f.0: EDR: Notify handler installed [ 0.437121][ T1] pci 0000:00:1f.2: [8086:2922] type 00 class 0x010601 [ 0.438692][ T1] pci 0000:00:1f.2: reg 0x20: [io 0xc080-0xc09f] [ 0.439322][ T1] pci 0000:00:1f.2: reg 0x24: [mem 0xfebd3000-0xfebd3fff] [ 0.440845][ T1] pci 0000:00:1f.2: EDR: Notify handler installed [ 0.443065][ T1] pci 0000:00:1f.3: [8086:2930] type 00 class 0x0c0500 [ 0.444178][ T1] pci 0000:00:1f.3: reg 0x20: [io 0x0700-0x073f] [ 0.445523][ T1] pci 0000:00:1f.3: EDR: Notify handler installed [ 0.447443][ T1] pci_bus 0000:00: fixups for bus [ 0.447683][ T1] pci_bus 0000:00: bus scan returning with max=00 [ 0.447983][ T1] pci_bus 0000:00: on NUMA node 0 [ 0.454894][ T1] ACPI: PCI: Interrupt link LNKA configured for IRQ 10 [ 0.458618][ T1] ACPI: PCI: Interrupt link LNKB configured for IRQ 10 [ 0.461984][ T1] ACPI: PCI: Interrupt link LNKC configured for IRQ 11 [ 0.465634][ T1] ACPI: PCI: Interrupt link LNKD configured for IRQ 11 [ 0.469257][ T1] ACPI: PCI: Interrupt link LNKE configured for IRQ 10 [ 0.472977][ T1] ACPI: PCI: Interrupt link LNKF configured for IRQ 10 [ 0.476614][ T1] ACPI: PCI: Interrupt link LNKG configured for IRQ 11 [ 0.480207][ T1] ACPI: PCI: Interrupt link LNKH configured for IRQ 11 [ 0.481254][ T1] ACPI: PCI: Interrupt link GSIA configured for IRQ 16 [ 0.481992][ T1] ACPI: PCI: Interrupt link GSIB configured for IRQ 17 [ 0.482738][ T1] ACPI: PCI: Interrupt link GSIC configured for IRQ 18 [ 0.483465][ T1] ACPI: PCI: Interrupt link GSID configured for IRQ 19 [ 0.484206][ T1] ACPI: PCI: Interrupt link GSIE configured for IRQ 20 [ 0.484938][ T1] ACPI: PCI: Interrupt link GSIF configured for IRQ 21 [ 0.484938][ T1] ACPI: PCI: Interrupt link GSIF configured for IRQ 21 [ 0.485668][ T1] ACPI: PCI: Interrupt link GSIG configured for IRQ 22 [ 0.486407][ T1] ACPI: PCI: Interrupt link GSIH configured for IRQ 23 [ 0.499464][ T1] iommu: Default domain type: Translated [ 0.499706][ T1] iommu: DMA domain TLB invalidation policy: lazy mode [ 0.500344][ T1] pps_core: L [ 0.500344][ T1] pps_core: LinuxPPS API ver. 1 registered [ 0.500584][ T1] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it> [ 0.501080][ T1] PTP clock support registered [ 0.504545][ T1] PCI: Using ACPI for IRQ routing [ 0.528645][ T1] PCI: pci_cache_line_size set to 64 bytes [ 0.528896][ T1] pci 0000:00:01.0: BAR 0: reserving [mem 0xfd000000-0xfdffffff flags 0x42208] (d=0, p=0) [ 0.529301][ T1] pci 0000:00:01.0: BAR 2: reserving [mem 0xfebd0000-0xfebd0fff flags 0x40200] (d=0, p=0) [ 0.529706][ T1] pci 0000:00:02.0: BAR 0: reserving [io 0xc040-0xc05f flags 0x40101] (d=0, p=0) [ 0.530084][ T1] pci 0000:00:02.0: BAR 1: reserving [mem 0xfebd1000-0xfebd1fff flags 0x40200] (d=0, p=0) [ 0.530488][ T1] pci 0000:00:02.0: BAR 4: reserving [mem 0xfe010000-0xfe0 [ 0.530488][ T1] pci 0000:00:02.0: BAR 4: reserving [mem 0xfe010000-0xfe013fff flags 0x14220c] (d=0, p=0) [ 0.530697][ T1] pci 0000:00:03.0: BAR 0: reserving [io 0xc060-0xc07f flags 0x40101] (d=0, p=0) [ 0.531073][ T1] pci 0000:00:03.0: BAR 1: reserving [mem 0xfebd2000-0xfebd2fff flags 0x40200] (d=0, p=0) [ 0.531486][ T [ 0.531486][ T1] pci 0000:00:03.0: BAR 4: reserving [mem 0xfe014000-0xfe017fff flags 0x14220c] (d=0, p=0) [ 0.531906][ T1] pci 0000:00:04.0: BAR 0: reserving [mem 0xfe000000-0xfe00ffff flags 0x14220c] (d=0, p=0) [ 0.532319][ T1] pci 0000:00:1f.2: BAR 4: reserving [io 0xc080- [ 0.532319][ T1] pci 0000:00:1f.2: BAR 4: reserving [io 0xc080-0xc09f flags 0x40101] (d=0, p=0) [ 0.532695][ T1] pci 0000:00:1f.2: BAR 5: reserving [mem 0xfebd3000-0xfebd3fff flags 0x40200] (d=0, p=0) [ 0.533099][ T1] pci 0000:00:1f.3: BAR 4: reserving [io 0x0700-0x073f flags 0x40101] (d=0, p=0) [ 0.533508][ [ 0.533508][ T1] e820: reserve RAM buffer [mem 0x0009fc00-0x0009ffff] [ 0.533828][ T1] e820: reserve RAM buffer [mem 0x1ffdf000-0x1fffffff] [ 0.536285][ T1] pci 0000:00:01.0: vgaarb: setting as boot VGA device [ 0.536285][ T1] pci 0000:00:01.0: vgaarb: bridge control possible [ 0.536285][ T1] pci 0000:00:01.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none [ 0.536285][ [ 0.536285][ T1] vgaarb: loaded [ 0.536285][ T1] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0 [ 0.536343][ T1] hpet0: 3 comparators, 64-bit 100.000000 MHz counter [ 0.544912][ T1] clocksource: Switched to clocksource kvm-clock [ 0.548251][ T1] pnp: PnP ACPI init [ 0.552914][ T1] system 00:05: [mem 0xb0000000-0xbfffffff window] has been reserved [ 0.562524][ T1] pnp: PnP ACPI: found 6 devices [ 0.594062][ T1] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns [ 0.594932][ T1] NET: Registered PF_INET protocol family [ 0.595384][ T1] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.597963][ T1] tcp_listen_portaddr_hash hash table entries: 256 (order: 2, 20480 bytes, linear) [ 0.598376][ T1] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) [ 0.598829][ T1] TCP established hash table entr [ 0.598829][ T1] TCP established hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.599328][ T1] TCP bind hash table entries: 4096 (order: 7, 655360 bytes, linear) [ 0.599934][ T1] TC [ 0.599934][ T1] TCP: Hash tables configured (established 4096 bind 4096) [ 0.600524][ T1] UDP hash table entries: 256 (order: 3, 49152 bytes, linear) [ 0.600872][ T1] UDP-Lite hash table e [ 0.600872][ T1] UDP-Lite hash table entries: 256 (order: 3, 49152 bytes, linear) [ 0.601933][ T1] NET [ 0.601933][ T1] NET: Registered PF_UNIX/PF_LOCAL protocol family [ 0.602306][ T1] pci_bus 0000:00: resource 4 [io 0x0000-0x0cf7 window] [ 0.602600][ T1] pci_bus 0000:00: resource 5 [io 0x0d00-0xffff window] [ 0.602889][ T1] pci_bus 0000:00: r [ 0.602889][ T1] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff window] [ 0.603208][ T1] pci_bus 0000:00: resource 7 [mem 0x20000000-0xafffffff window] [ 0.603524][ T1] pci_bus 0000:00: resource 8 [mem 0xc0000000-0xfebfffff window] [ 0.603842][ T1] pci_bus 0000:00: resource 9 [mem [ 0.603842][ T1] pci_bus 0000:00: resource 9 [mem 0x100000000-0x8ffffffff window] [ 0.604604][ T1] PCI: CLS 64 bytes, default 64 [ 0.604939][ [ 0.604939][ T1] DMAR: No RMRR found [ 0.605173][ T1] DMAR: No SATC found [ 0.605339][ T1] DMAR: dmar0: Using Queued invalidation [ 0.605652][ T1] DMAR: IOMMU batching disallowed due to virtualization [ 0.605907][ T11] [ 0.605907][ T11] Unpacking initramfs... [ 0.606781][ T1] pci 0000:00:00.0: Adding to iommu group 0 [ 0.607287][ T1] pci 0000:00:01.0: Adding to iommu group 1 [ 0.607761][ T1] pci 0000:00:02.0: Adding to iommu group 2 [ [ 0.608278][ T1] pci 0000:00:03.0: Adding to iommu group 3 [ 0.608755][ T1] pci 0000:00:04.0: Adding to iommu group 4 [ 0.609 [ 0.609259][ T1] pci 0000:00:1f.0: Adding to iommu group 5 [ 0.609648][ T1] pci 0000:00:1f.2: Adding to iommu group 5 [ 0.610033][ T1] pci 0000:00:1f.3: Adding to iommu group 5 [ 0.636660][ T1] DMAR: Intel(R) Virtualization Technology for Directed I/O [ 0.640171][ T1] RAPL PMU: API unit is 2^-32 Joules, 0 fixed counters, 10737418240 ms ovfl timer [ 0.640645][ T1] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x325ea749ca1, max_idle_ns: 440795373125 ns [ 0.646483][ T1] workingset: timestamp_bits=46 max_order=17 bucket_order=0 [ 0.647388][ T1] 9p: Installing v9fs 9 [ 0.647388][ T1] 9p: Installing v9fs 9p2000 file system support [ 0.647849][ T1] io scheduler mq-deadline registered [ 0.648085][ T1] io scheduler kyber registered [ 0.650716][ T1] pciehp: pcie_port_service_register = 0 [ 0.654739][ T1] virtio-pci 0000:00:02.0: vgaarb: pci_notify [ 0.655066][ T1] virtio-pci 0000:00:02.0: runtime IRQ mapping not provided by arch [ 0.681128][ T1] ACPI: \_SB_.GSIG: Enabled at IRQ 22 [ 0.682262][ T1] virtio-pci 0000:00:02.0: enabling bus mastering [ 0.683179][ T1] virtio-pci 0000:00:02.0: [ 0.683179][ T1] virtio-pci 0000:00:02.0: vgaarb: pci_notify [ 0.683484][ T1] virtio-pci 0000:00:03.0: vgaarb: pci_notify [ 0.683780][ T1] virtio-pci 0000:00:03.0: runtime IRQ mapping not provided by arch [ 0.703132][ T11] debug: unmapping init [mem 0xffff88801de9d000-0xffff88801ffcffff] [ 0.709768][ T1] ACPI: \_SB_.GSIH: Enabled at IRQ 23 [ 0.710790][ T1] virtio-pci 0000:00:03.0: enabling bus mastering [ 0.711615][ T1] virtio-pci 0000:00:03.0: vgaarb: pci_not [ 0.711615][ T1] virtio-pci 0000:00:03.0: vgaarb: pci_notify [ 0.712668][ T1] Serial: 8250/16550 driver [ 0.712668][ T1] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled [ 0.714343][ T1] 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A [ 0.736995][ T1] VFIO - User Level meta-driver version: 0.3 [ 0.737852][ T1] intel_pstate: CPU model [ 0.737852][ T1] intel_pstate: CPU model not supported [ 0.738866][ T1] NET: Registered PF_INET6 [ 0.738866][ T1] NET: Registered PF_INET6 protocol family [ 0.743924][ T1] Segment Routing with IPv6 [ 0.744241][ T1] In-situ OAM (IOAM) with IPv6 [ 0.744581][ T1] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver [ 0.747414][ T1] 8021q: 802.1Q VLAN Support v1.8 [ 0.747745][ T1] 9pnet: Installing 9P2000 support [ 0.748207][ T1] IPI shorthand broadcast: enabled [ 0.775850][ T1] sched_clock: Marking stable (724003480, 48050232)->(776857705, -4803993) [ 0.832657][ T1] kmemleak: Kernel memory leak detector initialized (mem pool available: 14333) [ 0.832706][ T46] kmemleak: Automatic memory scanning thread started [ 0.833057][ T1] page_owner is disabled [ 0.834744][ T1] KTAP version 1 [ 0.834912][ T1] 1..0 [ 0.835822][ T1] debug: unmapping init [mem 0xffffffff82ae3000-0xffffffff82ddafff] [ 0.860361][ T1] Write protecting the kernel read-only data: 18432k [ 0.862563][ T1] debug: unmapping init [mem 0xffffffff8205a000-0xffffffff821fffff] [ 0.863383][ T1] Run /init as init process [ 0.863619][ T1] with arguments: [ 0.863814][ T1] /init [ 0.863979][ T1] with environment: [ 0.864208][ T1] HOME=/ [ 0.864362][ T1] TERM=linux [ 0.886564][ T47] mount (47) used greatest stack depth: 27160 bytes left [ 1.302853][ T1] dracut: Fedora Linux-39 [ 1.454644][ T112] NET: Registered PF_PACKET protocol family Waiting for network to come online... Enumeration completed lo: Configuring with /rapido-rsc/net/vm1/lo.network. eth0: Configuring with /rapido-rsc/net/vm1/rapido-tap1.network. [ 1.668350][ T124] 8021q: adding VLAN 0 to HW filter on device eth0 lo: Link UP lo: Gained carrier eth0: Link UP eth0: Gained carrier Rapido: starting /rapido_autorun/00-net_test_tn40xx.sh [ 1.770000][USPACE] Starting udevd [ 1.770000][USPACE] Loading Driver [ 1.832425][ T132] tn40xx: loading out-of-tree module taints kernel. [ 1.834656][ T132] Tehuti Network Driver from https://github.com/acooks/tn40xx-driver, 004 [ 1.834883][ T132] Supported phys : QT2025 TLK10232 AQR105 MUSTANG [ 1.835137][ T132] tn40xx 0000:00:04.0: vgaarb: pci_notify [ 1.835339][ T132] tn40xx 0000:00:04.0: runtime IRQ mapping not provided by arch Using default interface naming scheme 'v253'. [ 1.864827][ T132] ACPI: \_SB_.GSIE: Enabled at IRQ 20 [ 1.865604][ T132] tn40xx 0000:00:04.0: enabling bus mastering [ 1.866070][ T132] srom 0x0 HWver 16 build 0 lane# 0 max_pl 0x2 mrrs 0x2 [ 2.120497][ T132] PHY detected on port 1 ID=43A400 - QT2025 10Gbps SFP+ [ 3.884712][ T132] QT2025 FW version 2.0.3.3 module type 0x4 eth1: Configuring with /rapido-rsc/net/vm1/foo.network. [ 3.992930][ T132] fw 0xe [ 3.993341][ T132] eth1, Port A [ 3.993451][ T132] 1 1fc9:4022:1fc9:3015 [ 3.993649][ T132] detected 1 cards, 1 loaded [ 3.993830][ T132] tn40xx 0000:00:04.0: vgaarb: pci_notify [ 3.997738][ T132] modprobe (132) used greatest stack depth: 24952 bytes left [ 3.950000][USPACE] Let udev handle new device [ 4.031026][ T124] 8021q: adding VLAN 0 to HW filter on device eth1 eth1: Link UP [ 4.290000][USPACE] Waiting for dynamic IP addresses... [ 11.094220][ C1] eth1 Link Up 10G eth1: Gained carrier eth1: DHCPv4 address 10.1.4.116/24, gateway 10.1.4.1 acquired from 10.1.4.1 [ 11.530000][USPACE] Starting iperf3 [ 11.599800][ T162] ================================================================================ [ 11.600117][ T162] UBSAN: array-index-out-of-bounds in /home/acooks/tn40xx-driver/tn40.c:2952:32 [ 11.600371][ T162] index 1 is out of range for type 'pbl [*]' [ 11.600533][ T162] CPU: 1 PID: 162 Comm: iperf3 Tainted: G O 6.6.1 #13 [ 11.600773][ T162] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), B [ 11.600773][ T162] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-2.fc39 04/01/2014 [ 11.601028][ T162] Call Trace: [ 11.601124][ T162] <TASK> [ 11.601207][ T162] dump_stack_lvl+0x48/0x5b [ 11.601344][ T162] ubsan_epilogue+0x5/0x2c [ 11.601472][ T162] __ubsan_handle_out_of_bounds+0x64/0x6d [ 11.601631][ T162] bdx_tx_transmit+0x66c/0x921 [tn40xx] [ 11.601789][ T162] netdev_start_xmit+0x42/0x8e [ 11.601 [ 11.601926][ T162] dev_hard_start_xmit+0x109/0x1fe [ 11.602071][ T162] sch_direct_xmit+0x11c/0x34a [ 11.602206][ T162] ? pfifo_fast_reset+0xf9/0xf9 [ 11.602343][ T162] ? do_raw_spin_lock+0x151/0x151 [ 11.602486][ T162] ? rcu_read_lock_held_common+0x34/0x3c [ 11.602641][ T162] __dev_queue_xmit+0x93e/0xd28 [ 11.602775][ T162] ? eth_header+0x91/0xcc [ 11.602897][ T162] [ 11.602897][ T162] ? netdev_core_pick_tx+0x10c/0x10c [ 11.603046][ T162] ? arp_create+0x2d5/0x2ed [ 11.603171][ T162] ? arp_send_dst+0xd6/0xf7 [ 11.603297][ T162] arp_solicit+0x472/0x49d [ 11.603422][ T162] ? arp_send+0x18/0x18 [ 11.603538][ T162] neigh_probe+0x6e/0x92 [ 11.603661][ T162] __neigh_event_send+0x443/0x5a5 [ 11.603805][ T162] neigh_resolve_output+0x1b/0x1d3 [ [ 11.603949][ T162] ip_finish_output2+0x58c/0x5bd [ 11.604091][ T162] ? __ip_finish_output+0x125/0x16c [ 11.604234][ T162] __ip_queue_xmit+0x68e/0x6e3 [ 11.604367][ T162] ? skb_transport_header+0x2c/0x39 [ 11.604514][ T162] __tcp_transmit_skb+0x1018/0x108b [ 11.604664][ T162] ? tcp_call_bpf.isra.0+0x85/0xbf [ 11.604810][ T162] ? __tcp_select_window+0x31e/0x31e [ 11.604960][ T162] ? rb_insert_color+0x2a/0x204 [ 11.605098][ T162] tcp_connect+0x119c/0x1283 [ 11.605229][ T162] ? tcp_transmit_skb+0x40/0x40 [ 11.605367][ T162] ? netdev_pick_tx+0x2e4/0x456 [ 11.605502][ T162] tcp_v4_connect+0x848/0x8c5 [ 11.605640][ T162] ? tcp_bpf_ca_needs_ecn+0x1b/0x1b [ 11.605789][ T162] ? lock_acquire+0x19b/0x2e1 [ 11.605920][ T1 [ 11.605920][ T162] ? lock_sock_nested+0x4f/0x87 [ 11.606056][ T162] __inet_stream_connect+0x191/0x503 [ 11.606206][ T162] ? lock_time_inc+0x50/0x5f [ 11.606335][ T162] ? lock_release+0x292/0x37e [ 11.606468][ T162] ? signal_pending+0x45/0x45 [ 11.606604][ T162] ? mark_held_locks+0x1f/0x78 [ 11.606741][ T162] ? lockdep_hardirqs_on_prepare+0x1fd/0x21c [ 11.606910][ T162] [ 11.606910][ T162] inet_stream_connect+0x46/0x65 [ 11.607050][ T162] __sys_connect+0xa5/0xdf [ 11.607175][ T162] ? __sys_connect_file+0xae/0xae [ 11.607314][ T162] ? mark_held_locks+0x1f/0x78 [ 11.607451][ T162] __x64_sys_connect+0x3b/0x42 [ 11.607588][ T162] do_syscall_64+0x8a/0xaa [ 11.607714][ T162] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [ 11.607882][ T162] RIP: 0033:0x7f9 [ 11.607882][ T162] RIP: 0033:0x7f99f2447354 [ 11.608006][ T162] Code: 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 80 3d 15 90 0c 00 00 74 5 [ 11.608536][ T162] RSP: 002b:00007fff4e12d748 EFLAGS: 00000202 ORIG_RAX: 000000000000002a [ 11.608777][ T162] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f99f2447 [ 11.608777][ T162] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f99f2447354 [ 11.608996][ T162] RDX: 0000000000000010 RSI: 000055948304dc20 RDI: 0000000000000004 [ 11.609215][ T162] RBP: 00007fff4e12d7a0 R08: 0000000000000050 R09: 0000000000000001 [ 11.609435][ T162] R10: 0000000000000004 R11: 0000000000000202 R12: 0000000000000010 [ 11.609657][ T162] R13: 00000000ffffffff R14: 00007f99f257e000 R15: 000055948304dc20 [ 11.609875][ T162] </TASK> [ 11.609967][ T162] ================================================================================ Connecting to host 10.1.4.153, port 5201 [ 5] local 10.1.4.116 port 60398 connected to 10.1.4.153 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 115 MBytes 960 Mbits/sec 119 308 KBytes eth1: Gained IPv6LL eth1: DHCPv6 address 2403:580a:d3e9::717/128 (valid for 1h 57min 28s, preferred for 53min 43s) [ 5] 1.00-2.00 sec 112 MBytes 939 Mbits/sec 7 303 KBytes [ 5] 2.00-3.00 sec 113 MBytes 944 Mbits/sec 45 300 KBytes [ 5] 3.00-4.00 sec 112 MBytes 937 Mbits/sec 11 311 KBytes [ 5] 4.00-5.00 sec 113 MBytes 946 Mbits/sec 214 308 KBytes [ 5] 5.00-6.00 sec 112 MBytes 936 Mbits/sec 100 300 KBytes [ 5] 6.00-7.00 sec 113 MBytes 946 Mbits/sec 0 291 KBytes [ 5] 7.00-8.00 sec 112 MBytes 944 Mbits/sec 47 303 KBytes [ 5] 8.00-9.00 sec 112 MBytes 941 Mbits/sec 9 305 KBytes [ 5] 9.00-10.00 sec 112 MBytes 940 Mbits/sec 0 5.66 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.10 GBytes 943 Mbits/sec 552 sender [ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec [ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver iperf Done. [ 21.570000][USPACE] You can now do your manual testing... rapido1:/# rapido1:/# logout [ 25.714400][ T1] sysrq: Power Off qemu-system-x86_64: vtd_interrupt_remap_msi: MSI address low 32 bit invalid: 0x0 [ 26.010166][ T10] Device removed [ 26.010446][ T10] ACPI: PM: Preparing to enter system sleep state S5 [ 26.011110][ T10] reboot: Power down (termtosvg) [root@BBB rapido]# exit
0:00/0:00
Here's what's happening:
The test environement is started with one simple command: ./rapido cut net-test-tn40xx
A new initramfs is created;
Qemu boots a new VM, passing a real PCI network device from the host to the VM;
The kernel boots and loads the initramfs containing the test tools;
The developmental tn40xx driver loads;
Ethernet carrier is negotiated and IP addresses are assigned;
The Undefined Behavior Sanitizer (UBSAN) detects a bug in the tn40xx driver;
iperf3 client performs a simple tcp goodput test;
VM exits
Initramfs creation
Rapido takes care of building an initramfs (by calling dracut) that contains the software under test, test tools and scripted test steps.
Rapido uses a 'cut script' to define:
the name of the autorun test script (reminds me a bit of classic BSD-style init scripts, in a good way).
the VM resources (2 cores, 512M RAM)
additional drivers to install in the initramfs
userspace tools to install in the initramfs
Here is the 'cut' script used by rapido for generating the initramfs:
#!/bin/bash
# SPDX-License-Identifier: (LGPL-2.1 OR LGPL-3.0)
# Copyright (C) SUSE LLC 2022, all rights reserved.
RAPIDO_DIR = " $( realpath -e ${ 0 %/* } ) /.."
. " ${ RAPIDO_DIR } /runtime.vars"
_rt_require_dracut_args " $RAPIDO_DIR /autorun/net_test_tn40xx.sh" " $@ "
_rt_require_networking
_rt_cpu_resources_set "2"
_rt_mem_resources_set "512M"
" $DRACUT " \
--install "hostname lspci ip bridge ethtool iperf3 nc" \
--add-drivers "tn40xx" \
--modules "base" \
" ${ DRACUT_RAPIDO_ARGS [@] } " \
" $DRACUT_OUT " || _fail "dracut failed"
Virtual Machine definition
Rapido also starts qemu after creating the initramfs. I've configured it to add a virtual IOMMU and pass the physical PCIe NIC to the VM.
Here's the snippet of the QEMU extra arguments in my rapido.conf file:
QEMU_EXTRA_ARGS = "\
-M q35,accel=kvm,kernel-irqchip=split \
-cpu host \
-nographic\
-device intel-iommu,intremap=on,caching-mode=on,device-iotlb=on \
-device virtio-rng \
-device vfio-pci,host=07:00.0 \
"
The passed-through vfio-pci device would be better in a cut script, because it doesn't apply to all VMs. TODO
Kernel boots
The kernel running here is the mainline 6.6.1 version. I've compiled it with debugging options appropriate for the driver development it's used for here. The ~1.5 second boot time is pretty good, although the debugging options makes the output more verbose and also has a noticeable performance cost.
Driver loads, tests happen
The test script in the screencast is this:
#!/bin/bash
# SPDX-License-Identifier: (LGPL-2.1 OR LGPL-3.0)
# Copyright (C) SUSE LLC 2022, all rights reserved.
_vm_ar_env_check || exit 1
_vm_ar_dyn_debug_enable
now() {
declare -a _uptime
readarray -d " " -t _uptime < /proc/uptime
printf "[%12s][USPACE] " " ${ _uptime [0] } 0000"
}
now; echo "Starting udevd"
/usr/lib/systemd/systemd-udevd &
now; echo "Loading Driver"
modprobe tn40xx || _fatal "Failed to load tn40xx module"
now; echo "Waiting for dynamic IP addresses..."
READY = $( ip -oneline -4 addr show dev eth1 scope global)
while [ -z " $READY " ] ; do
sleep 1
READY = $( ip -oneline -4 addr show dev eth1 scope global)
done
now; echo "Starting iperf3"
iperf3 -c 10 .1.4.153
now; echo "You can now do your manual testing..."
I thought it would be nice to have timestamps on the userspace output as well, so I added a little function for it.
There are opportunities for improvement here too:
a number of hardcoded system attributes that should be moved out of the test logic, eg. eth1
;
the test results should be stored for later analysis;
The actual test steps for a network interface card need some thought. Something like this:
Cover various ioctls using ethtool
.
Add/remove change VLANs
Change MTU
Promiscuous mode
Receive Multicast groups
TSO / GSO
driver unload / module removal
...
But this is a start :)
At some point I should also get a proper reference NIC like an Intel X520-DA2 as a benchmark. Update: Got an X550 T2 on loan from a friend. Thanks, Simeon!
Conclusion
An efficient, repeatable test workflow is essential for all development. This is my first meaningful progress towards developing the tn40xx driver in five years and I can now start thinking about what tests are useful, doing regular releases and tackling the major rework it needs.
It's also quite satisfying to be able to progress three topics I find interesting in one post:
development of the tn40xx driver
real hardware device passthrough to VMs, with IOMMU memory protection
ephemeral Linux-based micro VMs
Let the healing begin!