# \[PATCH RESEND 0/2\] update virtio id table

- Subsystems: Intel VIRTIO DATA PATH ACCELERATOR, THE REST, VIRTIO CORE
- Maintainers: Zhu Lingshan, Linus Torvalds, "Michael S. Tsirkin", Jason Wang, Eugenio Pérez
- Series: 2 patches touching 3 files, +25/-22
- Revision resend (2 revisions archived).
- List: netdev
- 6 messages, 3 authors
- Page: https://ratatoskr.run/netdev/2021/05/11204179/t

## \[PATCH RESEND 0/2\] update virtio id table

- From: Zhu Lingshan \<hidden\>
- Date: 2021-05-31 07:33:53 
- Message: https://ratatoskr.run/netdev/2021/05/11204179.md

```text
This series updates virtio id table by adding
transitional device ids. Then reuses the ids
in ifcvf driver

Zhu Lingshan (2):
  virtio: update virtio id table, add transitional ids
  vDPA/ifcvf: reuse pre-defined macros for device ids and vendor ids

 drivers/vdpa/ifcvf/ifcvf_base.h | 12 ------------
 drivers/vdpa/ifcvf/ifcvf_main.c | 23 +++++++++++++----------
 include/uapi/linux/virtio_ids.h | 12 ++++++++++++
 3 files changed, 25 insertions(+), 22 deletions(-)

-- 
2.27.0

```

## \[PATCH RESEND 1/2\] virtio: update virtio id table, add transitional ids

- From: Zhu Lingshan \<hidden\>
- Date: 2021-05-31 07:33:57 
- Message: https://ratatoskr.run/netdev/2021/05/11204180.md

```text
This commit updates virtio id table by adding transitional device
ids

Signed-off-by: Zhu Lingshan <redacted>
---
 include/uapi/linux/virtio_ids.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h
index f0c35ce8628c..fcc9ec6a73c1 100644
--- a/include/uapi/linux/virtio_ids.h
+++ b/include/uapi/linux/virtio_ids.h
@@ -57,4 +57,16 @@
 #define VIRTIO_ID_BT			28 /* virtio bluetooth */
 #define VIRTIO_ID_MAC80211_HWSIM	29 /* virtio mac80211-hwsim */
 
+/*
+ * Virtio Transitional IDs
+ */
+
+#define VIRTIO_TRANS_ID_NET		1000 /* transitional virtio net */
+#define VIRTIO_TRANS_ID_BLOCK		1001 /* transitional virtio block */
+#define VIRTIO_TRANS_ID_BALLOON		1002 /* transitional virtio balloon */
+#define VIRTIO_TRANS_ID_CONSOLE		1003 /* transitional virtio console */
+#define VIRTIO_TRANS_ID_SCSI		1004 /* transitional virtio SCSI */
+#define VIRTIO_TRANS_ID_RNG		1005 /* transitional virtio rng */
+#define VIRTIO_TRANS_ID_9P		1009 /* transitional virtio 9p console */
+
 #endif /* _LINUX_VIRTIO_IDS_H */
-- 
2.27.0

```

## \[PATCH RESEND 2/2\] vDPA/ifcvf: reuse pre-defined macros for device ids and vendor ids

- From: Zhu Lingshan \<hidden\>
- Date: 2021-05-31 07:34:04 
- Message: https://ratatoskr.run/netdev/2021/05/11204181.md

