neutron/neutron/privileged
Rodolfo Alonso Hernandez 2b2abfc76a Use pyroute2 for SRIOV VF commands
Recent changes in some versions of iproute2 CLI output (v4.18),
have invalidated the regular expression used to parse the
"ip link" output.

To solve this problem and avoid future ones, pyroute2 is used to
retrieve the virtual functions information and set the VF attributes
(spoofcheck, min_tx_rate, max_tx_rate and link_state).

pyroute2 extended the "ip link" support to retrieve this information,
adding "ext_mask=1" in the get command. If no virtual functions are
present in this particular network interface, the added method,
"get_link_vfs",  will return an empty list.

The set commands can return a "InterfaceOperationNotSupported" in
case the operation is not supported. For min_tx_rate, if the driver
does not support to set a minimum bandwidth, an "InvalidArgument"
(from a pyroute2.NetlinkError(22)) exception will be raised.

Conflicts:
    neutron/tests/unit/agent/linux/test_ip_link_support.py

Change-Id: I680da4f64bd114f1caecaaeedbf8a4b1915a0849
Closes-Bug: #1878042
(cherry picked from commit c5d8fd6329)
2020-06-26 06:09:48 +00:00
..
agent Use pyroute2 for SRIOV VF commands 2020-06-26 06:09:48 +00:00
__init__.py Kill all processes running in a namespace before deletion 2019-08-21 09:03:54 +00:00