]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Qos SR-IOV: Refactor extension delete to get mac and pci slot
authorMoshe Levi <moshele@mellanox.com>
Tue, 18 Aug 2015 05:48:24 +0000 (08:48 +0300)
committerMoshe Levi <moshele@mellanox.com>
Mon, 7 Sep 2015 06:27:40 +0000 (09:27 +0300)
commit13901bdf6941d17069073f489798faaa86151fae
tree37cea3eebfae900585f3c5c96a88275d2dbc6d8d
parent4cbcb2eba4502b7fd65abb7c9af38cf02a38cc96
Qos SR-IOV: Refactor extension delete to get mac and pci slot

When calling delete we need the pci slot details to reset the VF rate. The problem
is that when the VM is deleted libvirt return the VF to the hypervisor and eswitch
manager will mark the pci_slot as unassigned so can't know from the mac which pci slot (VF)
to reset. Also newer libvirt version reset the mac when deleteing VM, so than it is
not possible at all.
The solution is to keep pci slot details locally in the agent since upon removal event
you cannot get pci_slot from the neutron server as it is for create/update since port
is already removed from neutron.

This patch pairs the mac and pci_slot for a device (VF) so when calling the extension
port delete api we can have the pci_slot and reset the VF rate.

It is also add a mapping between mac to port_id so we can pass the port_id
when calling the extention port delete api.

Partially-Implements: blueprint ml2-sriov-qos-with-bwlimiting
Closes-Bug: #1492909
Change-Id: Icc3a9599c6d7a4de9c56b452dfab7909c8d0a576
neutron/plugins/ml2/drivers/mech_sriov/agent/eswitch_manager.py
neutron/plugins/ml2/drivers/mech_sriov/agent/extension_drivers/qos_driver.py
neutron/plugins/ml2/drivers/mech_sriov/agent/pci_lib.py
neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py
neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/extension_drivers/test_qos_driver.py
neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/test_eswitch_manager.py
neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/test_pci_lib.py
neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/test_sriov_nic_agent.py