DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] bus/pci: rename devargs parameter id to addr
@ 2018-10-03 19:40 Thomas Monjalon
  2018-10-03 19:40 ` [dpdk-dev] [PATCH 2/2] devargs: rename enum items with singular form Thomas Monjalon
  2018-10-10  6:48 ` [dpdk-dev] [PATCH 1/2] bus/pci: rename devargs parameter id to addr Andrew Rybchenko
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Monjalon @ 2018-10-03 19:40 UTC (permalink / raw)
  To: gaetan.rivet; +Cc: dev

We could match devices by their PCI id (vendor id, device id, etc).
But for now, only matching by PCI address is implemented.
The devargs parameter "id" is renamed "addr" to reflect its real meaning.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/bus/pci/pci_params.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c
index 7630d4845..77b722ba9 100644
--- a/drivers/bus/pci/pci_params.c
+++ b/drivers/bus/pci/pci_params.c
@@ -12,12 +12,12 @@
 #include "private.h"
 
 enum pci_params {
-	RTE_PCI_PARAMS_ID,
+	RTE_PCI_PARAMS_ADDR,
 	RTE_PCI_PARAMS_MAX,
 };
 
 static const char * const pci_params_keys[] = {
-	[RTE_PCI_PARAMS_ID] = "id",
+	[RTE_PCI_PARAMS_ADDR] = "addr",
 	[RTE_PCI_PARAMS_MAX] = NULL,
 };
 
