[dpdk-dev] [PATCH v4] net/tap: fix device removal when no queues exist

Wiles, Keith keith.wiles at intel.com
Mon May 21 14:52:26 CEST 2018



> On May 21, 2018, at 2:54 AM, Ophir Munk <ophirmu at mellanox.com> wrote:
> 
> TAP device is created following its first queue creation. Multiple
> queues can be added or removed over time. In Linux terminology those
> are file descriptors which are opened or closed over time. As long as
> the number of opened file descriptors is positive - TAP device will
> appear as a Linux device. In case all queues are released (the
> equivalent of all file descriptors being closed) the TAP device will
> be removed. This can lead to abnormalities in different scenarios
> where the TAP device should exist even if all its queues are released.
> In order to make TAP existence independent of its number of queues -
> an extra file descriptor is opened on TAP creation and is closed on
> TAP closure. Its only purpose is to serve as a keep-alive mechanism
> for the TAP device.
> 
> Fixes: bf7b7f437b49 ("net/tap: create netdevice during probing")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Ophir Munk <ophirmu at mellanox.com>
> ---
> v1:
> Initial release
> v2:
> Reword commit message (a fixing patch)
> v3:
> Following review comments (return value of ka_fd)
> and commit message typo fixing
> v4:
> Explicit setting pmd->ka_fd = -1 in eth_dev_tap_create()
> 

Acked by: Keith Wiles <keith.wiles at intel.com>

Regards,
Keith



More information about the dev mailing list