aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Morrow <pdmorrow@gmail.com>2023-12-05 10:07:10 +0000
committerFan Zhang <fanzhang.oss@gmail.com>2023-12-08 12:43:10 +0000
commit31d4891cfe9451fecce1e26e51153d608c76a4f8 (patch)
tree4a9d0b3bfda453c117f68f4c4e9d8cb9c0794a9f /src
parent864eaae5bb648ad18b320f9ae9043eed440767db (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/dpdk/device/init.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index d88dad49ad5..b76455ba60d 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -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)