Skip to content

arm without devices = leaves no PCI function adoptable; takeover also waits ~3 s per missing NIC #2

Open

Description

@7z0423arsenova

What happens

With a kmorph.conf that has no devices = key, a takeover adopts no PCI function at all.
kmorphd's network restore then waits about 3 s for every recorded NIC that never appears, so
the takeover takes 6.8 s instead of 0.9 s in my setup. The README lists devices as optional.

Setup

  • multikernel/linux 57fd249 (7.0.0-mk4), kmorph 9ec046e (= current main), x86_64, GCC 16.2.1
  • QEMU 11.1.3, q35, KVM, 4 vCPUs, 4 GiB; two NICs behind PCIe root ports
    (virtio-net at 0000:01:00.0, e1000e at 0000:02:00.0)
  • cpus = 1, memory = 128MB, console = ttyS0, cmdline = earlyprintk=serial,ttyS0,115200 keep_bootcon printk.devkmsg=on
  • predecessor crashed with echo c > /proc/sysrq-trigger

Without devices = (7 runs; panic to TAKEN_OVER 6.76 to 6.90 s)

Overlay tx2: +device 0000:00:1f.2 driver=none -> successor
Failed to move device 0000:00:1f.2: -1
kmorphd: error: device 0000:00:1f.2 not adopted (tx 2): Input/output error
... same for 0000:00:1f.3, 0000:01:00.0, 0000:02:00.0
kmorphd: adopted 0 devices: 0 reset, 0 quiesced
kmorphd: warning: network: no interface on 0000:01:00.0 for eth0: Connection timed out
kmorphd: warning: network: no interface on 0000:02:00.0 for eth1: Connection timed out

With devices = 0000:01:00.0 (20 runs in two sessions; panic to TAKEN_OVER 0.84 to 1.03 s)

mk_pcifront: Host fenced: config space is reached directly through ECAM
mk_pcifront: Root bus 0000:00 from /pci@0,0
mk_pcifront: Root bus 0000:02 from /pci@0,2
e1000e 0000:02:00.0 eth1: (PCI Express:2.5GT/s:Width x1) 52:54:00:12:34:57
kmorphd: adopted 3 devices: 1 reset, 2 quiesced
kmorphd: network: eth1 on 0000:02:00.0 restored with 0 addresses and 0 routes

Why (from reading the kernel, not from a debugger)

mk_pcifront_host_fenced() returns early when the successor has no PCI bus
(kernel/multikernel/pcifront.c:150-153), so mk_pcifront_direct_access stays false and
mk_pcifront_adopt_function() returns -EPERM (:704). A successor only has PCI buses for devices
it owns from boot.

Suggestions (none tested)

  • Warn in kmorph arm when devices names no PCI device, or say in the README and
    kmorph.conf.example that it is needed for PCI adoption.
  • Skip the 3 s wait in the network restore for functions whose adoption just failed.

Not checked: real hardware.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions