net/virtio: support modern device id
PATCH v2 1/2 net/virtio: support modern device id
Add modern device id and rename VIRTIO_PCI_DEVICEID_MIN to VIRTIO_PCI_LEGACY_DEVICEID_NET. While at it, remove unused macros too.
--- drivers/net/virtio/virtio_ethdev.c | 3 ++- drivers/net/virtio/virtio_pci.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/virtio/virtio_ethdev.c +2 -1
@@ -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 */ }, };
drivers/net/virtio/virtio_pci.h +2 -2
@@ -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
Signature · 1 line
2.7.4
PATCH v2 2/2 virtio: support IOMMU platform
Negotiate VIRTIO_F_IOMMU_PLATFORM to have IOMMU support.
---
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(-)
drivers/net/virtio/virtio_ethdev.h +2 -1
@@ -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
drivers/net/virtio/virtio_pci.h +2 -1
@@ -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. */
Signature · 1 line
2.7.4
Quoted 8 lines · Jason Wang
Add modern device id and rename
VIRTIO_PCI_DEVICEID_MINtoVIRTIO_PCI_LEGACY_DEVICEID_NET. While at it, remove unused macros too.Signed-off-by Jason Wang <[email protected]>--- drivers/net/virtio/virtio_ethdev.c | 3 ++- drivers/net/virtio/virtio_pci.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
Thanks,
Maxime
Re: [PATCH V2 2/2] virtio: support IOMMU platform
In reply to Jason WangQuoted 10 lines · Jason Wang
Negotiate
VIRTIO_F_IOMMU_PLATFORMto have IOMMU support.Signed-off-by Jason Wang <[email protected]>---
Changes from v1:
- remove unnecessaryNEED_MAPPINGflag--- drivers/net/virtio/virtio_ethdev.h | 3 ++- drivers/net/virtio/virtio_pci.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
Thanks,
Maxime
Re: [PATCH V2 2/2] virtio: support IOMMU platform
In reply to Jason WangQuoted 6 lines · Jason Wang
Negotiate
VIRTIO_F_IOMMU_PLATFORMto have IOMMU support.Signed-off-by Jason Wang <[email protected]>---
Changes from v1:
- remove unnecessaryNEED_MAPPINGflag
One thing we probably should do is enable this flag with VFIO but not with UIO or VFIO-noiommu.
Quoted 10 lines
--- drivers/net/virtio/virtio_ethdev.h | 3 ++- drivers/net/virtio/virtio_pci.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)drivers/net/virtio/virtio_ethdev.h +0
-0
drivers/net/virtio/virtio_ethdev.h line 67
Quoted 6 lines
drivers/net/virtio/virtio_ethdev.h +2
-1@@ -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.
Quoted 16 lines
drivers/net/virtio/virtio_ethdev.h +0
-0/* * CQ function prototype drivers/net/virtio/virtio_pci.h +1
-0@@ -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
drivers/net/virtio/virtio_pci.h struct virtnet_ctl; · line 150
Quoted 6 lines
drivers/net/virtio/virtio_pci.h +1
-1@@ -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?
Quoted 4 lines
drivers/net/virtio/virtio_pci.h +0
-0/* 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. */ Signature · 1 line
2.7.4
Quoted 4 lines · Jason Wang
Add modern device id and rename
VIRTIO_PCI_DEVICEID_MINtoVIRTIO_PCI_LEGACY_DEVICEID_NET. While at it, remove unused macros too.Signed-off-by Jason Wang <[email protected]>
Series applied to dpdk-next-virtio.
Thanks.
--yliu
Re: [PATCH V2 2/2] virtio: support IOMMU platform
In reply to Michael S. TsirkinQuoted 10 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Negotiate
VIRTIO_F_IOMMU_PLATFORMto have IOMMU support.Signed-off-by Jason Wang <[email protected]>---
Changes from v1:
- remove unnecessaryNEED_MAPPINGflagOne 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.
Quoted 5 lines
Quoted 5 lines
--- drivers/net/virtio/virtio_ethdev.h | 3 ++- drivers/net/virtio/virtio_pci.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
Quoted 13 lines
drivers/net/virtio/virtio_ethdev.h line 67
Quoted 11 lines
drivers/net/virtio/virtio_ethdev.h +2
-1@@ -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.
Quoted 6 lines
drivers/net/virtio/virtio_ethdev.h line 70
Quoted 4 lines
drivers/net/virtio/virtio_ethdev.h +1
-1#define VIRTIO_TRANSPORT_F_START 28 -#define VIRTIO_TRANSPORT_F_END 32 +#define VIRTIO_TRANSPORT_F_END 34This seems unused. Drop it?
Indeed. I will submit a patch to remove both (_START and _END).
--yliu
Re: [PATCH V2 2/2] virtio: support IOMMU platform
In reply to Michael S. TsirkinQuoted 9 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Negotiate
VIRTIO_F_IOMMU_PLATFORMto have IOMMU support.Signed-off-by Jason Wang <[email protected]>---
Changes from v1:
- remove unnecessaryNEED_MAPPINGflagOne 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.
Quoted 5 lines
Quoted 5 lines
--- drivers/net/virtio/virtio_ethdev.h | 3 ++- drivers/net/virtio/virtio_pci.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
Quoted 12 lines
drivers/net/virtio/virtio_ethdev.h line 67
Quoted 11 lines
drivers/net/virtio/virtio_ethdev.h +2
-1@@ -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.
Quoted 14 lines
Quoted 14 lines
drivers/net/virtio/virtio_ethdev.h +0
-0/* * CQ function prototype drivers/net/virtio/virtio_pci.h +1
-0@@ -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
Quoted 10 lines
drivers/net/virtio/virtio_pci.h struct virtnet_ctl; · line 150
Quoted 9 lines
drivers/net/virtio/virtio_pci.h +1
-1/* * 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 34This seems unused. Drop it?
Ok.
Quoted 5 lines
Quoted 5 lines
drivers/net/virtio/virtio_pci.h +0
-0/* 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. */ Signature · 1 line
2.7.4
Re: [PATCH V2 2/2] virtio: support IOMMU platform
In reply to Yuanhan LiuQuoted 11 lines · Yuanhan Liu
Quoted 9 lines · Michael S. Tsirkin
Quoted 6 lines · Jason Wang
Negotiate
VIRTIO_F_IOMMU_PLATFORMto have IOMMU support.Signed-off-by Jason Wang <[email protected]>---
Changes from v1:
- remove unnecessaryNEED_MAPPINGflagOne 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.
Quoted 20 lines
Quoted 6 lines
Quoted 6 lines
--- drivers/net/virtio/virtio_ethdev.h | 3 ++- drivers/net/virtio/virtio_pci.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)Quoted 12 lines
drivers/net/virtio/virtio_ethdev.h line 67
Quoted 11 lines
drivers/net/virtio/virtio_ethdev.h +2
-1@@ -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.
Quoted 8 lines
Quoted 5 lines
drivers/net/virtio/virtio_ethdev.h line 70
Quoted 4 lines
drivers/net/virtio/virtio_ethdev.h +1
-1#define VIRTIO_TRANSPORT_F_START 28 -#define VIRTIO_TRANSPORT_F_END 32 +#define VIRTIO_TRANSPORT_F_END 34This seems unused. Drop it?
Indeed. I will submit a patch to remove both (
_STARTand_END).--yliu
Thanks