dpdk: never override devname if set via config

Even if the device name is specified in the startup config it may
be appended to if the device is a switch domain member. This leads
to unexpected device naming if an explicit device name was requested.

Type: fix
Change-Id: Ib56b4ac41c17008db55dc69497721e3cb7d540c1
Signed-off-by: Peter Morrow <pdmorrow@gmail.com>
This commit is contained in:
Peter Morrow
2023-12-05 10:07:10 +00:00
committed by Fan Zhang
parent 864eaae5bb
commit 31d4891cfe

View File

@@ -360,12 +360,13 @@ dpdk_lib_init (dpdk_main_t * dm)
pci_dev->addr.devid, pci_dev->addr.function);
else
xd->name = format (xd->name, "%u", port_id);
}
/* Handle representor devices that share the same PCI ID */
if ((di.switch_info.domain_id != RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) &&
(di.switch_info.port_id != (uint16_t) -1))
xd->name = format (xd->name, "/%d", di.switch_info.port_id);
/* Handle representor devices that share the same PCI ID */
if ((di.switch_info.domain_id !=
RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID) &&
(di.switch_info.port_id != (uint16_t) -1))
xd->name = format (xd->name, "/%d", di.switch_info.port_id);
}
/* number of RX and TX queues */
if (devconf->num_tx_queues > 0)