[dpdk-dev] [PATCH v2 5/7] net/virtio_user: add vhost kernel support

Jason Wang jasowang at redhat.com
Wed Jan 11 03:45:14 CET 2017



On 2017年01月11日 10:30, Tan, Jianfeng wrote:
>
> Hi Jason,
>
>
> On 1/9/2017 12:39 PM, Jason Wang wrote:
>>> +    if (!enable) {
>>> +        if (dev->tapfds[pair_idx]) {
>>> +            close(dev->tapfds[pair_idx]);
>>> +            dev->tapfds[pair_idx] = -1;
>>> +        }
>>> +        return vhost_kernel_set_backend(vhostfd, -1);
>>
>> If this is used to for thing like ethtool -L in guest, we should use 
>> TUNSETQUEUE here.
>
> To make it clear, why we need to ioctl(..., TUNSETQUEUE, ...) here. 
> According to Linux/Documentation/networking/tuntap.txt,
>     "A new ioctl(TUNSETQUEUE) were introduced to enable or disable a 
> queue. When
>     calling it with IFF_DETACH_QUEUE flag, the queue were disabled. 
> And when
>     calling it with IFF_ATTACH_QUEUE flag, the queue were enabled. The 
> queue were
>     enabled by default after it was created through TUNSETIFF."
>
> As it's enabled by default, do you still see the necessity to call it 
> explicitly?

If you want to keep it enabled, no need. But if you want to disable one 
specific queue (which I believe is the case of !enable?), you need to 
call it.

Thanks

>
> Thanks,
> Jianfeng



More information about the dev mailing list