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
Related-Bug: #1892132
Change-Id: I3fdbea4f48cb79ebfd03a4da21e2232ccafb7a76
(cherry picked from commit 76f7565b99e637d74878955a0033f35e9eb0e13f)
Reviewed: https:/ /review. opendev. org/756406 /git.openstack. org/cgit/ openstack/ os-vif/ commit/ ?id=167bb030f11 43f37ce189673d8 31bd572f64d4ad
Committed: https:/
Submitter: Zuul
Branch: stable/victoria
commit 167bb030f1143f3 7ce189673d831bd 572f64d4ad
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
Related-Bug: #1892132 ebfd03a4da21e22 32ccafb7a76 74878955a0033f3 5e9eb0e13f)
Change-Id: I3fdbea4f48cb79
(cherry picked from commit 76f7565b99e637d