[pve-devel] [RFC common] add and use physical NIC regexp

Alexandre DERUMIER aderumier at odiso.com
Mon May 22 16:58:29 CEST 2017


>>where do you get the pXpY from? the "new" udev names for ethernet
>>devices all start with "en" followed by one of[1]

mmm, I'm still using ethX on my debians.

but on rhel/centos, I have emX  pour embedded devices and pxpx for pci.

but indeed, on my laptop archlinux, I have eno1.

Seem that it was intermediate transition names between 2 udev/systemd releases ?

so it should be ok with en..


----- Mail original -----
De: "Fabian Grünbichler" <f.gruenbichler at proxmox.com>
À: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Lundi 22 Mai 2017 13:00:33
Objet: Re: [pve-devel] [RFC common] add and use physical NIC regexp

On Mon, May 22, 2017 at 12:36:16PM +0200, Alexandre DERUMIER wrote: 
> >>+our $PHYSICAL_NIC_RE = qr/(?:eth\d+|en[^:.]+|ib\d+)/; 
> 
> can also be p(\d+)p(\d+) 
> 
> p1p1 
> p1p2 
> p2p1 
> p2p2 
> p2p3 
> p2p4 
> 
> 
> (pci port / nic port number) 

possibly, but I did not want to change the behaviour, just make the code 
cleaner ;) 

where do you get the pXpY from? the "new" udev names for ethernet 
devices all start with "en" followed by one of[1] 

* b<number> — BCMA bus core number 
* c<bus_id> — bus id of a grouped CCW or CCW device, 
* with all leading zeros stripped [s390] 
* o<index>[n<phys_port_name>|d<dev_port>] 
* — on-board device index number 
* s<slot>[f<function>][n<phys_port_name>|d<dev_port>] 
* — hotplug slot index number 
* x<MAC> — MAC address 
* [P<domain>]p<bus>s<slot>[f<function>][n<phys_port_name>|d<dev_port>] 
* — PCI geographical location 
* [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>] 
* — USB port number chain 
* v<slot> - VIO slot number (IBM PowerVM) 
* a<vendor><model>i<instance> — Platform bus ACPI instance id 

all of those should be handled by "en[^:.]+". 

the non-ethernet prefixes (for wireless lan, wireless wan and serial) 
are not relevant for us. 

1: https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id.c#L29 

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




More information about the pve-devel mailing list