From: Jason Wang Subject: Re: [PATCH V2 2/2] virtio: support IOMMU platform Date: Thu, 20 Oct 2016 10:29:46 +0800 Message-ID: <704fa05e-9466-a8ce-675e-8749d7f63dda@redhat.com> References: <1475051112-5108-1-git-send-email-jasowang@redhat.com> <1475051112-5108-2-git-send-email-jasowang@redhat.com> <20161007042444.jbfoimmbuaxh2ped@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, huawei.xie@intel.com, yuanhan.liu@linux.intel.com, vkaplans@redhat.com To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 5768B6CC8 for ; Thu, 20 Oct 2016 04:29:54 +0200 (CEST) In-Reply-To: <20161007042444.jbfoimmbuaxh2ped@redhat.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 >> --- >> 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