vpp_device: bind to vfio-pci before running tests 88/34388/1
authorJuraj Linkeš <juraj.linkes@pantheon.tech>
Tue, 12 Oct 2021 08:03:04 +0000 (10:03 +0200)
committerJuraj Linkeš <juraj.linkes@pantheon.tech>
Mon, 8 Nov 2021 10:46:27 +0000 (11:46 +0100)
commitfe2c403ce6dac0483a4621ebf5472d0716ac8a55
treee6b600a78a6442556f52bccc4cba62319d955da6
parent3858b578e9e8d34ffd9d7767818d277364caa355
vpp_device: bind to vfio-pci before running tests

In rare cases, binding the whole /dev/vfio folder will result in
unusable VFs:
notice dpdk EAL: Cannot open /dev/vfio/151: Device or resource busy

[0], section 4.3.1. provides some clues as to what's going on and how to
avoid the failure. Mounting /dev/vfio reset the file descriptors of all
devices under /dev/vfio. Vfio-pci creates a device when an interface is
bound to it. The rare failure then occurs when /dev/vfio is mounted
while a process is using the file descriptors result in that process
using invalid file descriptors (or file descriptors belonging to a
different VF).

Fix the issue by binding i40e and ice VFs to vfio-pci before containers
are created and make sure that the VFs are not unbound later in testing.
Only bind DUT VFs since the TG uses the kernel driver.

[0]: https://connect.redhat.com/sites/default/files/2021-03/Cloud Native Network Function Requirements.pdf

Ticket: CSIT-1794

Change-Id: I83db91b29d16669fb034b141ad247f6f796fdf64
Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
resources/libraries/bash/function/device.sh
resources/libraries/python/DUTSetup.py
resources/libraries/robot/shared/interfaces.robot