Skip to contentSkip to conversation

vDPA/ifcvf: enables Intel C5000X-PL virtio-net

PATCH Superseded Zhu Lingshan 3 participants 8 messages Mar 5, 2021 – Mar 8, 2021

Subsystems (5)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/3 vDPA/ifcvf: get_vendor_id returns a device specific vendor id

In reply to Zhu Lingshan

In this commit, ifcvf_get_vendor_id() will return a device specific vendor id of the probed pci device than a hard code.

---
 drivers/vdpa/ifcvf/ifcvf_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/vdpa/ifcvf/ifcvf_main.c +4 -1
index fa1af301cf55..e501ee07de17 100644
@@ -324,7 +324,10 @@ static u32 ifcvf_vdpa_get_device_id(struct vdpa_device *vdpa_dev)
 
 static u32 ifcvf_vdpa_get_vendor_id(struct vdpa_device *vdpa_dev)
 {
-	return IFCVF_SUBSYS_VENDOR_ID;
+	struct ifcvf_adapter *adapter = vdpa_to_adapter(vdpa_dev);
+	struct pci_dev *pdev = adapter->pdev;
+
+	return pdev->subsystem_vendor;
 }
 
 static u32 ifcvf_vdpa_get_vq_align(struct vdpa_device *vdpa_dev)
Signature · 1 line
2.27.0
#0 lore raw

cover vDPA/ifcvf: enables Intel C5000X-PL virtio-net

This series enabled Intel FGPA SmartNIC C5000X-PL virtio-net for vDPA

Zhu Lingshan (3):
vDPA/ifcvf: get_vendor_id returns a device specific vendor id vDPA/ifcvf: enable Intel C5000X-PL virtio-net for vDPA vDPA/ifcvf: bump version string to 1.0

 drivers/vdpa/ifcvf/ifcvf_base.h | 13 +++++++++----
 drivers/vdpa/ifcvf/ifcvf_main.c | 20 ++++++++++++++------
 2 files changed, 23 insertions(+), 10 deletions(-)
Signature · 1 line
2.27.0
#3 lore raw

PATCH 2/3 vDPA/ifcvf: enable Intel C5000X-PL virtio-net for vDPA

This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-net for vDPA.
C5000X-PL vendor id 0x1AF4, device id 0x1000, subvendor id 0x8086, sub device id 0x0001

To distinguish C5000X-PL from other ifcvf driven devices, the original ifcvf device is named "N3000".

---
 drivers/vdpa/ifcvf/ifcvf_base.h | 13 +++++++++----
 drivers/vdpa/ifcvf/ifcvf_main.c | 13 +++++++++----
 2 files changed, 18 insertions(+), 8 deletions(-)
drivers/vdpa/ifcvf/ifcvf_base.h +9 -4
index 64696d63fe07..794d1505d857 100644
@@ -18,10 +18,15 @@
 #include <uapi/linux/virtio_config.h>
 #include <uapi/linux/virtio_pci.h>
 
-#define IFCVF_VENDOR_ID		0x1AF4
-#define IFCVF_DEVICE_ID		0x1041
-#define IFCVF_SUBSYS_VENDOR_ID	0x8086
-#define IFCVF_SUBSYS_DEVICE_ID	0x001A
+#define N3000_VENDOR_ID		0x1AF4
+#define N3000_DEVICE_ID		0x1041
+#define N3000_SUBSYS_VENDOR_ID	0x8086
+#define N3000_SUBSYS_DEVICE_ID	0x001A
+
+#define C5000X_PL_VENDOR_ID		0x1AF4
+#define C5000X_PL_DEVICE_ID		0x1000
+#define C5000X_PL_SUBSYS_VENDOR_ID	0x8086
+#define C5000X_PL_SUBSYS_DEVICE_ID	0x0001
 
 #define IFCVF_SUPPORTED_FEATURES \
 		((1ULL << VIRTIO_NET_F_MAC)			| \
drivers/vdpa/ifcvf/ifcvf_main.c +9 -4
index e501ee07de17..fd5befc5cbcc 100644
@@ -480,10 +480,15 @@ static void ifcvf_remove(struct pci_dev *pdev)
 }
 
 static struct pci_device_id ifcvf_pci_ids[] = {
-	{ PCI_DEVICE_SUB(IFCVF_VENDOR_ID,
-		IFCVF_DEVICE_ID,
-		IFCVF_SUBSYS_VENDOR_ID,
-		IFCVF_SUBSYS_DEVICE_ID) },
+	{ PCI_DEVICE_SUB(N3000_VENDOR_ID,
+			 N3000_DEVICE_ID,
+			 N3000_SUBSYS_VENDOR_ID,
+			 N3000_SUBSYS_DEVICE_ID) },
+	{ PCI_DEVICE_SUB(C5000X_PL_VENDOR_ID,
+			 C5000X_PL_DEVICE_ID,
+			 C5000X_PL_SUBSYS_VENDOR_ID,
+			 C5000X_PL_SUBSYS_DEVICE_ID) },
+
 	{ 0 },
 };
 MODULE_DEVICE_TABLE(pci, ifcvf_pci_ids);
