public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer 03/14] run env: network: add kernel driver name to network interface info
Date: Tue, 14 Oct 2025 15:21:48 +0200	[thread overview]
Message-ID: <20251014132207.1171073-4-c.heiss@proxmox.com> (raw)
In-Reply-To: <20251014132207.1171073-1-c.heiss@proxmox.com>

This information is already available in the GUI, this makes it possible
to show it in the TUI too.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
 Proxmox/Install/RunEnv.pm                                | 7 +++++++
 .../fqdn_from_dhcp_no_default_domain.run-env.json        | 9 +++++++++
 .../parse_answer_fail/no_fqdn_from_dhcp.run-env.json     | 9 +++++++++
 proxmox-auto-installer/tests/resources/run-env-info.json | 9 +++++++++
 proxmox-installer-common/src/options.rs                  | 2 ++
 proxmox-installer-common/src/setup.rs                    | 3 +++
 6 files changed, 39 insertions(+)

diff --git a/Proxmox/Install/RunEnv.pm b/Proxmox/Install/RunEnv.pm
index f0fa6ec..40a9621 100644
--- a/Proxmox/Install/RunEnv.pm
+++ b/Proxmox/Install/RunEnv.pm
@@ -72,6 +72,9 @@ sub query_cpu_info : prototype() {
 #         mac => <mac address>,
 #         index => <index>,
 #         name => <ifname>,
+#         state => <UP|DOWN|LOWERLAYERDOWN|DORMANT|TESTING|NOTPRESENT|UNKNOWN>,
+#         pinned_id => <sequential numerical ID>,
+#         driver => <driver name>,
 #         addresses => [
 #             family => <inet|inet6>,
 #             address => <mac address>,
@@ -113,12 +116,16 @@ my sub query_netdevs : prototype() {
             }
         }
 
+        my $driver = readlink "/sys/class/net/$name/device/driver" || 'unknown';
+        $driver =~ s!^.*/!!;
+
         $ifs->{$name} = {
             index => $index,
             name => $name,
             pinned_id => "${pinned_counter}",
             mac => $mac,
             state => uc($state),
+            driver => $driver,
         };
         $ifs->{$name}->{addresses} = \@valid_addrs if @valid_addrs;
 
diff --git a/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json b/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json
index e7c2205..4c41c13 100644
--- a/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json
+++ b/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json
@@ -182,6 +182,7 @@
         "mac": "b4:2e:99:ac:ad:b4",
         "name": "eno1",
         "state": "UP",
+        "driver": "igb",
         "pinned_id": "0"
       },
       "eno2": {
@@ -189,6 +190,7 @@
         "mac": "b4:2e:99:ac:ad:b5",
         "name": "eno2",
         "state": "UP",
+        "driver": "igb",
         "pinned_id": "1"
       },
       "enp129s0f0np0": {
@@ -196,6 +198,7 @@
         "mac": "1c:34:da:5c:5e:24",
         "name": "enp129s0f0np0",
         "state": "DOWN",
+        "driver": "mlx5_core",
         "pinned_id": "2"
       },
       "enp129s0f1np1": {
@@ -203,6 +206,7 @@
         "mac": "1c:34:da:5c:5e:25",
         "name": "enp129s0f1np1",
         "state": "DOWN",
+        "driver": "mlx5_core",
         "pinned_id": "3"
       },
       "enp193s0f0np0": {
@@ -210,6 +214,7 @@
         "mac": "24:8a:07:1e:05:bc",
         "name": "enp193s0f0np0",
         "state": "UP",
+        "driver": "mlx5_core",
         "pinned_id": "4"
       },
       "enp193s0f1np1": {
@@ -217,6 +222,7 @@
         "mac": "24:8a:07:1e:05:bd",
         "name": "enp193s0f1np1",
         "state": "DOWN",
+        "driver": "mlx5_core",
         "pinned_id": "5"
       },
       "enp65s0f0": {
@@ -224,6 +230,7 @@
         "mac": "a0:36:9f:0a:b3:82",
         "name": "enp65s0f0",
         "state": "DOWN",
+        "driver": "igb",
         "pinned_id": "6"
       },
       "enp65s0f1": {
@@ -231,6 +238,7 @@
         "mac": "a0:36:9f:0a:b3:83",
         "name": "enp65s0f1",
         "state": "DOWN",
+        "driver": "igb",
         "pinned_id": "7"
       },
       "enx5a4732ddc747": {
@@ -238,6 +246,7 @@
         "mac": "5a:47:32:dd:c7:47",
         "name": "enx5a4732ddc747",
         "state": "UNKNOWN",
+        "driver": "cdc_ether",
         "pinned_id": "8"
       }
     },
