[dpdk-dev] [PATCH] vhost: fix checking of device features

Maxime Coquelin maxime.coquelin at redhat.com
Thu Jun 29 09:27:28 CEST 2017



On 06/29/2017 08:13 AM, Tan, Jianfeng wrote:
> 
> 
>> -----Original Message-----
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Ivan Dyukov
>> Sent: Wednesday, June 28, 2017 8:41 PM
>> To: yliu at fridaylinux.org; maxime.coquelin at redhat.com; dev at dpdk.org
>> Cc: i.maximets at samsung.com; heetae82.ahn at samsung.com; Ivan Dyukov;
>> stable at dpdk.org
>> Subject: [dpdk-dev] [PATCH] vhost: fix checking of device features
>>
>> To compare enabled features in current device we must use bit
>> mask instead of bit position.
>>
>> CC: stable at dpdk.org
>> Fixes: c843af3aa13e ("vhost: access header only")
>>
>> Signed-off-by: Ivan Dyukov <i.dyukov at samsung.com>
>> ---
>>   lib/librte_vhost/virtio_net.c | 8 +++++---
>>   1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
>> index ebfda1c..4fae4c1 100644
>> --- a/lib/librte_vhost/virtio_net.c
>> +++ b/lib/librte_vhost/virtio_net.c
>> @@ -601,9 +601,11 @@ static inline bool
>>   virtio_net_with_host_offload(struct virtio_net *dev)
>>   {
>>   	if (dev->features &
>> -			(VIRTIO_NET_F_CSUM | VIRTIO_NET_F_HOST_ECN |
>> -			 VIRTIO_NET_F_HOST_TSO4 |
>> VIRTIO_NET_F_HOST_TSO6 |
>> -			 VIRTIO_NET_F_HOST_UFO))
>> +			((1ULL << VIRTIO_NET_F_CSUM) |
>> +			 (1ULL << VIRTIO_NET_F_HOST_ECN) |
>> +			 (1ULL << VIRTIO_NET_F_HOST_TSO4) |
>> +			 (1ULL << VIRTIO_NET_F_HOST_TSO6) |
>> +			 (1ULL << VIRTIO_NET_F_HOST_UFO)))
> 
> Another problem in this piece of code, we don't support VIRTIO_NET_F_HOST_ECN and VIRTIO_NET_F_HOST_UFO in vhost-user. We might consider to remove those two lines?

It is not really a problem as the feature is never negotiated as not
supported, it would just be a clean-up.

I think we should stick with this version as it targets also -stable.

Another patch could be sent on top to remove these unsupported feature
bits.

Thanks,
Maxime

> Thanks,
> Jianfeng
> 
> 
>>   		return true;
>>
>>   	return false;
>> --
>> 2.7.4
> 


More information about the dev mailing list