vhost: prefix vDPA enum value for PCI address type

Message ID 20200326141422.20264-1-maxime.coquelin@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series vhost: prefix vDPA enum value for PCI address type |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Maxime Coquelin March 26, 2020, 2:14 p.m. UTC
  In order to avoid potential conflicts, rename the PCI_ADDR
enum value to VDPA_ADDR_PCI in vdpa_addr_type_enum.

All symbols referencing this enum are experimental, so it
does not break API policy.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +-
 drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +-
 examples/vdpa/main.c          | 2 +-
 lib/librte_vhost/rte_vdpa.h   | 2 +-
 lib/librte_vhost/vdpa.c       | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
  

Comments

Matan Azrad March 26, 2020, 4:33 p.m. UTC | #1
Hi

From: Maxime Coquelin
> In order to avoid potential conflicts, rename the PCI_ADDR enum value to
> VDPA_ADDR_PCI in vdpa_addr_type_enum.
> 
> All symbols referencing this enum are experimental, so it does not break API
> policy.
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Matan Azrad <matan@mellanox.com>

I think this patch is in conflict with my last patches for mlx5 vDPA driver.

> ---
>  drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +-
>  drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +-
>  examples/vdpa/main.c          | 2 +-
>  lib/librte_vhost/rte_vdpa.h   | 2 +-
>  lib/librte_vhost/vdpa.c       | 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index da4667ba5..ec97178dc 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -1177,7 +1177,7 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv
> __rte_unused,
>  		(1ULL << VHOST_F_LOG_ALL);
> 
>  	internal->dev_addr.pci_addr = pci_dev->addr;
> -	internal->dev_addr.type = PCI_ADDR;
> +	internal->dev_addr.type = VDPA_ADDR_PCI;
>  	list->internal = internal;
> 
>  	if (rte_kvargs_count(kvlist, IFCVF_SW_FALLBACK_LM)) { diff --git
> a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c index
> 97d914a47..0a9f31a87 100644
> --- a/drivers/vdpa/mlx5/mlx5_vdpa.c
> +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
> @@ -446,7 +446,7 @@ mlx5_vdpa_pci_probe(struct rte_pci_driver *pci_drv
> __rte_unused,
>  	}
>  	priv->ctx = ctx;
>  	priv->dev_addr.pci_addr = pci_dev->addr;
> -	priv->dev_addr.type = PCI_ADDR;
> +	priv->dev_addr.type = VDPA_ADDR_PCI;
>  	priv->id = rte_vdpa_register_device(&priv->dev_addr,
> &mlx5_vdpa_ops);
>  	if (priv->id < 0) {
>  		DRV_LOG(ERR, "Failed to register vDPA device."); diff --git
> a/examples/vdpa/main.c b/examples/vdpa/main.c index
> d2e2cb7cd..78d72634b 100644
> --- a/examples/vdpa/main.c
> +++ b/examples/vdpa/main.c
> @@ -331,7 +331,7 @@ static void cmd_create_vdpa_port_parsed(void
> *parsed_result,
>  		cmdline_printf(cl, "Unable to parse the given bdf.\n");
>  		return;
>  	}
> -	addr.type = PCI_ADDR;
> +	addr.type = VDPA_ADDR_PCI;
>  	did = rte_vdpa_find_device_id(&addr);
>  	if (did < 0) {
>  		cmdline_printf(cl, "Unable to find vdpa device id.\n"); diff --
> git a/lib/librte_vhost/rte_vdpa.h b/lib/librte_vhost/rte_vdpa.h index
> 9a3deb31d..3c400ee79 100644
> --- a/lib/librte_vhost/rte_vdpa.h
> +++ b/lib/librte_vhost/rte_vdpa.h
> @@ -19,7 +19,7 @@
>  #define MAX_VDPA_NAME_LEN 128
> 
>  enum vdpa_addr_type {
> -	PCI_ADDR,
> +	VDPA_ADDR_PCI,
>  	VDPA_ADDR_MAX
>  };
> 
> diff --git a/lib/librte_vhost/vdpa.c b/lib/librte_vhost/vdpa.c index
> 2b8670873..b2b2a105f 100644
> --- a/lib/librte_vhost/vdpa.c
> +++ b/lib/librte_vhost/vdpa.c
> @@ -27,7 +27,7 @@ is_same_vdpa_device(struct rte_vdpa_dev_addr *a,
>  		return false;
> 
>  	switch (a->type) {
> -	case PCI_ADDR:
> +	case VDPA_ADDR_PCI:
>  		if (a->pci_addr.domain != b->pci_addr.domain ||
>  				a->pci_addr.bus != b->pci_addr.bus ||
>  				a->pci_addr.devid != b->pci_addr.devid ||
> --
> 2.24.1
  
Maxime Coquelin March 26, 2020, 4:35 p.m. UTC | #2
On 3/26/20 5:33 PM, Matan Azrad wrote:
> Hi
> 
> From: Maxime Coquelin
>> In order to avoid potential conflicts, rename the PCI_ADDR enum value to
>> VDPA_ADDR_PCI in vdpa_addr_type_enum.
>>
>> All symbols referencing this enum are experimental, so it does not break API
>> policy.
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> 
> I think this patch is in conflict with my last patches for mlx5 vDPA driver.
> 

OK, thanks for the notif. I'll fix that when applying.

Maxime
  
Maxime Coquelin April 10, 2020, 2:46 p.m. UTC | #3
On 3/26/20 3:14 PM, Maxime Coquelin wrote:
> In order to avoid potential conflicts, rename the PCI_ADDR
> enum value to VDPA_ADDR_PCI in vdpa_addr_type_enum.
> 
> All symbols referencing this enum are experimental, so it
> does not break API policy.
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +-
>  drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +-
>  examples/vdpa/main.c          | 2 +-
>  lib/librte_vhost/rte_vdpa.h   | 2 +-
>  lib/librte_vhost/vdpa.c       | 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
Applied to dpdk-next-virtio/master.

Thanks,
Maxime
  

Patch

diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index da4667ba5..ec97178dc 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -1177,7 +1177,7 @@  ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		(1ULL << VHOST_F_LOG_ALL);
 
 	internal->dev_addr.pci_addr = pci_dev->addr;
-	internal->dev_addr.type = PCI_ADDR;
+	internal->dev_addr.type = VDPA_ADDR_PCI;
 	list->internal = internal;
 
 	if (rte_kvargs_count(kvlist, IFCVF_SW_FALLBACK_LM)) {
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c
index 97d914a47..0a9f31a87 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
@@ -446,7 +446,7 @@  mlx5_vdpa_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	}
 	priv->ctx = ctx;
 	priv->dev_addr.pci_addr = pci_dev->addr;
-	priv->dev_addr.type = PCI_ADDR;
+	priv->dev_addr.type = VDPA_ADDR_PCI;
 	priv->id = rte_vdpa_register_device(&priv->dev_addr, &mlx5_vdpa_ops);
 	if (priv->id < 0) {
 		DRV_LOG(ERR, "Failed to register vDPA device.");
diff --git a/examples/vdpa/main.c b/examples/vdpa/main.c
index d2e2cb7cd..78d72634b 100644
--- a/examples/vdpa/main.c
+++ b/examples/vdpa/main.c
@@ -331,7 +331,7 @@  static void cmd_create_vdpa_port_parsed(void *parsed_result,
 		cmdline_printf(cl, "Unable to parse the given bdf.\n");
 		return;
 	}
-	addr.type = PCI_ADDR;
+	addr.type = VDPA_ADDR_PCI;
 	did = rte_vdpa_find_device_id(&addr);
 	if (did < 0) {
 		cmdline_printf(cl, "Unable to find vdpa device id.\n");
diff --git a/lib/librte_vhost/rte_vdpa.h b/lib/librte_vhost/rte_vdpa.h
index 9a3deb31d..3c400ee79 100644
--- a/lib/librte_vhost/rte_vdpa.h
+++ b/lib/librte_vhost/rte_vdpa.h
@@ -19,7 +19,7 @@ 
 #define MAX_VDPA_NAME_LEN 128
 
 enum vdpa_addr_type {
-	PCI_ADDR,
+	VDPA_ADDR_PCI,
 	VDPA_ADDR_MAX
 };
 
diff --git a/lib/librte_vhost/vdpa.c b/lib/librte_vhost/vdpa.c
index 2b8670873..b2b2a105f 100644
--- a/lib/librte_vhost/vdpa.c
+++ b/lib/librte_vhost/vdpa.c
@@ -27,7 +27,7 @@  is_same_vdpa_device(struct rte_vdpa_dev_addr *a,
 		return false;
 
 	switch (a->type) {
-	case PCI_ADDR:
+	case VDPA_ADDR_PCI:
 		if (a->pci_addr.domain != b->pci_addr.domain ||
 				a->pci_addr.bus != b->pci_addr.bus ||
 				a->pci_addr.devid != b->pci_addr.devid ||