Bug 1392426

Summary: Add support to generate network interface name from phys_port_name
Product: Red Hat Enterprise Linux 7 Reporter: Ivan Vecera <ivecera>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Branislav Blaškovič <bblaskov>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: bblaskov, eladr, ivecera, jiri, jshortt, liali, systemd-maint-list
Target Milestone: pre-dev-freeze   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://github.com/systemd/systemd/commit/4887b656c22af059d4e833de7b56544f24951184
Whiteboard:
Fixed In Version: systemd-219-31.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1425737 (view as bug list) Environment:
Last Closed: 2017-08-01 09:12:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ivan Vecera 2016-11-07 13:30:04 UTC
Switch drivers uses phys_port_name attribute to pass front panel port name to user. Use it to generate netdev names.

Upstream implementation:
https://github.com/systemd/systemd/commit/4887b656c22af059d4e833de7b56544f24951184

Comment 1 Lukáš Nykrýn 2016-11-07 13:50:34 UTC
What about existing installation, wouldn't this change the names of devices for those systems?

Comment 2 Ivan Vecera 2016-11-07 14:48:21 UTC
No, phys_port_name attribute is reported only by switchdev drivers (mlxsw & rocker) that are not supported yet and will be supported in RHEL7.4. So there are no existing installations.

Comment 3 Lukáš Nykrýn 2016-11-07 15:15:16 UTC
Ok great, than in that case devel_ack+

Comment 4 Lukáš Nykrýn 2017-01-19 09:42:19 UTC
https://github.com/lnykryn/systemd-rhel/pull/80

Comment 5 Ivan Vecera 2017-01-19 13:06:06 UTC
Thanks Lukas... I have tested your backport and everything works fine.

Comment 6 Branislav Blaškovič 2017-02-06 13:41:55 UTC
qa_ack+ for 7.4

Comment 7 Lukáš Nykrýn 2017-02-06 15:31:45 UTC
fix merged to upstream staging branch ->
https://github.com/lnykryn/systemd-rhel/commit/192545bc67fed763ac54761ca067b9c2f93ecdd1
-> post

Comment 11 errata-xmlrpc 2017-08-01 09:12:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2297

Comment 12 LiLiang 2017-09-19 05:52:56 UTC
Hi Ivan,

#cat /etc/udev/rules.d/10-local.rules 
SUBSYSTEM=="net", ACTION=="add", ATTR{phys_switch_id}=="7cfe90ff2cc0", \
	ATTR{phys_port_name}!="", NAME="sw1$attr{phys_port_name}"

this bug means i can use phys_port_name in udev rules now?

if this bug is not resolved, i can't use phys_port_name in udev rules ?

I just want to confirm this for writing case. thanks.

Comment 13 Ivan Vecera 2017-09-19 12:24:40 UTC
(In reply to LiLiang from comment #12)
> Hi Ivan,
> 
> #cat /etc/udev/rules.d/10-local.rules 
> SUBSYSTEM=="net", ACTION=="add", ATTR{phys_switch_id}=="7cfe90ff2cc0", \
> 	ATTR{phys_port_name}!="", NAME="sw1$attr{phys_port_name}"
> 
> this bug means i can use phys_port_name in udev rules now?
Yes, but you don't need such rule. With this BZ resolved udev will use phys_port_name by default.

> if this bug is not resolved, i can't use phys_port_name in udev rules ?
No, if this bug is not resolved then udev won't use phys_port_name by default but if you have local rule like the above one then it will work.

Comment 14 LiLiang 2017-09-20 01:37:51 UTC
(In reply to Ivan Vecera from comment #13)
> (In reply to LiLiang from comment #12)
> > Hi Ivan,
> > 
> > #cat /etc/udev/rules.d/10-local.rules 
> > SUBSYSTEM=="net", ACTION=="add", ATTR{phys_switch_id}=="7cfe90ff2cc0", \
> > 	ATTR{phys_port_name}!="", NAME="sw1$attr{phys_port_name}"
> > 
> > this bug means i can use phys_port_name in udev rules now?
> Yes, but you don't need such rule. With this BZ resolved udev will use
> phys_port_name by default.
> 
> > if this bug is not resolved, i can't use phys_port_name in udev rules ?
> No, if this bug is not resolved then udev won't use phys_port_name by
> default but if you have local rule like the above one then it will work.

Thanks a lot:)

Comment 15 LiLiang 2017-09-20 03:21:50 UTC
Hi Ivan,

Where is the default udev rule ? I can't find it in "/etc/udev/rules.d/" .

Do you think i need to write a test case to verify "the default interface name conform to the default rule" ?

Comment 16 Ivan Vecera 2017-09-20 12:10:11 UTC
(In reply to LiLiang from comment #15)
> Hi Ivan,
> 
> Where is the default udev rule ? I can't find it in "/etc/udev/rules.d/" .
/usr/lib/udev/rules.d/

> Do you think i need to write a test case to verify "the default interface
> name conform to the default rule" ?
I don't think so.