[v2] vdpa/ifc: Match ANY subsystem IDs for modern virtio devices

Message ID 20221206125524.339468-1-abhishek.maheshwari@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series [v2] vdpa/ifc: Match ANY subsystem IDs for modern virtio devices |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS

Commit Message

Abhishek Maheshwari Dec. 6, 2022, 12:55 p.m. UTC
  Fixing the match table for vdpa/ifcvf driver because as per the Virtio
device specification, for modern virtio devices, drivers MAY match any
PCI Subsystem Vendor ID and any PCI Subsystem Device ID value.

Fixes: a60b747d0ad ("vdpa/ifc: support virtio block device")
Fixes: 5c806b94785 ("vdpa/ifc: add PCI ID for legacy network device")
Cc: stable@dpdk.org

Signed-off-by: Abhishek Maheshwari <abhishek.maheshwari@intel.com>
---
 drivers/vdpa/ifc/ifcvf_vdpa.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Xiao Wang Dec. 8, 2022, 1:08 p.m. UTC | #1
Hi Abhishek,

Please see comments inline.

BRs,
Xiao

> -----Original Message-----
> From: Maheshwari, Abhishek <abhishek.maheshwari@intel.com>
> Sent: Tuesday, December 6, 2022 8:55 PM
> To: Wang, Xiao W <xiao.w.wang@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Xia, Chenbo <chenbo.xia@intel.com>;
> Mandal, Purna Chandra <purna.chandra.mandal@intel.com>; Maheshwari,
> Abhishek <abhishek.maheshwari@intel.com>
> Subject: [PATCH v2] vdpa/ifc: Match ANY subsystem IDs for modern virtio
> devices
> 
> Fixing the match table for vdpa/ifcvf driver because as per the Virtio
> device specification, for modern virtio devices, drivers MAY match any
> PCI Subsystem Vendor ID and any PCI Subsystem Device ID value.

Here the "drivers" refers to virtio driver, not vdpa driver.
With below change, this vdpa/ifc driver would hit the standard virtio device which can't 100% match this driver.

