Public bug reported:

[Impact]

* This SRU back ports support for the new udev property
ID_NET_NAME_INCLUDE_DOMAIN, allowing per-device control over domain
inclusion in interface name. This change provides hardware enablement
for Microsoft Azure Network Adapter (MANA) devices.

* In current Ubuntu LTS releases, systemd-udevd always includes the PCI domain 
in network interface names whenever the PCI domain index is greater than 0. 
This results in interface names such as:
With domain: enP2p0s0
Without domain: enp0s0

* There is no mechanism in Jammy/Noble/Questing to suppress the
P<domain> segment.

* On Microsoft Azure, MANA devices commonly appear under non-zero PCI
domains. However, Azure platform expectations and tooling assume
interface names do not include the PCI domain segment. As a result, MANA
interfaces currently receive unstable or unexpected names on Ubuntu LTS.

* As part of this change corresponding hwdb entry is added for MANA devices 
(PCI Vendor 0x1414, Device 0x00ba) which explicitly sets:
ID_NET_NAME_INCLUDE_DOMAIN=0

* This SRU consists of four components:
  - Core Support (net_id), upstream 19491cc:
Add recognition of ID_NET_NAME_INCLUDE_DOMAIN. If set to 0, the P<domain> 
segment is omitted even when domain > 0.

  - MANA Enablement (hwdb), upstream 9311c28:
Add a new hwdb entry matching the MANA PCI ID to set 
ID_NET_NAME_INCLUDE_DOMAIN=0.

  - udev/rules.d ordering fix, upstream a7deadd:
Ensure hwdb properties are imported before the net_id builtin runs, so the new 
property is honored.

- jammy-only helper, upstream 15345fc:
Backport device_get_property_bool(), which helps out jammy backport.

* Upstream patches which are back ported as part of this SRU are already
available in Resolute and partially in Questing

[Test Plan]
Test 1: MANA enablement on Azure
Provision an Ubuntu Jammy or Noble VM with MANA support (e.g., Standard_D*v5).
Verify the MANA NIC is assigned a non-zero PCI domain.
Install the updated systemd package and reboot.
Run:
udevadm info /sys/class/net/<mana-interface>

Verify:
ID_NET_NAME_INCLUDE_DOMAIN=0 is present.

Verify:
The interface name does not include the domain segment.
Example expected transformation:
Before: enP2p0s0
After: enp0s0
Confirm normal network connectivity after rename.


Test 2: Mock virtio_net device on PCI domain > 0
Goal of this test is to mock virtio_net device on PCI domain 1 and verify if 
ID_NET_NAME_PATH is set accordingly.
For this test umockdev can be used to modify PCI domain on already existing 
device.
1. Add virtio_net to hwdb
sudo nano /usr/lib/udev/hwdb.d/20-net-ifname.hwdb
# Disable inclusion of PCI domain in interface names on Azure MANA
pci:v00001414d000000BA*
 ID_NET_NAME_INCLUDE_DOMAIN=0

pci:v00001AF4d00001041*
 ID_NET_NAME_INCLUDE_DOMAIN=0

2. Update hwdb
sudo systemd-hwdb update

3. Check current settings:
systemd-hwdb query "pci:v00001AF4d00001041*"
ID_VENDOR_FROM_DATABASE=Red Hat, Inc.
ID_MODEL_FROM_DATABASE=Virtio 1.0 network device
ID_NET_NAME_INCLUDE_DOMAIN=0

4. Mock virtio device on PCI domain 1
umockdev-run --device domain1.umockdev -- bash

5. test net_id and check ID_NET_NAME_PATH
udevadm test-builtin net_id 
/sys/devices/pci0001:00/0001:00:02.0/0001:01:00.0/virtio1/net/enp1s0/
expected output:
ID_NET_NAME_PATH=enp1s0

[Where Problems Could Occur]
1. Interface renaming due to overly broad hwdb matching
If the hwdb entry incorrectly matches non-MANA devices, those devices could 
receive ID_NET_NAME_INCLUDE_DOMAIN=0 and lose their domain segment, causing 
interface renames on upgrade.

2. Rule ordering changes
Commit a7deadd ensures hwdb is imported before running the net_id builtin.
Any custom site rules relying on the previous order may behave differently, 
although upstream considers the new ordering correct.

3. Jammy Backport Risk
Jammy carries the most technical risk because it predates all upstream changes 
related to device_get_property_bool(), the ordering fix, and the 
domain-inclusion feature. Much of the functionality had to be manually adapted 
to Jammy older sd-device, udev, and net_id codebases, as the upstream patches 
do not apply cleanly.
This manual backporting increases the chance of subtle issues in property 
parsing, fallback logic, boolean evaluation, and overall consistency. Any such 
error could cause system-wide misinterpretation of udev properties, not just 
for network devices. This is the most significant risk area of the SRU.

[Other Info]
* Backport Strategy
  - Noble:
Core net_id support + MANA hwdb entry + ordering fix.
  - Jammy:
Everything required for Noble plus the helper function 
device_get_property_bool().
  - Questing:
Only requires the core support patch (19491cc), as the other components are 
already present.

* domain1.umockdev file used in Test2 added as attachment

* noble systemd with patches applied is available in ppa:
https://launchpad.net/~rmalz/+archive/ubuntu/sf00420640-domain

* Upstream Commits Included
https://github.com/systemd/systemd/commit/19491cc90f52704c32f129aa804f43045151c873
https://github.com/systemd/systemd/commit/9311c28b3407fbad69d0b747129b03ce1c7a6309
https://github.com/systemd/systemd/commit/a7deadd763427fcff67b6697557dfbd0c91647ec
https://github.com/systemd/systemd/commit/15345fc67739b8b62bcde55521a882d826faf801

** Affects: systemd (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2134334

Title:
  Add ID_NET_NAME_INCLUDE_DOMAIN property support to systemd

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2134334/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to