diff --git a/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json b/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json
index 47d7bde..fa4e834 100644
--- a/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json
+++ b/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json
@@ -181,6 +181,7 @@
         "mac": "b4:2e:99:ac:ad:b4",
         "name": "eno1",
         "state": "UP",
+        "driver": "igb",
         "pinned_id": "0"
       },
       "eno2": {
@@ -188,6 +189,7 @@
         "mac": "b4:2e:99:ac:ad:b5",
         "name": "eno2",
         "state": "UP",
+        "driver": "igb",
         "pinned_id": "1"
       },
       "enp129s0f0np0": {
@@ -195,6 +197,7 @@
         "mac": "1c:34:da:5c:5e:24",
         "name": "enp129s0f0np0",
         "state": "DOWN",
+        "driver": "mlx5_core",
         "pinned_id": "2"
       },
       "enp129s0f1np1": {
@@ -202,6 +205,7 @@
         "mac": "1c:34:da:5c:5e:25",
         "name": "enp129s0f1np1",
         "state": "DOWN",
+        "driver": "mlx5_core",
         "pinned_id": "3"
       },
       "enp193s0f0np0": {
@@ -209,6 +213,7 @@
         "mac": "24:8a:07:1e:05:bc",
         "name": "enp193s0f0np0",
         "state": "UP",
+        "driver": "mlx5_core",
         "pinned_id": "4"
       },
       "enp193s0f1np1": {
@@ -216,6 +221,7 @@
         "mac": "24:8a:07:1e:05:bd",
         "name": "enp193s0f1np1",
         "state": "DOWN",
+        "driver": "mlx5_core",
         "pinned_id": "5"
       },
       "enp65s0f0": {
@@ -223,6 +229,7 @@
         "mac": "a0:36:9f:0a:b3:82",
         "name": "enp65s0f0",
         "state": "DOWN",
+        "driver": "igb",
         "pinned_id": "6"
       },
       "enp65s0f1": {
@@ -230,6 +237,7 @@
         "mac": "a0:36:9f:0a:b3:83",
         "name": "enp65s0f1",
         "state": "DOWN",
+        "driver": "igb",
         "pinned_id": "7"
       },
       "enx5a4732ddc747": {
@@ -237,6 +245,7 @@
         "mac": "5a:47:32:dd:c7:47",
         "name": "enx5a4732ddc747",
         "state": "UNKNOWN",
+        "driver": "cdc_ether",
         "pinned_id": "8"
       }
     },
diff --git a/proxmox-auto-installer/tests/resources/run-env-info.json b/proxmox-auto-installer/tests/resources/run-env-info.json
index 5291721..add5f2a 100644
--- a/proxmox-auto-installer/tests/resources/run-env-info.json
+++ b/proxmox-auto-installer/tests/resources/run-env-info.json
@@ -182,6 +182,7 @@
         "mac": "b4:2e:99:ac:ad:b4",
         "name": "eno1",
         "state": "UP",
+        "driver": "igb",
         "pinned_id": "0"
       },
       "eno2": {
@@ -189,6 +190,7 @@
         "mac": "b4:2e:99:ac:ad:b5",
         "name": "eno2",
         "state": "UP",
+        "driver": "igb",
         "pinned_id": "1"
       },
       "enp129s0f0np0": {
@@ -196,6 +198,7 @@
         "mac": "1c:34:da:5c:5e:24",
         "name": "enp129s0f0np0",
         "state": "DOWN",
+        "driver": "mlx5_core",
         "pinned_id": "2"
       },
       "enp129s0f1np1": {
@@ -203,6 +206,7 @@
         "mac": "1c:34:da:5c:5e:25",
         "name": "enp129s0f1np1",
         "state": "DOWN",
+        "driver": "mlx5_core",
         "pinned_id": "3"
       },
       "enp193s0f0np0": {
@@ -210,6 +214,7 @@
         "mac": "24:8a:07:1e:05:bc",
         "name": "enp193s0f0np0",
         "state": "UP",
+        "driver": "mlx5_core",
         "pinned_id": "4"
       },
       "enp193s0f1np1": {
@@ -217,6 +222,7 @@
         "mac": "24:8a:07:1e:05:bd",
         "name": "enp193s0f1np1",
         "state": "DOWN",
+        "driver": "mlx5_core",
         "pinned_id": "5"
       },
       "enp65s0f0": {
@@ -224,6 +230,7 @@
         "mac": "a0:36:9f:0a:b3:82",
         "name": "enp65s0f0",
         "state": "DOWN",
+        "driver": "igb",
         "pinned_id": "6"
       },
       "enp65s0f1": {
@@ -231,6 +238,7 @@
         "mac": "a0:36:9f:0a:b3:83",
         "name": "enp65s0f1",
         "state": "DOWN",
+        "driver": "igb",
         "pinned_id": "7"
       },
       "enx5a4732ddc747": {
@@ -238,6 +246,7 @@
         "mac": "5a:47:32:dd:c7:47",
         "name": "enx5a4732ddc747",
         "state": "UNKNOWN",
+        "driver": "cdc_ether",
         "pinned_id": "8"
       }
     },
