Skip to contentSkip to conversation

bus/pci: fix comment explaining device naming

PATCH In review Gaetan Rivet 3 participants 4 messages Nov 16, 2020 – Nov 20, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus/pci: fix comment explaining device naming

The original triple negative was hard to read and the attempt to improve the formulation was commendable, unfortunately the new comment is the inverse of correct.

Fixes a65a34a85ebf ("eal: replace usage of blacklist/whitelist in enums")

---

No Cc:stable as it was not yet released.

 drivers/bus/pci/pci_common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/bus/pci/pci_common.c +3 -1
index b24c069713..d55e5a38cf 100644
@@ -68,7 +68,9 @@ pci_name_set(struct rte_pci_device *dev)
 	devargs = pci_devargs_lookup(&dev->addr);
 	dev->device.devargs = devargs;
 
-	/* If the device is blocked, no rte_devargs exists for it. */
+	/* When using a block-list, only blocked devices will have
+	 * an rte_devargs. Allowed devices won't have one.
+	 */
 	if (devargs != NULL)
 		/* If an rte_devargs exists, the generic rte_device uses the
 		 * given name as its name.
Signature · 1 line
2.29.2
Acked-by on v1 1/1
#1 lore raw
Quoted 19 lines · Gaetan Rivet

The original triple negative was hard to read and the attempt to improve the formulation was commendable, unfortunately the new comment is the inverse of correct.

Fixes a65a34a85ebf ("eal: replace usage of blacklist/whitelist in enums")

---

No Cc:stable as it was not yet released.

 drivers/bus/pci/pci_common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/bus/pci/pci_common.c +0 -0
index b24c069713..d55e5a38cf 100644

drivers/bus/pci/pci_common.c pci_name_set(struct rte_pci_device *dev) · line 76

Quoted 10 lines
drivers/bus/pci/pci_common.c +3 -1
@@ -68,7 +68,9 @@ pci_name_set(struct rte_pci_device *dev)
 	devargs = pci_devargs_lookup(&dev->addr);
 	dev->device.devargs = devargs;
 
-	/* If the device is blocked, no rte_devargs exists for it. */
+	/* When using a block-list, only blocked devices will have
+	 * an rte_devargs. Allowed devices won't have one.
+	 */
 	if (devargs != NULL)
 		/* If an rte_devargs exists, the generic rte_device uses the
 		 * given name as its name.

Thanks for fixing my mistake - at least it became readable enough to understand it was the other way around :-)

Signature · 2 lines
Kind regards,
Luca Boccassi
Reviewed-by on v1 1/1
#2 lore raw
In reply to Gaetan Rivet
Quoted 20 lines · Gaetan Rivet

The original triple negative was hard to read and the attempt to improve the formulation was commendable, unfortunately the new comment is the inverse of correct.

Fixes a65a34a85ebf ("eal: replace usage of blacklist/whitelist in enums")

---

No Cc:stable as it was not yet released.

 drivers/bus/pci/pci_common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/bus/pci/pci_common.c +0 -0
index b24c069713..d55e5a38cf 100644

drivers/bus/pci/pci_common.c pci_name_set(struct rte_pci_device *dev) · line 71

Quoted 5 lines
drivers/bus/pci/pci_common.c +1 -1
@@ -68,7 +68,9 @@ pci_name_set(struct rte_pci_device *dev)
        devargs = pci_devargs_lookup(&dev->addr);
        dev->device.devargs = devargs;
 
-       /* If the device is blocked, no rte_devargs exists for it. */
+       /* When using a block-list, only blocked devices will have

Nit: I don't think we need a -, I would go with blocklist.

Quoted 8 lines
drivers/bus/pci/pci_common.c +2 -1
+        * an rte_devargs. Allowed devices won't have one.
+        */
        if (devargs != NULL)
                /* If an rte_devargs exists, the generic rte_device uses the
                 * given name as its name.
--

2.29.2

Signature · 1 line
David Marchand
Acked-by Luca Boccassi Reviewed-by on v1 1/1
#3 lore raw
In reply to Gaetan Rivet
Quoted 6 lines · Gaetan Rivet

The original triple negative was hard to read and the attempt to improve the formulation was commendable, unfortunately the new comment is the inverse of correct.

Fixes a65a34a85ebf ("eal: replace usage of blacklist/whitelist in enums")
Quoted 1 line

Thanks Gaëtan, applied.

Signature · 1 line
David Marchand