]> git.droids-corp.org - dpdk.git/commitdiff
raw/cnxk_bphy: keep leading zero in device name
authorTomasz Duszynski <tduszynski@marvell.com>
Tue, 2 Nov 2021 18:41:32 +0000 (19:41 +0100)
committerJerin Jacob <jerinj@marvell.com>
Wed, 3 Nov 2021 15:15:13 +0000 (16:15 +0100)
Device naming might be misleading which is especially true if one takes
it from lspci output. In order to keep naming consistent keep leading
zero in front of pci bus number.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
doc/guides/rawdevs/cnxk_bphy.rst
drivers/raw/cnxk_bphy/cnxk_bphy.c
drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c

index bf7c00e6bcf6972702b0d435ff832cea4209de71..3cb217568873a8853239902ff63c53bf673ddb5f 100644 (file)
@@ -146,8 +146,10 @@ the raw devices. The rawdev ID of the device can be obtained using invocation
 of ``rte_rawdev_get_dev_id("NAME:x")`` from the test application, where:
 
 - NAME is the desired subsystem: use "BPHY" for regular, and "BPHY_CGX" for
-  RFOE module,
-- x is the device's bus id specified in "bus:device.func" (BDF) format.
+  RFOE module.
+- x is the device's bus id specified in "bus:device.func" (BDF) format. BDF follows convention
+  used by lspci i.e bus, device and func are specified using respectively two, two and one hex
+  digit(s).
 
 Use this identifier for further rawdev function calls.
 
index 558ebfa85eeb5f99a7cc5cb91c5e91c6e13dba4f..349d551839223c9eefa2dc65c7474af53b5f7910 100644 (file)
@@ -158,7 +158,7 @@ err_desc:
 static void
 bphy_rawdev_get_name(char *name, struct rte_pci_device *pci_dev)
 {
-       snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "BPHY:%x:%02x.%x",
+       snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "BPHY:%02x:%02x.%x",
                 pci_dev->addr.bus, pci_dev->addr.devid,
                 pci_dev->addr.function);
 }
index ade45ab741968f0112f11f4e94c7a3a098553925..0b694e1c03c377f7c118d34677b8bb4222fb7ad4 100644 (file)
@@ -28,7 +28,7 @@ static void
 cnxk_bphy_cgx_format_name(char *name, unsigned int len,
                          struct rte_pci_device *pci_dev)
 {
-       snprintf(name, len, "BPHY_CGX:%x:%02x.%x", pci_dev->addr.bus,
+       snprintf(name, len, "BPHY_CGX:%02x:%02x.%x", pci_dev->addr.bus,
                 pci_dev->addr.devid, pci_dev->addr.function);
 }