> 
> Fixes: a60b747d0ad ("vdpa/ifc: support virtio block device")
> Fixes: 5c806b94785 ("vdpa/ifc: add PCI ID for legacy network device")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Abhishek Maheshwari <abhishek.maheshwari@intel.com>
> ---
>  drivers/vdpa/ifc/ifcvf_vdpa.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 49d68ad1b1..214d6e1f60 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -1824,8 +1824,8 @@ static const struct rte_pci_id pci_id_ifcvf_map[] = {
>  	{ .class_id = RTE_CLASS_ANY_ID,
>  	  .vendor_id = IFCVF_VENDOR_ID,
>  	  .device_id = IFCVF_NET_MODERN_DEVICE_ID,
> -	  .subsystem_vendor_id = IFCVF_SUBSYS_VENDOR_ID,
> -	  .subsystem_device_id = IFCVF_SUBSYS_DEVICE_ID,
> +	  .subsystem_vendor_id = RTE_PCI_ANY_ID,
> +	  .subsystem_device_id = RTE_PCI_ANY_ID,
>  	},
> 
>  	{ .class_id = RTE_CLASS_ANY_ID,
> @@ -1845,8 +1845,8 @@ static const struct rte_pci_id pci_id_ifcvf_map[] = {
>  	{ .class_id = RTE_CLASS_ANY_ID,
>  	  .vendor_id = IFCVF_VENDOR_ID,
>  	  .device_id = IFCVF_BLK_MODERN_DEVICE_ID,
> -	  .subsystem_vendor_id = IFCVF_SUBSYS_VENDOR_ID,
> -	  .subsystem_device_id = IFCVF_SUBSYS_BLK_DEVICE_ID,
> +	  .subsystem_vendor_id = RTE_PCI_ANY_ID,
> +	  .subsystem_device_id = RTE_PCI_ANY_ID,
>  	},
> 
>  	{ .vendor_id = 0, /* sentinel */
> --
> 2.31.1
  
Pei, Andy Dec. 9, 2022, 2:37 a.m. UTC | #2
Hi Abhishek,

I agree with Xiao.
I think it will be better you just add subvendor and subdevice you want to be take care of by this vdpa driver.

> -----Original Message-----
> From: Wang, Xiao W <xiao.w.wang@intel.com>
> Sent: Thursday, December 8, 2022 9:09 PM
> To: Maheshwari, Abhishek <Abhishek.Maheshwari@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Xia, Chenbo <Chenbo.Xia@intel.com>;
> Mandal, Purna Chandra <Purna.Chandra.Mandal@intel.com>; Pei, Andy
> <andy.pei@intel.com>
> Subject: RE: [PATCH v2] vdpa/ifc: Match ANY subsystem IDs for modern virtio
> devices
> 
> Hi Abhishek,
> 
> Please see comments inline.
> 
> BRs,
> Xiao
> 
> > -----Original Message-----
> > From: Maheshwari, Abhishek <abhishek.maheshwari@intel.com>
> > Sent: Tuesday, December 6, 2022 8:55 PM
> > To: Wang, Xiao W <xiao.w.wang@intel.com>
> > Cc: dev@dpdk.org; stable@dpdk.org; Xia, Chenbo <chenbo.xia@intel.com>;
> > Mandal, Purna Chandra <purna.chandra.mandal@intel.com>; Maheshwari,
> > Abhishek <abhishek.maheshwari@intel.com>
> > Subject: [PATCH v2] vdpa/ifc: Match ANY subsystem IDs for modern
> > virtio devices
> >
> > Fixing the match table for vdpa/ifcvf driver because as per the Virtio
> > device specification, for modern virtio devices, drivers MAY match any
> > PCI Subsystem Vendor ID and any PCI Subsystem Device ID value.
> 
> Here the "drivers" refers to virtio driver, not vdpa driver.
> With below change, this vdpa/ifc driver would hit the standard virtio device
> which can't 100% match this driver.
> 
> >
> > Fixes: a60b747d0ad ("vdpa/ifc: support virtio block device")
> > Fixes: 5c806b94785 ("vdpa/ifc: add PCI ID for legacy network device")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Abhishek Maheshwari <abhishek.maheshwari@intel.com>
> > ---
> >  drivers/vdpa/ifc/ifcvf_vdpa.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c
> > b/drivers/vdpa/ifc/ifcvf_vdpa.c index 49d68ad1b1..214d6e1f60 100644
> > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> > @@ -1824,8 +1824,8 @@ static const struct rte_pci_id pci_id_ifcvf_map[] = {
> >  	{ .class_id = RTE_CLASS_ANY_ID,
> >  	  .vendor_id = IFCVF_VENDOR_ID,
> >  	  .device_id = IFCVF_NET_MODERN_DEVICE_ID,
> > -	  .subsystem_vendor_id = IFCVF_SUBSYS_VENDOR_ID,
> > -	  .subsystem_device_id = IFCVF_SUBSYS_DEVICE_ID,
> > +	  .subsystem_vendor_id = RTE_PCI_ANY_ID,
> > +	  .subsystem_device_id = RTE_PCI_ANY_ID,
> >  	},
> >
> >  	{ .class_id = RTE_CLASS_ANY_ID,
> > @@ -1845,8 +1845,8 @@ static const struct rte_pci_id pci_id_ifcvf_map[] = {
> >  	{ .class_id = RTE_CLASS_ANY_ID,
> >  	  .vendor_id = IFCVF_VENDOR_ID,
> >  	  .device_id = IFCVF_BLK_MODERN_DEVICE_ID,
> > -	  .subsystem_vendor_id = IFCVF_SUBSYS_VENDOR_ID,
> > -	  .subsystem_device_id = IFCVF_SUBSYS_BLK_DEVICE_ID,
> > +	  .subsystem_vendor_id = RTE_PCI_ANY_ID,
> > +	  .subsystem_device_id = RTE_PCI_ANY_ID,
> >  	},
> >
> >  	{ .vendor_id = 0, /* sentinel */
> > --
> > 2.31.1
  

Patch

diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 49d68ad1b1..214d6e1f60 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -1824,8 +1824,8 @@  static const struct rte_pci_id pci_id_ifcvf_map[] = {
 	{ .class_id = RTE_CLASS_ANY_ID,
 	  .vendor_id = IFCVF_VENDOR_ID,
 	  .device_id = IFCVF_NET_MODERN_DEVICE_ID,
-	  .subsystem_vendor_id = IFCVF_SUBSYS_VENDOR_ID,
-	  .subsystem_device_id = IFCVF_SUBSYS_DEVICE_ID,
+	  .subsystem_vendor_id = RTE_PCI_ANY_ID,
+	  .subsystem_device_id = RTE_PCI_ANY_ID,
 	},
 
 	{ .class_id = RTE_CLASS_ANY_ID,
@@ -1845,8 +1845,8 @@  static const struct rte_pci_id pci_id_ifcvf_map[] = {
 	{ .class_id = RTE_CLASS_ANY_ID,
 	  .vendor_id = IFCVF_VENDOR_ID,
 	  .device_id = IFCVF_BLK_MODERN_DEVICE_ID,
-	  .subsystem_vendor_id = IFCVF_SUBSYS_VENDOR_ID,
-	  .subsystem_device_id = IFCVF_SUBSYS_BLK_DEVICE_ID,
+	  .subsystem_vendor_id = RTE_PCI_ANY_ID,
+	  .subsystem_device_id = RTE_PCI_ANY_ID,
 	},
 
 	{ .vendor_id = 0, /* sentinel */