Re: [systemd-devel] system is not match systemd.link configs

2024-10-29 Thread Henti Smith
On Tue, 29 Oct 2024 at 15:00, Mantas Mikulėnas  wrote:

> On Tue, Oct 29, 2024, 09:51 Henti Smith  wrote:
>
>> On Mon, 28 Oct 2024 at 19:17, Mantas Mikulėnas  wrote:
>>
>>> On Mon, Oct 28, 2024 at 8:54 PM Henti Smith 
>>> wrote:
>>>
 Where can I find detailed information on where to find the names when
 systemd-udevd sees the interface for the first time ?

>>>
>>> At that point, they are just the original kernel names: "eth0", "eth1",
>>> etc.
>>>
>>
>> I'm going to look today with kernel parameter net.ifnames=0 to see what
>> the names are. Maybe this will point at a way forward.
>>
>>
>>> In other words, at that point in time it is not "earlier renaming" but
>>> "future renaming", and the udev rule that processes your .link file is the
>>> very same rule that *would've* renamed the interface to "eno2"
>>> otherwise.
>>>
>>>

 Silvio in my previous mail thread commented that I can use udevadm
 info which is what I'm trying to do here. Is there another method to get
 the "pre systemd" interface names that I should be using ?

 I cannot use mac addresses to match on, nor the Path as both are not
 reliable in my use case, hence using the full DEVPATH from udevadm.