@@ -47,7 +47,7 @@ pci_dev_match(const struct rte_device *dev,
 		return 0;
 	pdev = RTE_DEV_TO_PCI_CONST(dev);
 	/* if any field does not match. */
-	if (rte_kvargs_process(kvlist, "id",
+	if (rte_kvargs_process(kvlist, pci_params_keys[RTE_PCI_PARAMS_ADDR],
 			       &pci_addr_kv_cmp,
 			       (void *)(intptr_t)&pdev->addr))
 		return 1;
-- 
2.19.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH 2/2] devargs: rename enum items with singular form
  2018-10-03 19:40 [dpdk-dev] [PATCH 1/2] bus/pci: rename devargs parameter id to addr Thomas Monjalon
@ 2018-10-03 19:40 ` Thomas Monjalon
  2018-10-10  6:49   ` Andrew Rybchenko
  2018-10-10  6:48 ` [dpdk-dev] [PATCH 1/2] bus/pci: rename devargs parameter id to addr Andrew Rybchenko
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2018-10-03 19:40 UTC (permalink / raw)
  To: gaetan.rivet; +Cc: dev

The enum names are *_params (plural form).
And the items are also using the plural form: *_PARAMS_*.
It looks more natural to use the singular form *_PARAM_* for items.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/bus/pci/pci_params.c      | 10 +++++-----
 drivers/bus/vdev/vdev_params.c    |  4 ++--
 lib/librte_ethdev/rte_class_eth.c |  4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c
index 77b722ba9..3192e9c96 100644
--- a/drivers/bus/pci/pci_params.c
+++ b/drivers/bus/pci/pci_params.c
@@ -12,13 +12,13 @@
 #include "private.h"
 
 enum pci_params {
-	RTE_PCI_PARAMS_ADDR,
-	RTE_PCI_PARAMS_MAX,
+	RTE_PCI_PARAM_ADDR,
+	RTE_PCI_PARAM_MAX,
 };
 
 static const char * const pci_params_keys[] = {
-	[RTE_PCI_PARAMS_ADDR] = "addr",
-	[RTE_PCI_PARAMS_MAX] = NULL,
+	[RTE_PCI_PARAM_ADDR] = "addr",
+	[RTE_PCI_PARAM_MAX] = NULL,
 };
 
 static int
@@ -47,7 +47,7 @@ pci_dev_match(const struct rte_device *dev,
 		return 0;
 	pdev = RTE_DEV_TO_PCI_CONST(dev);
 	/* if any field does not match. */
-	if (rte_kvargs_process(kvlist, pci_params_keys[RTE_PCI_PARAMS_ADDR],
+	if (rte_kvargs_process(kvlist, pci_params_keys[RTE_PCI_PARAM_ADDR],
 			       &pci_addr_kv_cmp,
 			       (void *)(intptr_t)&pdev->addr))
 		return 1;
diff --git a/drivers/bus/vdev/vdev_params.c b/drivers/bus/vdev/vdev_params.c
index 842a4684e..da270f2ec 100644
--- a/drivers/bus/vdev/vdev_params.c
+++ b/drivers/bus/vdev/vdev_params.c
@@ -11,11 +11,11 @@
 #include "vdev_private.h"
 
 enum vdev_params {
-	RTE_VDEV_PARAMS_MAX,
+	RTE_VDEV_PARAM_MAX,
 };
 
 static const char * const vdev_params_keys[] = {
-	[RTE_VDEV_PARAMS_MAX] = NULL,
+	[RTE_VDEV_PARAM_MAX] = NULL,
 };
 
 static int
diff --git a/lib/librte_ethdev/rte_class_eth.c b/lib/librte_ethdev/rte_class_eth.c
index b6557db97..84b646291 100644
--- a/lib/librte_ethdev/rte_class_eth.c
+++ b/lib/librte_ethdev/rte_class_eth.c
@@ -15,11 +15,11 @@
 #include "ethdev_private.h"
 
 enum eth_params {
-	RTE_ETH_PARAMS_MAX,
+	RTE_ETH_PARAM_MAX,
 };
 
 static const char * const eth_params_keys[] = {
-	[RTE_ETH_PARAMS_MAX] = NULL,
+	[RTE_ETH_PARAM_MAX] = NULL,
 };
 
 struct eth_dev_match_arg {
-- 
2.19.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] bus/pci: rename devargs parameter id to addr
  2018-10-03 19:40 [dpdk-dev] [PATCH 1/2] bus/pci: rename devargs parameter id to addr Thomas Monjalon
  2018-10-03 19:40 ` [dpdk-dev] [PATCH 2/2] devargs: rename enum items with singular form Thomas Monjalon
@ 2018-10-10  6:48 ` Andrew Rybchenko
  2018-10-11 12:02   ` Thomas Monjalon
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Rybchenko @ 2018-10-10  6:48 UTC (permalink / raw)
  To: Thomas Monjalon, gaetan.rivet; +Cc: dev

On 10/3/18 10:40 PM, Thomas Monjalon wrote:
> We could match devices by their PCI id (vendor id, device id, etc).
> But for now, only matching by PCI address is implemented.
> The devargs parameter "id" is renamed "addr" to reflect its real meaning.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] devargs: rename enum items with singular form
  2018-10-03 19:40 ` [dpdk-dev] [PATCH 2/2] devargs: rename enum items with singular form Thomas Monjalon
@ 2018-10-10  6:49   ` Andrew Rybchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Rybchenko @ 2018-10-10  6:49 UTC (permalink / raw)
  To: Thomas Monjalon, gaetan.rivet; +Cc: dev

On 10/3/18 10:40 PM, Thomas Monjalon wrote:
> The enum names are *_params (plural form).
> And the items are also using the plural form: *_PARAMS_*.
> It looks more natural to use the singular form *_PARAM_* for items.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] bus/pci: rename devargs parameter id to addr
  2018-10-10  6:48 ` [dpdk-dev] [PATCH 1/2] bus/pci: rename devargs parameter id to addr Andrew Rybchenko
@ 2018-10-11 12:02   ` Thomas Monjalon
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2018-10-11 12:02 UTC (permalink / raw)
  To: Andrew Rybchenko, gaetan.rivet; +Cc: dev

10/10/2018 08:48, Andrew Rybchenko:
> On 10/3/18 10:40 PM, Thomas Monjalon wrote:
> > We could match devices by their PCI id (vendor id, device id, etc).
> > But for now, only matching by PCI address is implemented.
> > The devargs parameter "id" is renamed "addr" to reflect its real meaning.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> 
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

Series applied

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-11 12:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03 19:40 [dpdk-dev] [PATCH 1/2] bus/pci: rename devargs parameter id to addr Thomas Monjalon
2018-10-03 19:40 ` [dpdk-dev] [PATCH 2/2] devargs: rename enum items with singular form Thomas Monjalon
2018-10-10  6:49   ` Andrew Rybchenko
2018-10-10  6:48 ` [dpdk-dev] [PATCH 1/2] bus/pci: rename devargs parameter id to addr Andrew Rybchenko
2018-10-11 12:02   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).