Message ID | 1475051112-5108-2-git-send-email-jasowang@redhat.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Yuanhan Liu |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 5EACD5687; Wed, 28 Sep 2016 10:25:24 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id C52465686 for <dev@dpdk.org>; Wed, 28 Sep 2016 10:25:22 +0200 (CEST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4CBC77F7DA; Wed, 28 Sep 2016 08:25:22 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (vpn1-6-179.pek2.redhat.com [10.72.6.179]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8S8PEqx005455; Wed, 28 Sep 2016 04:25:19 -0400 From: Jason Wang <jasowang@redhat.com> To: dev@dpdk.org Cc: huawei.xie@intel.com, yuanhan.liu@linux.intel.com, mst@redhat.com, vkaplans@redhat.com, Jason Wang <jasowang@redhat.com> Date: Wed, 28 Sep 2016 16:25:12 +0800 Message-Id: <1475051112-5108-2-git-send-email-jasowang@redhat.com> In-Reply-To: <1475051112-5108-1-git-send-email-jasowang@redhat.com> References: <1475051112-5108-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 28 Sep 2016 08:25:22 +0000 (UTC) Subject: [dpdk-dev] [PATCH V2 2/2] virtio: support IOMMU platform X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Jason Wang
Sept. 28, 2016, 8:25 a.m. UTC
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(-)
Comments
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
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
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
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
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
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. */