[dpdk-dev] [PATCH 12/21] vhost: introduce guest IOVA to backend VA helper

Maxime Coquelin maxime.coquelin at redhat.com
Tue Sep 5 09:05:40 CEST 2017



On 09/05/2017 06:14 AM, Tiwei Bie wrote:
> On Thu, Aug 31, 2017 at 11:50:14AM +0200, Maxime Coquelin wrote:
>> This patch introduces vhost_iova_to_vva() function to translate
>> guest's IO virtual addresses to backend's virtual addresses.
>>
>> When IOMMU is enabled, the IOTLB cache is queried to get the
>> translation. If missing from the IOTLB cache, an IOTLB_MISS request
>> is sent to Qemu, and IOTLB cache is queried again on IOTLB event
>> notification.
>>
>> When IOMMU is disabled, the passed address is a guest's physical
>> address, so the legacy rte_vhost_gpa_to_vva() API is used.
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
>> ---
>>   lib/librte_vhost/vhost.c | 27 +++++++++++++++++++++++++++
>>   lib/librte_vhost/vhost.h |  3 +++
>>   2 files changed, 30 insertions(+)
>>
>> diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
>> index bae98b02d..0e8c0386a 100644
>> --- a/lib/librte_vhost/vhost.c
>> +++ b/lib/librte_vhost/vhost.c
>> @@ -48,9 +48,11 @@
>>   #include <rte_malloc.h>
>>   #include <rte_rwlock.h>
>>   #include <rte_vhost.h>
>> +#include <rte_rwlock.h>
> 
> This header isn't needed.
Right, I'll remove it.

Thanks,
Maxime
> 
> Best regards,
> Tiwei Bie
> 


More information about the dev mailing list