The current logic in get_representor_port() matches the VF number with
the one in 'phys_port_name' file. If and when multiple PFs on the same
card are configured in switchdev mode, we could end up returning a wrong
representor device. Fix this by including the parent PF number also in
this logic, when 'pfXvfY' (or vfY@pfX) format is used in 'phys_port_name'
file.
This patch also provides corresponding changes in unit tests. The tests
have been updated to validate 'phys_port_name' in 'pfXvfY' format (in
addition to the simple format - vfX or X). The test case for 2 PFs
specifically utilizes the 'pfXvfY' format, since otherwise it won't
be possible to disambiguate VFs with the same VF-ID under 2 PFs on the
same card (switch).
Reviewed: https:/ /review. openstack. org/554917 /git.openstack. org/cgit/ openstack/ os-vif/ commit/ ?id=b026d54016c 714a09aab9de0af d264a17d125dcd
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit b026d54016c714a 09aab9de0afd264 a17d125dcd
Author: Sriharsha Basavapatna <email address hidden>
Date: Wed Jan 3 18:33:28 2018 +0530
Fix VF-rep lookup routine to use parent PF number
The current logic in get_representor _port() matches the VF number with
the one in 'phys_port_name' file. If and when multiple PFs on the same
card are configured in switchdev mode, we could end up returning a wrong
representor device. Fix this by including the parent PF number also in
this logic, when 'pfXvfY' (or vfY@pfX) format is used in 'phys_port_name'
file.
This patch also provides corresponding changes in unit tests. The tests
have been updated to validate 'phys_port_name' in 'pfXvfY' format (in
addition to the simple format - vfX or X). The test case for 2 PFs
specifically utilizes the 'pfXvfY' format, since otherwise it won't
be possible to disambiguate VFs with the same VF-ID under 2 PFs on the
same card (switch).
Change-Id: I5727878b63026a 19fafcf7e71dda3 ba480432fbf f5566c1439c3983 db23672a45)
Closes-Bug: #1743494
Signed-off-by: Sriharsha Basavapatna <email address hidden>
(cherry picked from commit 84688a22db22039