```text
This commit would reuse pre-defined macros for ifcvf device ids
and vendor ids

Signed-off-by: Zhu Lingshan <redacted>
---
 drivers/vdpa/ifcvf/ifcvf_base.h | 12 ------------
 drivers/vdpa/ifcvf/ifcvf_main.c | 23 +++++++++++++----------
 2 files changed, 13 insertions(+), 22 deletions(-)

diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/drivers/vdpa/ifcvf/ifcvf_base.h
index 0111bfdeb342..ded1b1b5fb13 100644
--- a/drivers/vdpa/ifcvf/ifcvf_base.h
+++ b/drivers/vdpa/ifcvf/ifcvf_base.h
@@ -19,21 +19,9 @@
 #include <uapi/linux/virtio_config.h>
 #include <uapi/linux/virtio_pci.h>
 
-#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 C5000X_PL_BLK_VENDOR_ID		0x1AF4
-#define C5000X_PL_BLK_DEVICE_ID		0x1001
-#define C5000X_PL_BLK_SUBSYS_VENDOR_ID	0x8086
-#define C5000X_PL_BLK_SUBSYS_DEVICE_ID	0x0002
-
 #define IFCVF_NET_SUPPORTED_FEATURES \
 		((1ULL << VIRTIO_NET_F_MAC)			| \
 		 (1ULL << VIRTIO_F_ANY_LAYOUT)			| \
diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
index ab0ab5cf0f6e..bc1d59f316d1 100644
--- a/drivers/vdpa/ifcvf/ifcvf_main.c
+++ b/drivers/vdpa/ifcvf/ifcvf_main.c
@@ -536,18 +536,21 @@ static void ifcvf_remove(struct pci_dev *pdev)
 }
 
 static struct pci_device_id ifcvf_pci_ids[] = {
-	{ PCI_DEVICE_SUB(N3000_VENDOR_ID,
+	/* N3000 network device */
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_REDHAT_QUMRANET,
 			 N3000_DEVICE_ID,
-			 N3000_SUBSYS_VENDOR_ID,
+			 PCI_VENDOR_ID_INTEL,
 			 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) },
-	{ PCI_DEVICE_SUB(C5000X_PL_BLK_VENDOR_ID,
-			 C5000X_PL_BLK_DEVICE_ID,
-			 C5000X_PL_BLK_SUBSYS_VENDOR_ID,
-			 C5000X_PL_BLK_SUBSYS_DEVICE_ID) },
+	/* C5000X-PL network device */
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_REDHAT_QUMRANET,
+			 VIRTIO_TRANS_ID_NET,
+			 PCI_VENDOR_ID_INTEL,
+			 VIRTIO_ID_NET) },
+	/* C5000X-PL block device */
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_REDHAT_QUMRANET,
+			 VIRTIO_TRANS_ID_BLOCK,
+			 PCI_VENDOR_ID_INTEL,
+			 VIRTIO_ID_BLOCK) },
 
 	{ 0 },
 };
-- 
2.27.0

```

## Re: \[PATCH RESEND 1/2\] virtio: update virtio id table, add transitional ids

- From: Cornelia Huck \<cohuck@redhat.com\>
- Date: 2021-05-31 07:58:22 
- Message: https://ratatoskr.run/netdev/2021/05/11204187.md

```text
On Mon, 31 May 2021 15:27:42 +0800
Zhu Lingshan [ref] wrote:

> This commit updates virtio id table by adding transitional device
> ids
> 
> Signed-off-by: Zhu Lingshan <redacted>
> ---
>  include/uapi/linux/virtio_ids.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h
> index f0c35ce8628c..fcc9ec6a73c1 100644
> --- a/include/uapi/linux/virtio_ids.h
> +++ b/include/uapi/linux/virtio_ids.h
> @@ -57,4 +57,16 @@
>  #define VIRTIO_ID_BT			28 /* virtio bluetooth */
>  #define VIRTIO_ID_MAC80211_HWSIM	29 /* virtio mac80211-hwsim */
>  
> +/*
> + * Virtio Transitional IDs
> + */
> +
> +#define VIRTIO_TRANS_ID_NET		1000 /* transitional virtio net */
> +#define VIRTIO_TRANS_ID_BLOCK		1001 /* transitional virtio block */
> +#define VIRTIO_TRANS_ID_BALLOON		1002 /* transitional virtio balloon */
> +#define VIRTIO_TRANS_ID_CONSOLE		1003 /* transitional virtio console */
> +#define VIRTIO_TRANS_ID_SCSI		1004 /* transitional virtio SCSI */
> +#define VIRTIO_TRANS_ID_RNG		1005 /* transitional virtio rng */
> +#define VIRTIO_TRANS_ID_9P		1009 /* transitional virtio 9p console */
> +
>  #endif /* _LINUX_VIRTIO_IDS_H */

Isn't this a purely virtio-pci concept? (The spec lists the virtio ids
in the common section, and those transitional ids in the pci section.)
IOW, is there a better, virtio-pci specific, header for this?

```

## Re: \[PATCH RESEND 1/2\] virtio: update virtio id table, add transitional ids

- From: Zhu, Lingshan \<hidden\>
- Date: 2021-05-31 09:57:57 
- Message: https://ratatoskr.run/netdev/2021/05/11204194.md