Signature · 1 line
2.27.0
#5 lore raw

PATCH 3/3 vDPA/ifcvf: bump version string to 1.0

In reply to Zhu Lingshan

This commit bumps ifcvf driver version string to 1.0

---
 drivers/vdpa/ifcvf/ifcvf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/ifcvf/ifcvf_main.c +1 -1
index fd5befc5cbcc..56a0974cf93c 100644
@@ -14,7 +14,7 @@
 #include <linux/sysfs.h>
 #include "ifcvf_base.h"
 
-#define VERSION_STRING  "0.1"
+#define VERSION_STRING  "1.0"
 #define DRIVER_AUTHOR   "Intel Corporation"
 #define IFCVF_DRIVER_NAME       "ifcvf"
 
Signature · 1 line
2.27.0
#6 lore raw

Re: [PATCH 3/3] vDPA/ifcvf: bump version string to 1.0

Quoted 12 lines · Zhu Lingshan

This commit bumps ifcvf driver version string to 1.0

---
 drivers/vdpa/ifcvf/ifcvf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/ifcvf/ifcvf_main.c +0 -0
index fd5befc5cbcc..56a0974cf93c 100644

drivers/vdpa/ifcvf/ifcvf_main.c line 17

Quoted 5 lines
drivers/vdpa/ifcvf/ifcvf_main.c +1 -1
@@ -14,7 +14,7 @@
 #include <linux/sysfs.h>
 #include "ifcvf_base.h"
 
-#define VERSION_STRING  "0.1"
+#define VERSION_STRING  "1.0"

Please delete it instead of bumping it.
We are not supposed to use in-kernel version for years already.
https://lore.kernel.org/ksummit-discuss/[email protected]/

Thanks
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#7 lore raw

Re: [PATCH 3/3] vDPA/ifcvf: bump version string to 1.0

Hi Leon,

Thanks for point this out, will send a V2 patchset delete it.

Thanks
Zhu Lingshan

Quoted 23 lines · Leon Romanovsky
Quoted 12 lines · Zhu Lingshan

This commit bumps ifcvf driver version string to 1.0

---
  drivers/vdpa/ifcvf/ifcvf_main.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/ifcvf/ifcvf_main.c +0 -0
index fd5befc5cbcc..56a0974cf93c 100644

drivers/vdpa/ifcvf/ifcvf_main.c line 17

Quoted 5 lines
drivers/vdpa/ifcvf/ifcvf_main.c +1 -1
@@ -14,7 +14,7 @@
  #include <linux/sysfs.h>
  #include "ifcvf_base.h"
 
-#define VERSION_STRING  "0.1"
+#define VERSION_STRING  "1.0"

Please delete it instead of bumping it.
We are not supposed to use in-kernel version for years already.
https://lore.kernel.org/ksummit-discuss/[email protected]/

Thanks

Acked-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] vDPA/ifcvf: get_vendor_id returns a device specific vendor id

In reply to Zhu Lingshan
Quoted 14 lines · Zhu Lingshan

In this commit, ifcvf_get_vendor_id() will return a device specific vendor id of the probed pci device than a hard code.

---
  drivers/vdpa/ifcvf/ifcvf_main.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/vdpa/ifcvf/ifcvf_main.c +0 -0
index fa1af301cf55..e501ee07de17 100644

drivers/vdpa/ifcvf/ifcvf_main.c static u32 ifcvf_vdpa_get_device_id(struct vdpa_device *vdpa_dev) · line 331