diff --git a/proxmox-installer-common/src/options.rs b/proxmox-installer-common/src/options.rs
index 48c77c9..50fd74e 100644
--- a/proxmox-installer-common/src/options.rs
+++ b/proxmox-installer-common/src/options.rs
@@ -677,6 +677,7 @@ mod tests {
                 name: "eth0".to_owned(),
                 index: 0,
                 state: InterfaceState::Up,
+                driver: "dummy".to_owned(),
                 mac: "01:23:45:67:89:ab".to_owned(),
                 addresses: Some(vec![
                     CidrAddress::new(Ipv4Addr::new(192, 168, 0, 2), 24).unwrap(),
@@ -804,6 +805,7 @@ mod tests {
                 name: "eth0".to_owned(),
                 index: 0,
                 state: InterfaceState::Up,
+                driver: "dummy".to_owned(),
                 mac: "01:23:45:67:89:ab".to_owned(),
                 addresses: None,
             },
diff --git a/proxmox-installer-common/src/setup.rs b/proxmox-installer-common/src/setup.rs
index 66cea72..4fda39d 100644
--- a/proxmox-installer-common/src/setup.rs
+++ b/proxmox-installer-common/src/setup.rs
@@ -473,6 +473,9 @@ pub struct Interface {
 
     pub state: InterfaceState,
 
+    /// Kernel driver name that claims this interface.
+    pub driver: String,
+
     #[serde(default)]
     #[serde(deserialize_with = "deserialize_cidr_list")]
     pub addresses: Option<Vec<CidrAddress>>,
-- 
2.51.0



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2025-10-14 13:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14 13:21 [pve-devel] [PATCH installer 00/14] support network interface name pinning Christoph Heiss
2025-10-14 13:21 ` [pve-devel] [PATCH installer 01/14] test: parse-kernel-cmdline: fix module import statement Christoph Heiss
2025-10-14 13:21 ` [pve-devel] [PATCH installer 02/14] install: add support for network interface name pinning Christoph Heiss
2025-10-14 13:21 ` Christoph Heiss [this message]
2025-10-14 13:21 ` [pve-devel] [PATCH installer 04/14] common: utils: fix clippy warnings Christoph Heiss
2025-10-14 13:21 ` [pve-devel] [PATCH installer 05/14] common: setup: simplify network address list serialization Christoph Heiss
2025-10-14 13:21 ` [pve-devel] [PATCH installer 06/14] common: implement support for `network_interface_pin_map` config Christoph Heiss
2025-10-14 13:21 ` [pve-devel] [PATCH installer 07/14] auto: add support for pinning network interface names Christoph Heiss
2025-10-14 13:21 ` [pve-devel] [PATCH installer 08/14] assistant: verify network settings in `validate-answer` subcommand Christoph Heiss
2025-10-14 13:21 ` [pve-devel] [PATCH installer 09/14] post-hook: avoid redundant Option<bool> for (de-)serialization Christoph Heiss
2025-10-14 13:21 ` [pve-devel] [PATCH installer 10/14] post-hook: add network interface name and pinning status Christoph Heiss
2025-10-14 13:21 ` [pve-devel] [PATCH installer 11/14] tui: views: move network options view to own module Christoph Heiss
2025-10-14 13:21 ` [pve-devel] [PATCH installer 12/14] tui: views: form: allow attaching user-defined data to children Christoph Heiss
2025-10-14 13:21 ` [pve-devel] [PATCH installer 13/14] tui: add support for pinning network interface names Christoph Heiss
2025-10-14 13:21 ` [pve-devel] [PATCH installer 14/14] gui: " Christoph Heiss
2025-10-14 15:04   ` Maximiliano Sandoval
2025-10-16 12:01     ` Christoph Heiss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251014132207.1171073-4-c.heiss@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal