From 47f77443dd2e363d83c75b7bddf18ba962e35b77 Mon Sep 17 00:00:00 2001 From: Richie Cahill Date: Thu, 9 Jul 2026 10:44:37 -0400 Subject: [PATCH] feat(networking): configure unused network ports to prevent errors and optimize boot time --- systems/jeeves/networking.nix | 19 +++++++++++++++++++ systems/jeeves/services/systemd.nix | 14 ++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/systems/jeeves/networking.nix b/systems/jeeves/networking.nix index 34a9919..9be9867 100644 --- a/systems/jeeves/networking.nix +++ b/systems/jeeves/networking.nix @@ -22,6 +22,11 @@ ]; }; useNetworkd = true; + # Without this, unconfigured NICs get a catch-all DHCP network and + # join the LAN uninvited (how the dead atlantic card ended up + # ARP-poisoning 192.168.99.14). Every interface must be configured + # explicitly below. + useDHCP = false; }; systemd.network = { @@ -46,6 +51,20 @@ }; }; networks = { + # Unused second port of the onboard i350; keep it down so the dead + # PCIe link (see dmesg "PCIe link lost") stops logging Tx errors. + "01-unused-igb-port" = { + matchConfig.Name = "enp97s0f0"; + linkConfig.ActivationPolicy = "always-down"; + }; + # Aquantia 10G card (0000:21:00.0); loses PCIe link, and its + # unicast RX path is dead while TX still works, so when it's up it + # answers ARP for the host IPs and black-holes the replies. Keep + # it down until the card is fixed or replaced. + "01-unused-atlantic-port" = { + matchConfig.Name = "enp33s0"; + linkConfig.ActivationPolicy = "always-down"; + }; "10-Primary" = { matchConfig.Name = "enp97s0f1"; address = [ "192.168.99.14/24" ]; diff --git a/systems/jeeves/services/systemd.nix b/systems/jeeves/services/systemd.nix index 07f8cb7..f56bad4 100644 --- a/systems/jeeves/services/systemd.nix +++ b/systems/jeeves/services/systemd.nix @@ -16,6 +16,20 @@ in ExecStart = "${pkgs.bash}/bin/bash ${../scripts/plex_permission.sh}"; }; }; + # The unused onboard i350 port hangs ~90s after every boot ("PCIe + # link lost", MMIO reads return all-Fs) even with pcie_aspm=off. + # Remove it from the PCI bus so nothing (hwmon temperature polls, + # networkd) touches the dead hardware. Reversible via + # `echo 1 > /sys/bus/pci/rescan`. + remove_dead_igb_port = { + wantedBy = [ "multi-user.target" ]; + description = "removes hung i350 port 0000:61:00.0 from the PCI bus"; + unitConfig.ConditionPathExists = "/sys/bus/pci/devices/0000:61:00.0/remove"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.bash}/bin/bash -c 'echo 1 > /sys/bus/pci/devices/0000:61:00.0/remove'"; + }; + }; startup_validation = { requires = [ "network-online.target" ]; after = [ "network-online.target" ];