[RFC,13/14] vdpa/mlx5: support SubFunction

Message ID 20210527140202.19377-4-xuemingl@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series mlx5: support SubFunction |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Xueming Li May 27, 2021, 2:02 p.m. UTC
  From: Thomas Monjalon <thomas@monjalon.net>

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/vdpa/mlx5/mlx5_vdpa.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c
index 967234193f..2f4420becd 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
@@ -553,9 +553,13 @@  mlx5_vdpa_sys_roce_disable(const char *addr)
 static int
 mlx5_vdpa_roce_disable(struct rte_device *dev)
 {
+	char pci_addr[PCI_PRI_STR_SIZE];
+
+	if (mlx5_dev_to_pci_str(dev, pci_addr, sizeof(pci_addr)) < 0)
+		return -rte_errno;
 	/* Firstly try to disable ROCE by Netlink and fallback to sysfs. */
-	if (mlx5_vdpa_nl_roce_disable(dev->name) != 0 &&
-	    mlx5_vdpa_sys_roce_disable(dev->name) != 0)
+	if (mlx5_vdpa_nl_roce_disable(pci_addr) != 0 &&
+	    mlx5_vdpa_sys_roce_disable(pci_addr) != 0)
 		return -rte_errno;
 	return 0;
 }