```text


On 5/31/2021 3:58 PM, Cornelia Huck wrote:
> On Mon, 31 May 2021 15:27:42 +0800
> Zhu Lingshan [ref] wrote:
>
>> This commit updates virtio id table by adding transitional device
>> ids
>> virtio_pci_common.h
>> Signed-off-by: Zhu Lingshan <redacted>
>> ---
>>   include/uapi/linux/virtio_ids.h | 12 ++++++++++++
>>   1 file changed, 12 insertions(+)
>>
>> diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h
>> index f0c35ce8628c..fcc9ec6a73c1 100644
>> --- a/include/uapi/linux/virtio_ids.h
>> +++ b/include/uapi/linux/virtio_ids.h
>> @@ -57,4 +57,16 @@
>>   #define VIRTIO_ID_BT			28 /* virtio bluetooth */
>>   #define VIRTIO_ID_MAC80211_HWSIM	29 /* virtio mac80211-hwsim */
>>   
>> +/*
>> + * Virtio Transitional IDs
>> + */
>> +
>> +#define VIRTIO_TRANS_ID_NET		1000 /* transitional virtio net */
>> +#define VIRTIO_TRANS_ID_BLOCK		1001 /* transitional virtio block */
>> +#define VIRTIO_TRANS_ID_BALLOON		1002 /* transitional virtio balloon */
>> +#define VIRTIO_TRANS_ID_CONSOLE		1003 /* transitional virtio console */
>> +#define VIRTIO_TRANS_ID_SCSI		1004 /* transitional virtio SCSI */
>> +#define VIRTIO_TRANS_ID_RNG		1005 /* transitional virtio rng */
>> +#define VIRTIO_TRANS_ID_9P		1009 /* transitional virtio 9p console */
>> +
>>   #endif /* _LINUX_VIRTIO_IDS_H */
> Isn't this a purely virtio-pci concept? (The spec lists the virtio ids
> in the common section, and those transitional ids in the pci section.)
> IOW, is there a better, virtio-pci specific, header for this?
Hi Cornelia,

yes they are pure virtio-pci transitional concept. There is a virtio_pci.h, but not looks like
a good place for these stuffs, Michael ever suggested to add these ids to virtio_ids.h, so I have
chosen this file.

https://www.spinics.net/lists/netdev/msg739269.html

Thanks
Zhu Lingshan
>

```

## Re: \[PATCH RESEND 1/2\] virtio: update virtio id table, add transitional ids

- From: Michael S. Tsirkin \<mst@redhat.com\>
- Date: 2021-05-31 10:20:32 
- Message: https://ratatoskr.run/netdev/2021/05/11204197.md

```text
On Mon, May 31, 2021 at 05:57:47PM +0800, Zhu, Lingshan wrote:
> 
> 
> On 5/31/2021 3:58 PM, Cornelia Huck wrote:
> > On Mon, 31 May 2021 15:27:42 +0800
> > Zhu Lingshan [ref] wrote:
> > 
> > > This commit updates virtio id table by adding transitional device
> > > ids
> > > virtio_pci_common.h
> > > Signed-off-by: Zhu Lingshan <redacted>
> > > ---
> > >   include/uapi/linux/virtio_ids.h | 12 ++++++++++++
> > >   1 file changed, 12 insertions(+)
> > > 
> > > diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h
> > > index f0c35ce8628c..fcc9ec6a73c1 100644
> > > --- a/include/uapi/linux/virtio_ids.h
> > > +++ b/include/uapi/linux/virtio_ids.h
> > > @@ -57,4 +57,16 @@
> > >   #define VIRTIO_ID_BT			28 /* virtio bluetooth */
> > >   #define VIRTIO_ID_MAC80211_HWSIM	29 /* virtio mac80211-hwsim */
> > > +/*
> > > + * Virtio Transitional IDs
> > > + */
> > > +
> > > +#define VIRTIO_TRANS_ID_NET		1000 /* transitional virtio net */
> > > +#define VIRTIO_TRANS_ID_BLOCK		1001 /* transitional virtio block */
> > > +#define VIRTIO_TRANS_ID_BALLOON		1002 /* transitional virtio balloon */
> > > +#define VIRTIO_TRANS_ID_CONSOLE		1003 /* transitional virtio console */
> > > +#define VIRTIO_TRANS_ID_SCSI		1004 /* transitional virtio SCSI */
> > > +#define VIRTIO_TRANS_ID_RNG		1005 /* transitional virtio rng */
> > > +#define VIRTIO_TRANS_ID_9P		1009 /* transitional virtio 9p console */
> > > +
> > >   #endif /* _LINUX_VIRTIO_IDS_H */
> > Isn't this a purely virtio-pci concept? (The spec lists the virtio ids
> > in the common section, and those transitional ids in the pci section.)
> > IOW, is there a better, virtio-pci specific, header for this?
> Hi Cornelia,
> 
> yes they are pure virtio-pci transitional concept. There is a virtio_pci.h,
> but not looks like
> a good place for these stuffs, Michael ever suggested to add these ids to
> virtio_ids.h, so I have
> chosen this file.
> 
> https://www.spinics.net/lists/netdev/msg739269.html

Didn't think straight, virtio_pci.h is better.

> Thanks
> Zhu Lingshan
> > 

```
