Skip to content

Commit d518348

Browse files
committed
Merge: ixgbe: prevent from unwanted interface name changes
MR: https://gitlab.com/redhat/rhel/src/kernel/rhel-9/-/merge_requests/4407 JIRA: https://issues.redhat.com/browse/RHEL-109607 - c5ec7f4 devlink: let driver opt out of automatic phys_port_name generation - e67a0bc ixgbe: prevent from unwanted interface name changes Signed-off-by: CKI Backport Bot <[email protected]> Signed-off-by: Michal Schmidt <[email protected]> Approved-by: Antoine Tenart <[email protected]> Approved-by: Kamal Heib <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Augusto Caringi <[email protected]>
2 parents f2ae811 + 1d983c6 commit d518348

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

drivers/net/ethernet/intel/ixgbe/devlink/devlink.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ int ixgbe_devlink_register_port(struct ixgbe_adapter *adapter)
543543

544544
attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL;
545545
attrs.phys.port_number = adapter->hw.bus.func;
546+
attrs.no_phys_port_name = 1;
546547
ixgbe_devlink_set_switch_id(adapter, &attrs.switch_id);
547548

548549
devlink_port_attrs_set(devlink_port, &attrs);

include/net/devlink.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ struct devlink_port_pci_sf_attrs {
8080
* @flavour: flavour of the port
8181
* @split: indicates if this is split port
8282
* @splittable: indicates if the port can be split.
83+
* @no_phys_port_name: skip automatic phys_port_name generation; for
84+
* compatibility only, newly added driver/port instance
85+
* should never set this.
8386
* @lanes: maximum number of lanes the port supports. 0 value is not passed to netlink.
8487
* @switch_id: if the port is part of switch, this is buffer with ID, otherwise this is NULL
8588
* @phys: physical port attributes
@@ -89,7 +92,8 @@ struct devlink_port_pci_sf_attrs {
8992
*/
9093
struct devlink_port_attrs {
9194
u8 split:1,
92-
splittable:1;
95+
splittable:1,
96+
no_phys_port_name:1;
9397
u32 lanes;
9498
enum devlink_port_flavour flavour;
9599
struct netdev_phys_item_id switch_id;

net/devlink/port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ static int __devlink_port_phys_port_name_get(struct devlink_port *devlink_port,
15191519
struct devlink_port_attrs *attrs = &devlink_port->attrs;
15201520
int n = 0;
15211521

1522-
if (!devlink_port->attrs_set)
1522+
if (!devlink_port->attrs_set || devlink_port->attrs.no_phys_port_name)
15231523
return -EOPNOTSUPP;
15241524

15251525
switch (attrs->flavour) {

0 commit comments

Comments
 (0)