Quoted 9 lines
drivers/vdpa/ifcvf/ifcvf_main.c +4 -1
@@ -324,7 +324,10 @@ static u32 ifcvf_vdpa_get_device_id(struct vdpa_device *vdpa_dev)
 
  static u32 ifcvf_vdpa_get_vendor_id(struct vdpa_device *vdpa_dev)
  {
-	return IFCVF_SUBSYS_VENDOR_ID;
+	struct ifcvf_adapter *adapter = vdpa_to_adapter(vdpa_dev);
+	struct pci_dev *pdev = adapter->pdev;
+
+	return pdev->subsystem_vendor;
  }

drivers/vdpa/ifcvf/ifcvf_main.c static u32 ifcvf_vdpa_get_device_id(struct vdpa_device *vdpa_dev) · line 333

Quoted 2 lines
drivers/vdpa/ifcvf/ifcvf_main.c +0 -0
  static u32 ifcvf_vdpa_get_vq_align(struct vdpa_device *vdpa_dev)

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#4 lore raw

Re: [PATCH 2/3] vDPA/ifcvf: enable Intel C5000X-PL virtio-net for vDPA

In reply to Zhu Lingshan
Quoted 20 lines · Zhu Lingshan

This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-net for vDPA.
C5000X-PL vendor id 0x1AF4, device id 0x1000, subvendor id 0x8086, sub device id 0x0001

To distinguish C5000X-PL from other ifcvf driven devices, the original ifcvf device is named "N3000".

---
  drivers/vdpa/ifcvf/ifcvf_base.h | 13 +++++++++----
  drivers/vdpa/ifcvf/ifcvf_main.c | 13 +++++++++----
  2 files changed, 18 insertions(+), 8 deletions(-)
drivers/vdpa/ifcvf/ifcvf_base.h +0 -0
index 64696d63fe07..794d1505d857 100644
@@ -18,10 +18,15 @@
  #include <uapi/linux/virtio_config.h>

drivers/vdpa/ifcvf/ifcvf_base.h line 24

Quoted 10 lines
drivers/vdpa/ifcvf/ifcvf_base.h +4 -4
  #include <uapi/linux/virtio_pci.h>
 
-#define IFCVF_VENDOR_ID		0x1AF4
-#define IFCVF_DEVICE_ID		0x1041
-#define IFCVF_SUBSYS_VENDOR_ID	0x8086
-#define IFCVF_SUBSYS_DEVICE_ID	0x001A
+#define N3000_VENDOR_ID		0x1AF4
+#define N3000_DEVICE_ID		0x1041
+#define N3000_SUBSYS_VENDOR_ID	0x8086
+#define N3000_SUBSYS_DEVICE_ID	0x001A

Patch looks good, I wonder if it's better to do the rename separately.

Thanks

Quoted 22 lines
drivers/vdpa/ifcvf/ifcvf_base.h +5 -0
+
+#define C5000X_PL_VENDOR_ID		0x1AF4
+#define C5000X_PL_DEVICE_ID		0x1000
+#define C5000X_PL_SUBSYS_VENDOR_ID	0x8086
+#define C5000X_PL_SUBSYS_DEVICE_ID	0x0001
 
  #define IFCVF_SUPPORTED_FEATURES \
  		((1ULL << VIRTIO_NET_F_MAC)			| \
drivers/vdpa/ifcvf/ifcvf_main.c +2 -4
index e501ee07de17..fd5befc5cbcc 100644
@@ -480,10 +480,15 @@ static void ifcvf_remove(struct pci_dev *pdev)
  }
 
  static struct pci_device_id ifcvf_pci_ids[] = {
-	{ PCI_DEVICE_SUB(IFCVF_VENDOR_ID,
-		IFCVF_DEVICE_ID,
-		IFCVF_SUBSYS_VENDOR_ID,
-		IFCVF_SUBSYS_DEVICE_ID) },
+	{ PCI_DEVICE_SUB(N3000_VENDOR_ID,
+			 N3000_DEVICE_ID,

drivers/vdpa/ifcvf/ifcvf_main.c static void ifcvf_remove(struct pci_dev *pdev) · line 494

Quoted 10 lines
drivers/vdpa/ifcvf/ifcvf_main.c +7 -0
+			 N3000_SUBSYS_VENDOR_ID,
+			 N3000_SUBSYS_DEVICE_ID) },
+	{ PCI_DEVICE_SUB(C5000X_PL_VENDOR_ID,
+			 C5000X_PL_DEVICE_ID,
+			 C5000X_PL_SUBSYS_VENDOR_ID,
+			 C5000X_PL_SUBSYS_DEVICE_ID) },
+
  	{ 0 },
  };
  MODULE_DEVICE_TABLE(pci, ifcvf_pci_ids);

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization