All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/2] net/virtio: support modern device id
@ 2016-09-28  8:25 Jason Wang
  2016-09-28  8:25 ` [PATCH V2 2/2] virtio: support IOMMU platform Jason Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jason Wang @ 2016-09-28  8:25 UTC (permalink / raw)
  To: dev; +Cc: huawei.xie, yuanhan.liu, mst, vkaplans, Jason Wang

Add modern device id and rename VIRTIO_PCI_DEVICEID_MIN to
VIRTIO_PCI_LEGACY_DEVICEID_NET. While at it, remove unused macros too.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/net/virtio/virtio_ethdev.c | 3 ++-
 drivers/net/virtio/virtio_pci.h    | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index ef0d6ee..bb6181d 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -103,7 +103,8 @@ static int virtio_dev_queue_stats_mapping_set(
  * The set of PCI devices this driver supports
  */
 static const struct rte_pci_id pci_id_virtio_map[] = {
-	{ RTE_PCI_DEVICE(VIRTIO_PCI_VENDORID, VIRTIO_PCI_DEVICEID_MIN) },
+	{ RTE_PCI_DEVICE(VIRTIO_PCI_VENDORID, VIRTIO_PCI_LEGACY_DEVICEID_NET) },
+	{ RTE_PCI_DEVICE(VIRTIO_PCI_VENDORID, VIRTIO_PCI_MODERN_DEVICEID_NET) },
 	{ .vendor_id = 0, /* sentinel */ },
 };
 
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index dd7693f..3430a39 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -44,8 +44,8 @@ struct virtnet_ctl;
 
 /* VirtIO PCI vendor/device ID. */
 #define VIRTIO_PCI_VENDORID     0x1AF4
-#define VIRTIO_PCI_DEVICEID_MIN 0x1000
-#define VIRTIO_PCI_DEVICEID_MAX 0x103F
+#define VIRTIO_PCI_LEGACY_DEVICEID_NET 0x1000
+#define VIRTIO_PCI_MODERN_DEVICEID_NET 0x1041
 
 /* VirtIO ABI version, this must match exactly. */
 #define VIRTIO_PCI_ABI_VERSION 0
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH V2 2/2] virtio: support IOMMU platform
  2016-09-28  8:25 [PATCH V2 1/2] net/virtio: support modern device id Jason Wang
@ 2016-09-28  8:25 ` Jason Wang
  2016-09-29 12:39   ` Maxime Coquelin
  2016-10-07  4:24   ` Michael S. Tsirkin
  2016-09-29 12:38 ` [PATCH V2 1/2] net/virtio: support modern device id Maxime Coquelin
  2016-10-11  4:14 ` Yuanhan Liu
  2 siblings, 2 replies; 9+ messages in thread
From: Jason Wang @ 2016-09-28  8:25 UTC (permalink / raw)
  To: dev; +Cc: huawei.xie, yuanhan.liu, mst, vkaplans, Jason Wang

Negotiate VIRTIO_F_IOMMU_PLATFORM to have IOMMU support.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
Changes from v1:
- remove unnecessary NEED_MAPPING flag
---
 drivers/net/virtio/virtio_ethdev.h | 3 ++-
 drivers/net/virtio/virtio_pci.h    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
index 2ecec6e..04a06e2 100644
--- a/drivers/net/virtio/virtio_ethdev.h
+++ b/drivers/net/virtio/virtio_ethdev.h
@@ -63,7 +63,8 @@
 	 1u << VIRTIO_NET_F_CTRL_RX	  |	\
 	 1u << VIRTIO_NET_F_CTRL_VLAN	  |	\
 	 1u << VIRTIO_NET_F_MRG_RXBUF	  |	\
-	 1ULL << VIRTIO_F_VERSION_1)
+	 1ULL << VIRTIO_F_VERSION_1       |	\
+	 1ULL << VIRTIO_F_IOMMU_PLATFORM )
 
 /*
  * CQ function prototype
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index 3430a39..0aa0015 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -138,6 +138,7 @@ struct virtnet_ctl;
 #define VIRTIO_RING_F_INDIRECT_DESC	28
 
 #define VIRTIO_F_VERSION_1		32
+#define VIRTIO_F_IOMMU_PLATFORM	33
 
 /*
  * Some VirtIO feature bits (currently bits 28 through 31) are
@@ -145,7 +146,7 @@ struct virtnet_ctl;
  * rest are per-device feature bits.
  */
 #define VIRTIO_TRANSPORT_F_START 28
-#define VIRTIO_TRANSPORT_F_END   32
+#define VIRTIO_TRANSPORT_F_END   34
 
 /* The Guest publishes the used index for which it expects an interrupt
  * at the end of the avail ring. Host should ignore the avail->flags field. */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH V2 1/2] net/virtio: support modern device id
  2016-09-28  8:25 [PATCH V2 1/2] net/virtio: support modern device id Jason Wang
  2016-09-28  8:25 ` [PATCH V2 2/2] virtio: support IOMMU platform Jason Wang
@ 2016-09-29 12:38 ` Maxime Coquelin
  2016-10-11  4:14 ` Yuanhan Liu
  2 siblings, 0 replies; 9+ messages in thread
From: Maxime Coquelin @ 2016-09-29 12:38 UTC (permalink / raw)
  To: Jason Wang, dev; +Cc: huawei.xie, yuanhan.liu, mst, vkaplans



On 09/28/2016 10:25 AM, Jason Wang wrote:
> Add modern device id and rename VIRTIO_PCI_DEVICEID_MIN to
> VIRTIO_PCI_LEGACY_DEVICEID_NET. While at it, remove unused macros too.
>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 3 ++-
>  drivers/net/virtio/virtio_pci.h    | 4 ++--
>  2 files changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2 2/2] virtio: support IOMMU platform
  2016-09-28  8:25 ` [PATCH V2 2/2] virtio: support IOMMU platform Jason Wang
@ 2016-09-29 12:39   ` Maxime Coquelin
  2016-10-07  4:24   ` Michael S. Tsirkin
  1 sibling, 0 replies; 9+ messages in thread
From: Maxime Coquelin @ 2016-09-29 12:39 UTC (permalink / raw)
  To: Jason Wang, dev; +Cc: huawei.xie, yuanhan.liu, mst, vkaplans



On 09/28/2016 10:25 AM, Jason Wang wrote:
> Negotiate VIRTIO_F_IOMMU_PLATFORM to have IOMMU support.
>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> Changes from v1:
> - remove unnecessary NEED_MAPPING flag
> ---
>  drivers/net/virtio/virtio_ethdev.h | 3 ++-
>  drivers/net/virtio/virtio_pci.h    | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2 2/2] virtio: support IOMMU platform
  2016-09-28  8:25 ` [PATCH V2 2/2] virtio: support IOMMU platform Jason Wang
  2016-09-29 12:39   ` Maxime Coquelin
@ 2016-10-07  4:24   ` Michael S. Tsirkin
  2016-10-11  4:14     ` Yuanhan Liu
  2016-10-20  2:29     ` Jason Wang
  1 sibling, 2 replies; 9+ messages in thread
From: Michael S. Tsirkin @ 2016-10-07  4:24 UTC (permalink / raw)
  To: Jason Wang; +Cc: dev, huawei.xie, yuanhan.liu, vkaplans

On Wed, Sep 28, 2016 at 04:25:12PM +0800, Jason Wang wrote:
> Negotiate VIRTIO_F_IOMMU_PLATFORM to have IOMMU support.
> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> Changes from v1:
> - remove unnecessary NEED_MAPPING flag

One thing we probably should do is enable this flag
with VFIO but not with UIO or VFIO-noiommu.

> ---
>  drivers/net/virtio/virtio_ethdev.h | 3 ++-
>  drivers/net/virtio/virtio_pci.h    | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
> index 2ecec6e..04a06e2 100644
> --- a/drivers/net/virtio/virtio_ethdev.h
> +++ b/drivers/net/virtio/virtio_ethdev.h
> @@ -63,7 +63,8 @@
>  	 1u << VIRTIO_NET_F_CTRL_RX	  |	\
>  	 1u << VIRTIO_NET_F_CTRL_VLAN	  |	\
>  	 1u << VIRTIO_NET_F_MRG_RXBUF	  |	\
> -	 1ULL << VIRTIO_F_VERSION_1)
> +	 1ULL << VIRTIO_F_VERSION_1       |	\
> +	 1ULL << VIRTIO_F_IOMMU_PLATFORM )

Space before ) looks kind of ugly.

>  
>  /*
>   * CQ function prototype
> diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
> index 3430a39..0aa0015 100644
> --- a/drivers/net/virtio/virtio_pci.h
> +++ b/drivers/net/virtio/virtio_pci.h
> @@ -138,6 +138,7 @@ struct virtnet_ctl;
>  #define VIRTIO_RING_F_INDIRECT_DESC	28
>  
>  #define VIRTIO_F_VERSION_1		32
> +#define VIRTIO_F_IOMMU_PLATFORM	33
>  
>  /*
>   * Some VirtIO feature bits (currently bits 28 through 31) are
> @@ -145,7 +146,7 @@ struct virtnet_ctl;
>   * rest are per-device feature bits.
>   */
>  #define VIRTIO_TRANSPORT_F_START 28
> -#define VIRTIO_TRANSPORT_F_END   32
> +#define VIRTIO_TRANSPORT_F_END   34
>  

This seems unused. Drop it?

>  /* The Guest publishes the used index for which it expects an interrupt
>   * at the end of the avail ring. Host should ignore the avail->flags field. */
> -- 
> 2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2 1/2] net/virtio: support modern device id
  2016-09-28  8:25 [PATCH V2 1/2] net/virtio: support modern device id Jason Wang
  2016-09-28  8:25 ` [PATCH V2 2/2] virtio: support IOMMU platform Jason Wang
  2016-09-29 12:38 ` [PATCH V2 1/2] net/virtio: support modern device id Maxime Coquelin
@ 2016-10-11  4:14 ` Yuanhan Liu
  2 siblings, 0 replies; 9+ messages in thread
From: Yuanhan Liu @ 2016-10-11  4:14 UTC (permalink / raw)
  To: Jason Wang; +Cc: dev, huawei.xie, mst, vkaplans

On Wed, Sep 28, 2016 at 04:25:11PM +0800, Jason Wang wrote:
> Add modern device id and rename VIRTIO_PCI_DEVICEID_MIN to
> VIRTIO_PCI_LEGACY_DEVICEID_NET. While at it, remove unused macros too.
> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>

Series applied to dpdk-next-virtio.

Thanks.

	--yliu

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2 2/2] virtio: support IOMMU platform
  2016-10-07  4:24   ` Michael S. Tsirkin
@ 2016-10-11  4:14     ` Yuanhan Liu
  2016-10-20  4:07       ` Jason Wang
  2016-10-20  2:29     ` Jason Wang
  1 sibling, 1 reply; 9+ messages in thread
From: Yuanhan Liu @ 2016-10-11  4:14 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Jason Wang, dev, huawei.xie, vkaplans


On Fri, Oct 07, 2016 at 07:24:44AM +0300, Michael S. Tsirkin wrote:
> On Wed, Sep 28, 2016 at 04:25:12PM +0800, Jason Wang wrote:
> > Negotiate VIRTIO_F_IOMMU_PLATFORM to have IOMMU support.
> > 
> > Signed-off-by: Jason Wang <jasowang@redhat.com>
> > ---
> > Changes from v1:
> > - remove unnecessary NEED_MAPPING flag
> 
> One thing we probably should do is enable this flag
> with VFIO but not with UIO or VFIO-noiommu.

Good suggestion. I think we could do that in another patch.

> > ---
> >  drivers/net/virtio/virtio_ethdev.h | 3 ++-
> >  drivers/net/virtio/virtio_pci.h    | 3 ++-
> >  2 files changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
> > index 2ecec6e..04a06e2 100644
> > --- a/drivers/net/virtio/virtio_ethdev.h
> > +++ b/drivers/net/virtio/virtio_ethdev.h
> > @@ -63,7 +63,8 @@
> >  	 1u << VIRTIO_NET_F_CTRL_RX	  |	\
> >  	 1u << VIRTIO_NET_F_CTRL_VLAN	  |	\
> >  	 1u << VIRTIO_NET_F_MRG_RXBUF	  |	\
> > -	 1ULL << VIRTIO_F_VERSION_1)
> > +	 1ULL << VIRTIO_F_VERSION_1       |	\
> > +	 1ULL << VIRTIO_F_IOMMU_PLATFORM )
> 
> Space before ) looks kind of ugly.

Yes, a bit. I will remove it while apply.

> >  #define VIRTIO_TRANSPORT_F_START 28
> > -#define VIRTIO_TRANSPORT_F_END   32
> > +#define VIRTIO_TRANSPORT_F_END   34
> >  
> 
> This seems unused. Drop it?

Indeed. I will submit a patch to remove both (_START and _END).

	--yliu

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2 2/2] virtio: support IOMMU platform
  2016-10-07  4:24   ` Michael S. Tsirkin
  2016-10-11  4:14     ` Yuanhan Liu
@ 2016-10-20  2:29     ` Jason Wang
  1 sibling, 0 replies; 9+ messages in thread
From: Jason Wang @ 2016-10-20  2:29 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: dev, huawei.xie, yuanhan.liu, vkaplans



On 2016年10月07日 12:24, Michael S. Tsirkin wrote:
> On Wed, Sep 28, 2016 at 04:25:12PM +0800, Jason Wang wrote:
>> Negotiate VIRTIO_F_IOMMU_PLATFORM to have IOMMU support.
>>
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
>> ---
>> Changes from v1:
>> - remove unnecessary NEED_MAPPING flag
> One thing we probably should do is enable this flag
> with VFIO but not with UIO or VFIO-noiommu.

Sounds good, will try do it in next version.

>> ---
>>   drivers/net/virtio/virtio_ethdev.h | 3 ++-
>>   drivers/net/virtio/virtio_pci.h    | 3 ++-
>>   2 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
>> index 2ecec6e..04a06e2 100644
>> --- a/drivers/net/virtio/virtio_ethdev.h
>> +++ b/drivers/net/virtio/virtio_ethdev.h
>> @@ -63,7 +63,8 @@
>>   	 1u << VIRTIO_NET_F_CTRL_RX	  |	\
>>   	 1u << VIRTIO_NET_F_CTRL_VLAN	  |	\
>>   	 1u << VIRTIO_NET_F_MRG_RXBUF	  |	\
>> -	 1ULL << VIRTIO_F_VERSION_1)
>> +	 1ULL << VIRTIO_F_VERSION_1       |	\
>> +	 1ULL << VIRTIO_F_IOMMU_PLATFORM )
> Space before ) looks kind of ugly.

Will fix this.

>
>>   
>>   /*
>>    * CQ function prototype
>> diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
>> index 3430a39..0aa0015 100644
>> --- a/drivers/net/virtio/virtio_pci.h
>> +++ b/drivers/net/virtio/virtio_pci.h
>> @@ -138,6 +138,7 @@ struct virtnet_ctl;
>>   #define VIRTIO_RING_F_INDIRECT_DESC	28
>>   
>>   #define VIRTIO_F_VERSION_1		32
>> +#define VIRTIO_F_IOMMU_PLATFORM	33
>>   
>>   /*
>>    * Some VirtIO feature bits (currently bits 28 through 31) are
>> @@ -145,7 +146,7 @@ struct virtnet_ctl;
>>    * rest are per-device feature bits.
>>    */
>>   #define VIRTIO_TRANSPORT_F_START 28
>> -#define VIRTIO_TRANSPORT_F_END   32
>> +#define VIRTIO_TRANSPORT_F_END   34
>>   
> This seems unused. Drop it?

Ok.

>
>>   /* The Guest publishes the used index for which it expects an interrupt
>>    * at the end of the avail ring. Host should ignore the avail->flags field. */
>> -- 
>> 2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2 2/2] virtio: support IOMMU platform
  2016-10-11  4:14     ` Yuanhan Liu
@ 2016-10-20  4:07       ` Jason Wang
  0 siblings, 0 replies; 9+ messages in thread
From: Jason Wang @ 2016-10-20  4:07 UTC (permalink / raw)
  To: Yuanhan Liu, Michael S. Tsirkin; +Cc: dev, huawei.xie, vkaplans



On 2016年10月11日 12:14, Yuanhan Liu wrote:
> On Fri, Oct 07, 2016 at 07:24:44AM +0300, Michael S. Tsirkin wrote:
>> On Wed, Sep 28, 2016 at 04:25:12PM +0800, Jason Wang wrote:
>>> Negotiate VIRTIO_F_IOMMU_PLATFORM to have IOMMU support.
>>>
>>> Signed-off-by: Jason Wang <jasowang@redhat.com>
>>> ---
>>> Changes from v1:
>>> - remove unnecessary NEED_MAPPING flag
>> One thing we probably should do is enable this flag
>> with VFIO but not with UIO or VFIO-noiommu.
> Good suggestion. I think we could do that in another patch.

Yes.

>
>>> ---
>>>   drivers/net/virtio/virtio_ethdev.h | 3 ++-
>>>   drivers/net/virtio/virtio_pci.h    | 3 ++-
>>>   2 files changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
>>> index 2ecec6e..04a06e2 100644
>>> --- a/drivers/net/virtio/virtio_ethdev.h
>>> +++ b/drivers/net/virtio/virtio_ethdev.h
>>> @@ -63,7 +63,8 @@
>>>   	 1u << VIRTIO_NET_F_CTRL_RX	  |	\
>>>   	 1u << VIRTIO_NET_F_CTRL_VLAN	  |	\
>>>   	 1u << VIRTIO_NET_F_MRG_RXBUF	  |	\
>>> -	 1ULL << VIRTIO_F_VERSION_1)
>>> +	 1ULL << VIRTIO_F_VERSION_1       |	\
>>> +	 1ULL << VIRTIO_F_IOMMU_PLATFORM )
>> Space before ) looks kind of ugly.
> Yes, a bit. I will remove it while apply.
>
>>>   #define VIRTIO_TRANSPORT_F_START 28
>>> -#define VIRTIO_TRANSPORT_F_END   32
>>> +#define VIRTIO_TRANSPORT_F_END   34
>>>   
>> This seems unused. Drop it?
> Indeed. I will submit a patch to remove both (_START and _END).
>
> 	--yliu

Thanks

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-10-20  4:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-28  8:25 [PATCH V2 1/2] net/virtio: support modern device id Jason Wang
2016-09-28  8:25 ` [PATCH V2 2/2] virtio: support IOMMU platform Jason Wang
2016-09-29 12:39   ` Maxime Coquelin
2016-10-07  4:24   ` Michael S. Tsirkin
2016-10-11  4:14     ` Yuanhan Liu
2016-10-20  4:07       ` Jason Wang
2016-10-20  2:29     ` Jason Wang
2016-09-29 12:38 ` [PATCH V2 1/2] net/virtio: support modern device id Maxime Coquelin
2016-10-11  4:14 ` Yuanhan Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.