Skip to content

Commit

Permalink
net: dsa: set name_assign_type to NET_NAME_ENUM for enumerated user p…
Browse files Browse the repository at this point in the history
…orts

When a user port does not have a label in device tree, and we thus
fall back to the eth%d scheme, the proper constant to use is
NET_NAME_ENUM. See also commit e9f656b ("net: ethernet: set
default assignment identifier to NET_NAME_ENUM"), which in turn quoted
commit 685343f ("net: add name_assign_type netdev attribute"):

    ... when the kernel has given the interface a name using global
    device enumeration based on order of discovery (ethX, wlanY, etc)
    ... are labelled NET_NAME_ENUM.

Signed-off-by: Rasmus Villemoes <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Villemoes authored and kuba-moo committed Nov 18, 2022
1 parent 6fdb038 commit b879066
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/dsa/slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,7 @@ int dsa_slave_create(struct dsa_port *port)
assign_type = NET_NAME_PREDICTABLE;
} else {
name = "eth%d";
assign_type = NET_NAME_UNKNOWN;
assign_type = NET_NAME_ENUM;
}

slave_dev = alloc_netdev_mqs(sizeof(struct dsa_slave_priv), name,
Expand Down

0 comments on commit b879066

Please sign in to comment.