Refactor code of linux_net to more cleaner and increase performace
The patch adds new functions '_get_phys_port_name' for reading physical
port name of the SR-IOV port and '_get_phys_switch_id' for reading
physical port switch ID of the SR-IOV port, in addition to refactoring
'get_representor_port' to use the new functions and decrease calls for
"_get_pf_func" and netdevs associated with the PF will now be processed
in the loop, however it will not be matching 'phys_port_name' which
ensures the correct behaviour.
In addition to updating the unit test for linux_net and remove not
needed mocks
Reviewed: https:/ /review. opendev. org/c/openstack /os-vif/ +/765419 /opendev. org/openstack/ os-vif/ commit/ 3e1d898b752c327 165aeca1fec0919 d858a87ec4
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/ussuri
commit 3e1d898b752c327 165aeca1fec0919 d858a87ec4
Author: Mamduh <email address hidden>
Date: Tue Aug 18 12:40:10 2020 +0300
Refactor code of linux_net to more cleaner and increase performace
The patch adds new functions '_get_phys_ port_name' for reading physical switch_ id' for reading representor_ port' to use the new functions and decrease calls for
port name of the SR-IOV port and '_get_phys_
physical port switch ID of the SR-IOV port, in addition to refactoring
'get_
"_get_pf_func" and netdevs associated with the PF will now be processed
in the loop, however it will not be matching 'phys_port_name' which
ensures the correct behaviour.
In addition to updating the unit test for linux_net and remove not
needed mocks
Conflicts:
vif_ plug_ovs/ linux_net. py
vif_ plug_ovs/ tests/unit/ test_linux_ net.py
Related-Bug: #1892132 ebfd03a4da21e22 32ccafb7a76 7ce189673d831bd 572f64d4ad)
Change-Id: I3fdbea4f48cb79
(cherry picked from commit 167bb030f1143f3