net: stmmac: Assigning the eth2 to passthrough interface

Address the name conflict between the
virtualized interface and the passthrough interface
to ensure that the interface name is independent
of the driver probe order.

Change-Id: I305b22cbd3860b0df3346ccb89aed4c879cef864
Signed-off-by: Shashank Shekhar <quic_sshe@quicinc.com>
This commit is contained in:
Shashank Shekhar 2024-09-26 17:29:06 +05:30
parent 7d2360ad96
commit 1bc107cc06

View file

@ -7409,8 +7409,13 @@ int stmmac_dvr_probe(struct device *device,
u32 rxq;
int i, ret = 0;
ndev = devm_alloc_etherdev_mqs(device, sizeof(struct stmmac_priv),
MTL_MAX_TX_QUEUES, MTL_MAX_RX_QUEUES);
if (of_property_read_bool(device->of_node, "virtio-mdio"))
ndev = alloc_netdev_mqs(sizeof(struct stmmac_priv), "eth2", NET_NAME_ENUM,
ether_setup, MTL_MAX_TX_QUEUES, MTL_MAX_TX_QUEUES);
else
ndev = devm_alloc_etherdev_mqs(device, sizeof(struct stmmac_priv),
MTL_MAX_TX_QUEUES, MTL_MAX_TX_QUEUES);
if (!ndev)
return -ENOMEM;