>>>
>>> Do you mean that .../:00:10.0/:05:00.0 is reliable, but
>>> .../:05:00.0 in itself is not? In that case, it might be possible to
>>> write a .network file or an udev rule that matches just these two
>>> parameters, but without comparing against "enoX" or "enpX".
>>>
>>> For example, maybe:
>>>   Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/eth*
>>>
>>
>> I'll attempt today with wildcards and see what the result is, but based
>> on the man page, all options implicitly mention glob support while property
>> doesn't, but I'll try.
>>
>>
>>> If networkd doesn't accept wildcards, then an udev rule may work:
>>>   DEVPATH==" /devices/pci:00/:00:11.0/:06:00.0/net/*",
>>> NAME="mvc-sw1"
>>> eno2 would also have ATTRS{index}=="2" from the firmware.
>>>
>>
>> I went the udev route initially, however Lennart advised that I should
>> stick with link files. All the rest of our networking is being done in
>> systemd-network, so this aligned with our current configuration methods.
>>
>
> It sounds like .link files aren't sufficiently flexible for your use case
> though. At least, if .link files need to be involved, then you might need
> to use udev rules to set a custom property via ENV{} and then match that
> from a .link file via Property=. (For example, match by devpath wildcard
> and set ENV{devboard_port}="1", or possibly copy the parent's ID_PATH into
> the child's PARENT_PATH...)
>

It looks like glob does work with the Property field in  link files.

I've updated the link files to match on
"Property=DEVPATH=/devices/pci:00/:00:10.0/:05:00.0/net/*" and
that is working.

I'll continue testing and feedback, but if globbing is supported in
Property, making that clear in the documentation will be very helpful.

Kind regards
Henti


Re: [systemd-devel] system is not match systemd.link configs

2024-10-29 Thread Mantas Mikulėnas
On Tue, Oct 29, 2024, 09:51 Henti Smith  wrote:

> On Mon, 28 Oct 2024 at 19:17, Mantas Mikulėnas  wrote:
>
>> On Mon, Oct 28, 2024 at 8:54 PM Henti Smith 
>> wrote:
>>
>>> Where can I find detailed information on where to find the names when
>>> systemd-udevd sees the interface for the first time ?
>>>
>>
>> At that point, they are just the original kernel names: "eth0", "eth1",
>> etc.
>>
>
> I'm going to look today with kernel parameter net.ifnames=0 to see what
> the names are. Maybe this will point at a way forward.
>
>
>> In other words, at that point in time it is not "earlier renaming" but
>> "future renaming", and the udev rule that processes your .link file is the
>> very same rule that *would've* renamed the interface to "eno2" otherwise.
>>
>>
>>>
>>> Silvio in my previous mail thread commented that I can use udevadm info
>>> which is what I'm trying to do here. Is there another method to get the
>>> "pre systemd" interface names that I should be using ?
>>>
>>> I cannot use mac addresses to match on, nor the Path as both are not
>>> reliable in my use case, hence using the full DEVPATH from udevadm.
>>>
>>
>> Do you mean that .../:00:10.0/:05:00.0 is reliable, but
>> .../:05:00.0 in itself is not? In that case, it might be possible to
>> write a .network file or an udev rule that matches just these two
>> parameters, but without comparing against "enoX" or "enpX".
>>
>> For example, maybe:
>>   Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/eth*
>>
>
> I'll attempt today with wildcards and see what the result is, but based on
> the man page, all options implicitly mention glob support while property
> doesn't, but I'll try.
>
>
>> If networkd doesn't accept wildcards, then an udev rule may work:
>>   DEVPATH==" /devices/pci:00/:00:11.0/:06:00.0/net/*",
>> NAME="mvc-sw1"
>> eno2 would also have ATTRS{index}=="2" from the firmware.
>>
>
> I went the udev route initially, however Lennart advised that I should
> stick with link files. All the rest of our networking is being done in
> systemd-network, so this aligned with our current configuration methods.
>

It sounds like .link files aren't sufficiently flexible for your use case
though. At least, if .link files need to be involved, then you might need
to use udev rules to set a custom property via ENV{} and then match that
from a .link file via Property=. (For example, match by devpath wildcard
and set ENV{devboard_port}="1", or possibly copy the parent's ID_PATH into
the child's PARENT_PATH...)


Re: [systemd-devel] system is not match systemd.link configs

2024-10-29 Thread Henti Smith
On Mon, 28 Oct 2024 at 19:17, Mantas Mikulėnas  wrote:

> On Mon, Oct 28, 2024 at 8:54 PM Henti Smith 
> wrote:
>
>> Where can I find detailed information on where to find the names when
>> systemd-udevd sees the interface for the first time ?
>>
>
> At that point, they are just the original kernel names: "eth0", "eth1",
> etc.
>

I'm going to look today with kernel parameter net.ifnames=0 to see what the
names are. Maybe this will point at a way forward.


> In other words, at that point in time it is not "earlier renaming" but
> "future renaming", and the udev rule that processes your .link file is the
> very same rule that *would've* renamed the interface to "eno2" otherwise.
>
>
>>
>> Silvio in my previous mail thread commented that I can use udevadm info
>> which is what I'm trying to do here. Is there another method to get the
>> "pre systemd" interface names that I should be using ?
>>
>> I cannot use mac addresses to match on, nor the Path as both are not
>> reliable in my use case, hence using the full DEVPATH from udevadm.
>>
>
> Do you mean that .../:00:10.0/:05:00.0 is reliable, but
> .../:05:00.0 in itself is not? In that case, it might be possible to
> write a .network file or an udev rule that matches just these two
> parameters, but without comparing against "enoX" or "enpX".
>
> For example, maybe:
>   Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/eth*
>

I'll attempt today with wildcards and see what the result is, but based on
the man page, all options implicitly mention glob support while property
doesn't, but I'll try.


> If networkd doesn't accept wildcards, then an udev rule may work:
>   DEVPATH==" /devices/pci:00/:00:11.0/:06:00.0/net/*",
> NAME="mvc-sw1"
> eno2 would also have ATTRS{index}=="2" from the firmware.
>

I went the udev route initially, however Lennart advised that I should
stick with link files. All the rest of our networking is being done in
systemd-network, so this aligned with our current configuration methods.

I'll try udev as well.

Kind regards
Henti


Re: [systemd-devel] system is not match systemd.link configs

2024-10-29 Thread Andrei Borzenkov
On Mon, Oct 28, 2024 at 10:17 PM Mantas Mikulėnas  wrote:
>
> For example, maybe:
>   Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/eth*

Does Property accept wildcards? Manual does not mention it, only
selected directives are described as accepting "shell style globs".

> If networkd doesn't accept wildcards, then an udev rule may work:
>   DEVPATH==" /devices/pci:00/:00:11.0/:06:00.0/net/*", 
> NAME="mvc-sw1"
> eno2 would also have ATTRS{index}=="2" from the firmware.
>
> --
> Mantas Mikulėnas


Re: [systemd-devel] system is not match systemd.link configs

2024-10-28 Thread Henti Smith
On Mon, 28 Oct 2024 at 19:24, Silvio Knizek  wrote:

> Am Montag, dem 28.10.2024 um 17:56 + schrieb Henti Smith:
> > On Mon, 28 Oct 2024 at 13:47, Andrei Borzenkov <[[email protected]
> ](mailto:[email protected])> wrote:
> >
> > > On Mon, Oct 28, 2024 at 3:07 PM Henti Smith <[[email protected]
> ](mailto:[email protected])> wrote:
> > > >
> > > > On Mon, 28 Oct 2024 at 10:38, Andrei Borzenkov <[[email protected]
> ](mailto:[email protected])> wrote:
> > > > >
> > > > > On Thu, Oct 24, 2024 at 6:29 PM Henti Smith <[
> [email protected]](mailto:[email protected])> wrote:
> > > > > >
> > > > > > Good day everybody
> > > > > >
> > > > > > I have two link files for mvc-sw1 and mvc-sw2.
> > > > > >
> > > > > > `mvc-sw1`
> > > > > >
> > > > > > ```ini
> > > > > > # Fixed MAC and name for eno2 (Switch 1 connection) when debug
> board is plugged in
> > > > > > # Renamed to mvc-sw1 by PCI Address and set custom MAC address.
> > > > > > [Match]
> > > > > >
> Property=DEVPATH=/devices/pci:00/:00:10.0/:05:00.0/net/eno2
> > > > > >
> > > > > > [Link]
> > > > > > MACAddress=02:00:00:00:05:00
> > > > > > Name=mvc-sw1
> > > > > > ```
> > > > > >
> > > > > > `mvc-sw2`
> > > > > >
> > > > > > ```ini
> > > > > > # Fixed MAC and name for enp6s0 (Block Diagram) when debug board
> is plugged in
> > > > > > # Renamed to mvc-sw2 by PCI Address and set custom MAC address.
> > > > > > [Match]
> > > > > >
> Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
> > > > > > ```
> > > > >
> > > > > These names are already the result of earlier renamoing. I am not
> sure systemd/udev/networkd will rename the second time.
> > > >
> > > > Would that be udev ?
> > > >
> > > > we're trying hard to use systemd for all our network management. If
> this is not a realistic goal, what is the correct way of managing our
> network with systemd alongside other tools ?
> > >
> > > Yes, networkd.link files provide the desired names and naming policy,
> it is systemd-udevd that applies them.
> > >
> > > You need to match on some intrinsic device properties and these rules
> must be present when systemd-udevd first sees and renames these interfaces.
> Which often means in initrd/initramfs.
> >
> > Good evening Andrei,
> >
> > Where can I find detailed information on where to find the names when
> systemd-udevd sees the interface for the first time ?
> >
> > Silvio in my previous mail thread commented that I can use  udevadm info
> which is what I'm trying to do here. Is there another method to get the
> "pre systemd" interface names that I should be using ?
> >
> > I cannot use mac addresses to match on, nor the Path as both are not
> reliable in my use case, hence using the full DEVPATH from udevadm.
> >
> > Any assistance will be appreciated.
> >
> > Kind regards
> > Henti
>
> Hi,
>
> why do you use
> `Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0`
> and not `Path=:06:00.0`, as stated by ?
>

We have PCI debug boards that get added and removed during use and that
increments and decrements the PCI addresses. I have two devices on
consecutive PCI addresses but different bus addresses, so I'm trying to
match on bus address not the slot address.
The only way I've been able to find to do that is using the full DEVPATH,
but for that I need the interface name as well.


> What systemd version do you use, so I can reference online? Also, is your
> `.link` file applied? What are `networkctl status` and `networkctl status
> ` saying? What says `udevadmin info
> /sys/class/net/` for all the  interfaces in question?
>

Focal ubuntu, systemd 245.4

I'll have to check tomorrow at the office for networkctl status and the
udevadm info was in my first mail, but I'll add it below again.

```
P: /devices/pci:00/:00:10.0/:05:00.0/net/eno2
L: 0
E: DEVPATH=/devices/pci:00/:00:10.0/:05:00.0/net/eno2
E: INTERFACE=eno2
E: IFINDEX=4
E: SUBSYSTEM=net
E: USEC_INITIALIZED=8968404
E: ID_NET_NAMING_SCHEME=v245
E: ID_NET_NAME_ONBOARD=eno2
E: ID_NET_LABEL_ONBOARD=Onboard ETHERNET Controller
E: ID_NET_NAME_PATH=enp5s0
E: ID_BUS=pci
E: ID_VENDOR_ID=0x11ab
E: ID_MODEL_ID=0x0f13
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Marvell Technology Group Ltd.
E: ID_PATH=pci-:05:00.0
E: ID_PATH_TAG=pci-_05_00_0
E: ID_NET_DRIVER=oak
E: ID_NET_LINK_FILE=/etc/systemd/network/10-oxb-mvc-sw1-debug.link
E: ID_NET_NAME=eno2
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/eno2
/sys/subsystem/net/devices/eno2
E: TAGS=:systemd:
```

```
P: /devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
L: 0
E: DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
E: INTERFACE=enp6s0
E: IFINDEX=5
E: SUBSYSTEM=net
E: USEC_INITIALIZED=8928106
E: ID_NET_NAMING_SCHEME=v245
E: ID_NET_NAME_PATH=enp6s0
E: ID_BUS=pci
E: ID_VENDOR_ID=0x11ab
E: ID_MODEL_ID=0x0f13
E: ID_PCI_CLASS_FROM_DATABASE=Network 

Re: [systemd-devel] system is not match systemd.link configs

2024-10-28 Thread Silvio Knizek
Am Montag, dem 28.10.2024 um 17:56 + schrieb Henti Smith:
> On Mon, 28 Oct 2024 at 13:47, Andrei Borzenkov 
> <[[email protected]](mailto:[email protected])> wrote:
> 
> > On Mon, Oct 28, 2024 at 3:07 PM Henti Smith 
> > <[[email protected]](mailto:[email protected])> wrote:  
> > >  
> > > On Mon, 28 Oct 2024 at 10:38, Andrei Borzenkov 
> > > <[[email protected]](mailto:[email protected])> wrote:  
> > > >  
> > > > On Thu, Oct 24, 2024 at 6:29 PM Henti Smith 
> > > > <[[email protected]](mailto:[email protected])> wrote:  
> > > > >  
> > > > > Good day everybody  
> > > > >  
> > > > > I have two link files for mvc-sw1 and mvc-sw2.  
> > > > >  
> > > > > `mvc-sw1`
> > > > >
> > > > > ```ini
> > > > > # Fixed MAC and name for eno2 (Switch 1 connection) when debug board 
> > > > > is plugged in
> > > > > # Renamed to mvc-sw1 by PCI Address and set custom MAC address.
> > > > > [Match]
> > > > > Property=DEVPATH=/devices/pci:00/:00:10.0/:05:00.0/net/eno2
> > > > > 
> > > > > [Link]
> > > > > MACAddress=02:00:00:00:05:00
> > > > > Name=mvc-sw1
> > > > > ```
> > > > > 
> > > > > `mvc-sw2`
> > > > >
> > > > > ```ini
> > > > > # Fixed MAC and name for enp6s0 (Block Diagram) when debug board is 
> > > > > plugged in
> > > > > # Renamed to mvc-sw2 by PCI Address and set custom MAC address.
> > > > > [Match]
> > > > > Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
> > > > > ```
> > > > 
> > > > These names are already the result of earlier renamoing. I am not sure 
> > > > systemd/udev/networkd will rename the second time.
> > >
> > > Would that be udev ?  
> > >  
> > > we're trying hard to use systemd for all our network management. If this 
> > > is not a realistic goal, what is the correct way of managing our network 
> > > with systemd alongside other tools ?
> > 
> > Yes, networkd.link files provide the desired names and naming policy, it is 
> > systemd-udevd that applies them.  
> > 
> > You need to match on some intrinsic device properties and these rules must 
> > be present when systemd-udevd first sees and renames these interfaces. 
> > Which often means in initrd/initramfs.
> 
> Good evening Andrei, 
> 
> Where can I find detailed information on where to find the names when 
> systemd-udevd sees the interface for the first time ?
> 
> Silvio in my previous mail thread commented that I can use  udevadm info 
> which is what I'm trying to do here. Is there another method to get the "pre 
> systemd" interface names that I should be using ?
> 
> I cannot use mac addresses to match on, nor the Path as both are not reliable 
> in my use case, hence using the full DEVPATH from udevadm.
> 
> Any assistance will be appreciated.
> 
> Kind regards  
> Henti

Hi,

why do you use 
`Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0` and 
not `Path=:06:00.0`, as stated by ?

What systemd version do you use, so I can reference online? Also, is your 
`.link` file applied? What are `networkctl status` and `networkctl status 
` saying? What says `udevadmin info 
/sys/class/net/` for all the  interfaces in question?

In the end, if your interface locations or hardware properties are *not* 
reliable, than *no* automatism in the world would be able to assign static 
values to them.

BR  
Silvio



Re: [systemd-devel] system is not match systemd.link configs

2024-10-28 Thread Mantas Mikulėnas
On Mon, Oct 28, 2024 at 8:54 PM Henti Smith  wrote:

> Where can I find detailed information on where to find the names when
> systemd-udevd sees the interface for the first time ?
>

At that point, they are just the original kernel names: "eth0", "eth1", etc.

In other words, at that point in time it is not "earlier renaming" but
"future renaming", and the udev rule that processes your .link file is the
very same rule that *would've* renamed the interface to "eno2" otherwise.


>
> Silvio in my previous mail thread commented that I can use udevadm info
> which is what I'm trying to do here. Is there another method to get the
> "pre systemd" interface names that I should be using ?
>
> I cannot use mac addresses to match on, nor the Path as both are not
> reliable in my use case, hence using the full DEVPATH from udevadm.
>

Do you mean that .../:00:10.0/:05:00.0 is reliable, but
.../:05:00.0 in itself is not? In that case, it might be possible to
write a .network file or an udev rule that matches just these two
parameters, but without comparing against "enoX" or "enpX".

For example, maybe:
  Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/eth*
If networkd doesn't accept wildcards, then an udev rule may work:
  DEVPATH==" /devices/pci:00/:00:11.0/:06:00.0/net/*",
NAME="mvc-sw1"
eno2 would also have ATTRS{index}=="2" from the firmware.

-- 
Mantas Mikulėnas


Re: [systemd-devel] system is not match systemd.link configs

2024-10-28 Thread Henti Smith
On Mon, 28 Oct 2024 at 13:47, Andrei Borzenkov  wrote:

> On Mon, Oct 28, 2024 at 3:07 PM Henti Smith 
> wrote:
> >
> > On Mon, 28 Oct 2024 at 10:38, Andrei Borzenkov 
> wrote:
> >>
> >> On Thu, Oct 24, 2024 at 6:29 PM Henti Smith 
> wrote:
> >> >
> >> > Good day everybody
> >> >
> >> > I have two link files for mvc-sw1 and mvc-sw2.
> >> >
> >> > # mvc-sw1
> >> > ```
> >> > # Fixed MAC and name for eno2 (Switch 1 connection) when debug board
> is plugged in
> >> > # Renamed to mvc-sw1 by PCI Address and set custom MAC address.
> >> > [Match]
> >> >
> Property=DEVPATH=/devices/pci:00/:00:10.0/:05:00.0/net/eno2
> >> >
> >> > [Link]
> >> > MACAddress=02:00:00:00:05:00
> >> > Name=mvc-sw1
> >> > ```
> >> >
> >> > # mvc-sw2
> >> > ```
> >> > # Fixed MAC and name for enp6s0 (Block Diagram) when debug board is
> plugged in
> >> > # Renamed to mvc-sw2 by PCI Address and set custom MAC address.
> >> > [Match]
> >> >
> Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
> >> >
> >>
> >> These names are already the result of earlier renamoing. I am not sure
> >> systemd/udev/networkd will rename the second time.
> >>
> >
> > Would that be udev ?
> >
> > we're trying hard to use systemd for all our network management. If this
> is not a realistic goal, what is the correct way of managing our network
> with systemd alongside other tools ?
> >
>
> Yes, networkd.link files provide the desired names and naming policy,
> it is systemd-udevd that applies them.
>
> You need to match on some intrinsic device properties and these rules
> must be present when systemd-udevd first sees and renames these
> interfaces. Which often means in initrd/initramfs.
>

Good evening Andrei,

Where can I find detailed information on where to find the names when
systemd-udevd sees the interface for the first time ?

Silvio in my previous mail thread commented that I can use udevadm info
which is what I'm trying to do here. Is there another method to get the
"pre systemd" interface names that I should be using ?

I cannot use mac addresses to match on, nor the Path as both are not
reliable in my use case, hence using the full DEVPATH from udevadm.

Any assistance will be appreciated.

Kind regards
Henti


Re: [systemd-devel] system is not match systemd.link configs

2024-10-28 Thread Andrei Borzenkov
On Mon, Oct 28, 2024 at 3:07 PM Henti Smith  wrote:
>
> On Mon, 28 Oct 2024 at 10:38, Andrei Borzenkov  wrote:
>>
>> On Thu, Oct 24, 2024 at 6:29 PM Henti Smith  wrote:
>> >
>> > Good day everybody
>> >
>> > I have two link files for mvc-sw1 and mvc-sw2.
>> >
>> > # mvc-sw1
>> > ```
>> > # Fixed MAC and name for eno2 (Switch 1 connection) when debug board is 
>> > plugged in
>> > # Renamed to mvc-sw1 by PCI Address and set custom MAC address.
>> > [Match]
>> > Property=DEVPATH=/devices/pci:00/:00:10.0/:05:00.0/net/eno2
>> >
>> > [Link]
>> > MACAddress=02:00:00:00:05:00
>> > Name=mvc-sw1
>> > ```
>> >
>> > # mvc-sw2
>> > ```
>> > # Fixed MAC and name for enp6s0 (Block Diagram) when debug board is 
>> > plugged in
>> > # Renamed to mvc-sw2 by PCI Address and set custom MAC address.
>> > [Match]
>> > Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
>> >
>>
>> These names are already the result of earlier renamoing. I am not sure
>> systemd/udev/networkd will rename the second time.
>>
>
> Would that be udev ?
>
> we're trying hard to use systemd for all our network management. If this is 
> not a realistic goal, what is the correct way of managing our network with 
> systemd alongside other tools ?
>

Yes, networkd.link files provide the desired names and naming policy,
it is systemd-udevd that applies them.

You need to match on some intrinsic device properties and these rules
must be present when systemd-udevd first sees and renames these
interfaces. Which often means in initrd/initramfs.


Re: [systemd-devel] system is not match systemd.link configs

2024-10-28 Thread Henti Smith
Can anybody assist with this ?

kind regards
Henti

On Thu, 24 Oct 2024 at 16:28, Henti Smith  wrote:

> Good day everybody
>
> I have two link files for mvc-sw1 and mvc-sw2.
>
> # mvc-sw1
> ```
> # Fixed MAC and name for eno2 (Switch 1 connection) when debug board is
> plugged in
> # Renamed to mvc-sw1 by PCI Address and set custom MAC address.
> [Match]
> Property=DEVPATH=/devices/pci:00/:00:10.0/:05:00.0/net/eno2
>
> [Link]
> MACAddress=02:00:00:00:05:00
> Name=mvc-sw1
> ```
>
> # mvc-sw2
> ```
> # Fixed MAC and name for enp6s0 (Block Diagram) when debug board is
> plugged in
> # Renamed to mvc-sw2 by PCI Address and set custom MAC address.
> [Match]
> Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
>
> [Link]
> MACAddress=02:00:00:00:06:00
> Name=mvc-sw2
> ```
>
> I update the initrd file and rebooted and the system comes up with eno2
> and enp6s0 instead of the expected mvc-sw1 and mvc-sw1.
> Looking at udevadm info I get the following
> ```
> P: /devices/pci:00/:00:10.0/:05:00.0/net/eno2
> L: 0
> E: DEVPATH=/devices/pci:00/:00:10.0/:05:00.0/net/eno2
> E: INTERFACE=eno2
> E: IFINDEX=4
> E: SUBSYSTEM=net
> E: USEC_INITIALIZED=8968404
> E: ID_NET_NAMING_SCHEME=v245
> E: ID_NET_NAME_ONBOARD=eno2
> E: ID_NET_LABEL_ONBOARD=Onboard ETHERNET Controller
> E: ID_NET_NAME_PATH=enp5s0
> E: ID_BUS=pci
> E: ID_VENDOR_ID=0x11ab
> E: ID_MODEL_ID=0x0f13
> E: ID_PCI_CLASS_FROM_DATABASE=Network controller
> E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
> E: ID_VENDOR_FROM_DATABASE=Marvell Technology Group Ltd.
> E: ID_PATH=pci-:05:00.0
> E: ID_PATH_TAG=pci-_05_00_0
> E: ID_NET_DRIVER=oak
> E: ID_NET_LINK_FILE=/etc/systemd/network/10-oxb-mvc-sw1-debug.link
> E: ID_NET_NAME=eno2
> E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/eno2
> /sys/subsystem/net/devices/eno2
> E: TAGS=:systemd:
> ```
>
> ```
> P: /devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
> L: 0
> E: DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
> E: INTERFACE=enp6s0
> E: IFINDEX=5
> E: SUBSYSTEM=net
> E: USEC_INITIALIZED=8928106
> E: ID_NET_NAMING_SCHEME=v245
> E: ID_NET_NAME_PATH=enp6s0
> E: ID_BUS=pci
> E: ID_VENDOR_ID=0x11ab
> E: ID_MODEL_ID=0x0f13
> E: ID_PCI_CLASS_FROM_DATABASE=Network controller
> E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
> E: ID_VENDOR_FROM_DATABASE=Marvell Technology Group Ltd.
> E: ID_PATH=pci-:06:00.0
> E: ID_PATH_TAG=pci-_06_00_0
> E: ID_NET_DRIVER=oak
> E: ID_NET_LINK_FILE=/etc/systemd/network/10-oxb-mvc-sw2-debug.link
> E: ID_NET_NAME=enp6s0
> E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp6s0
> /sys/subsystem/net/devices/enp6s0
> E: TAGS=:systemd:
> ```
>
> ID_NET_LINK_FILE seems to indicate it used the link file, but I'm not sure
> why the interface names were not changed ?
>
> I'm on Ubuntu Focal 245.4
>
> Any guidance would be appreciated.
>
> Kind regards
> Henti
>


Re: [systemd-devel] system is not match systemd.link configs

2024-10-28 Thread Henti Smith
On Mon, 28 Oct 2024 at 10:38, Andrei Borzenkov  wrote:

> On Thu, Oct 24, 2024 at 6:29 PM Henti Smith 
> wrote:
> >
> > Good day everybody
> >
> > I have two link files for mvc-sw1 and mvc-sw2.
> >
> > # mvc-sw1
> > ```
> > # Fixed MAC and name for eno2 (Switch 1 connection) when debug board is
> plugged in
> > # Renamed to mvc-sw1 by PCI Address and set custom MAC address.
> > [Match]
> > Property=DEVPATH=/devices/pci:00/:00:10.0/:05:00.0/net/eno2
> >
> > [Link]
> > MACAddress=02:00:00:00:05:00
> > Name=mvc-sw1
> > ```
> >
> > # mvc-sw2
> > ```
> > # Fixed MAC and name for enp6s0 (Block Diagram) when debug board is
> plugged in
> > # Renamed to mvc-sw2 by PCI Address and set custom MAC address.
> > [Match]
> > Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
> >
>
> These names are already the result of earlier renamoing. I am not sure
> systemd/udev/networkd will rename the second time.
>
>
Would that be udev ?

we're trying hard to use systemd for all our network management. If this is
not a realistic goal, what is the correct way of managing our network with
systemd alongside other tools ?

Kind regards
Henti


Re: [systemd-devel] system is not match systemd.link configs

2024-10-28 Thread Andrei Borzenkov
On Thu, Oct 24, 2024 at 6:29 PM Henti Smith  wrote:
>
> Good day everybody
>
> I have two link files for mvc-sw1 and mvc-sw2.
>
> # mvc-sw1
> ```
> # Fixed MAC and name for eno2 (Switch 1 connection) when debug board is 
> plugged in
> # Renamed to mvc-sw1 by PCI Address and set custom MAC address.
> [Match]
> Property=DEVPATH=/devices/pci:00/:00:10.0/:05:00.0/net/eno2
>
> [Link]
> MACAddress=02:00:00:00:05:00
> Name=mvc-sw1
> ```
>
> # mvc-sw2
> ```
> # Fixed MAC and name for enp6s0 (Block Diagram) when debug board is plugged in
> # Renamed to mvc-sw2 by PCI Address and set custom MAC address.
> [Match]
> Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
>

These names are already the result of earlier renamoing. I am not sure
systemd/udev/networkd will rename the second time.

> [Link]
> MACAddress=02:00:00:00:06:00
> Name=mvc-sw2
> ```
>
> I update the initrd file and rebooted and the system comes up with eno2 and 
> enp6s0 instead of the expected mvc-sw1 and mvc-sw1.
> Looking at udevadm info I get the following
> ```
> P: /devices/pci:00/:00:10.0/:05:00.0/net/eno2
> L: 0
> E: DEVPATH=/devices/pci:00/:00:10.0/:05:00.0/net/eno2
> E: INTERFACE=eno2
> E: IFINDEX=4
> E: SUBSYSTEM=net
> E: USEC_INITIALIZED=8968404
> E: ID_NET_NAMING_SCHEME=v245
> E: ID_NET_NAME_ONBOARD=eno2
> E: ID_NET_LABEL_ONBOARD=Onboard ETHERNET Controller
> E: ID_NET_NAME_PATH=enp5s0
> E: ID_BUS=pci
> E: ID_VENDOR_ID=0x11ab
> E: ID_MODEL_ID=0x0f13
> E: ID_PCI_CLASS_FROM_DATABASE=Network controller
> E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
> E: ID_VENDOR_FROM_DATABASE=Marvell Technology Group Ltd.
> E: ID_PATH=pci-:05:00.0
> E: ID_PATH_TAG=pci-_05_00_0
> E: ID_NET_DRIVER=oak
> E: ID_NET_LINK_FILE=/etc/systemd/network/10-oxb-mvc-sw1-debug.link
> E: ID_NET_NAME=eno2
> E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/eno2 
> /sys/subsystem/net/devices/eno2
> E: TAGS=:systemd:
> ```
>
> ```
> P: /devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
> L: 0
> E: DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
> E: INTERFACE=enp6s0
> E: IFINDEX=5
> E: SUBSYSTEM=net
> E: USEC_INITIALIZED=8928106
> E: ID_NET_NAMING_SCHEME=v245
> E: ID_NET_NAME_PATH=enp6s0
> E: ID_BUS=pci
> E: ID_VENDOR_ID=0x11ab
> E: ID_MODEL_ID=0x0f13
> E: ID_PCI_CLASS_FROM_DATABASE=Network controller
> E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
> E: ID_VENDOR_FROM_DATABASE=Marvell Technology Group Ltd.
> E: ID_PATH=pci-:06:00.0
> E: ID_PATH_TAG=pci-_06_00_0
> E: ID_NET_DRIVER=oak
> E: ID_NET_LINK_FILE=/etc/systemd/network/10-oxb-mvc-sw2-debug.link
> E: ID_NET_NAME=enp6s0
> E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp6s0 
> /sys/subsystem/net/devices/enp6s0
> E: TAGS=:systemd:
> ```
>
> ID_NET_LINK_FILE seems to indicate it used the link file, but I'm not sure 
> why the interface names were not changed ?
>
> I'm on Ubuntu Focal 245.4
>
> Any guidance would be appreciated.
>
> Kind regards
> Henti


[systemd-devel] system is not match systemd.link configs

2024-10-24 Thread Henti Smith
Good day everybody

I have two link files for mvc-sw1 and mvc-sw2.

# mvc-sw1
```
# Fixed MAC and name for eno2 (Switch 1 connection) when debug board is
plugged in
# Renamed to mvc-sw1 by PCI Address and set custom MAC address.
[Match]
Property=DEVPATH=/devices/pci:00/:00:10.0/:05:00.0/net/eno2

[Link]
MACAddress=02:00:00:00:05:00
Name=mvc-sw1
```

# mvc-sw2
```
# Fixed MAC and name for enp6s0 (Block Diagram) when debug board is plugged
in
# Renamed to mvc-sw2 by PCI Address and set custom MAC address.
[Match]
Property=DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0

[Link]
MACAddress=02:00:00:00:06:00
Name=mvc-sw2
```

I update the initrd file and rebooted and the system comes up with eno2 and
enp6s0 instead of the expected mvc-sw1 and mvc-sw1.
Looking at udevadm info I get the following
```
P: /devices/pci:00/:00:10.0/:05:00.0/net/eno2
L: 0
E: DEVPATH=/devices/pci:00/:00:10.0/:05:00.0/net/eno2
E: INTERFACE=eno2
E: IFINDEX=4
E: SUBSYSTEM=net
E: USEC_INITIALIZED=8968404
E: ID_NET_NAMING_SCHEME=v245
E: ID_NET_NAME_ONBOARD=eno2
E: ID_NET_LABEL_ONBOARD=Onboard ETHERNET Controller
E: ID_NET_NAME_PATH=enp5s0
E: ID_BUS=pci
E: ID_VENDOR_ID=0x11ab
E: ID_MODEL_ID=0x0f13
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Marvell Technology Group Ltd.
E: ID_PATH=pci-:05:00.0
E: ID_PATH_TAG=pci-_05_00_0
E: ID_NET_DRIVER=oak
E: ID_NET_LINK_FILE=/etc/systemd/network/10-oxb-mvc-sw1-debug.link
E: ID_NET_NAME=eno2
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/eno2
/sys/subsystem/net/devices/eno2
E: TAGS=:systemd:
```

```
P: /devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
L: 0
E: DEVPATH=/devices/pci:00/:00:11.0/:06:00.0/net/enp6s0
E: INTERFACE=enp6s0
E: IFINDEX=5
E: SUBSYSTEM=net
E: USEC_INITIALIZED=8928106
E: ID_NET_NAMING_SCHEME=v245
E: ID_NET_NAME_PATH=enp6s0
E: ID_BUS=pci
E: ID_VENDOR_ID=0x11ab
E: ID_MODEL_ID=0x0f13
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Marvell Technology Group Ltd.
E: ID_PATH=pci-:06:00.0
E: ID_PATH_TAG=pci-_06_00_0
E: ID_NET_DRIVER=oak
E: ID_NET_LINK_FILE=/etc/systemd/network/10-oxb-mvc-sw2-debug.link
E: ID_NET_NAME=enp6s0
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp6s0
/sys/subsystem/net/devices/enp6s0
E: TAGS=:systemd:
```

ID_NET_LINK_FILE seems to indicate it used the link file, but I'm not sure
why the interface names were not changed ?

I'm on Ubuntu Focal 245.4

Any guidance would be appreciated.

Kind regards
Henti