VF-rep lookup routine should also use the parent PF number

Bug #1743494 reported by Sriharsha Basavapatna
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-vif
Fix Released
Undecided
Sriharsha Basavapatna
Queens
Fix Committed
Undecided
YaZug

Bug Description

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 VF-representor device, as the PFs would have the same switch-id. For example,
assume there are 2 PFs - PF1 and PF2, each a VF: VF1. Then, a query to get the representor for (PF1, VF1) could return the representor for (PF2, VF1). This is because the code assumes that the 'phys_port_name' only uses the simple format of '1' or 'VF1', without any reference to its parent PF.

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.

Changed in os-vif:
assignee: nobody → Sriharsha Basavapatna (harshab)
status: New → In Progress
Revision history for this message
Sriharsha Basavapatna (harshab) wrote :
Changed in os-vif:
assignee: Sriharsha Basavapatna (harshab) → sean mooney (sean-k-mooney)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-vif (master)

Reviewed: https://review.openstack.org/531674
Committed: https://git.openstack.org/cgit/openstack/os-vif/commit/?id=84688a22db22039f5566c1439c3983db23672a45
Submitter: Zuul
Branch: master

commit 84688a22db22039f5566c1439c3983db23672a45
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: I5727878b63026a19fafcf7e71dda3ba480432fbf
    Closes-Bug: #1743494
    Signed-off-by: Sriharsha Basavapatna <email address hidden>

Changed in os-vif:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-vif (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/554917

Matt Riedemann (mriedem)
Changed in os-vif:
assignee: sean mooney (sean-k-mooney) → Sriharsha Basavapatna (harshab)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-vif 1.10.0

This issue was fixed in the openstack/os-vif 1.10.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-vif (stable/queens)

Reviewed: https://review.openstack.org/554917
Committed: https://git.openstack.org/cgit/openstack/os-vif/commit/?id=b026d54016c714a09aab9de0afd264a17d125dcd
Submitter: Zuul
Branch: stable/queens

commit b026d54016c714a09aab9de0afd264a17d125dcd
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: I5727878b63026a19fafcf7e71dda3ba480432fbf
    Closes-Bug: #1743494
    Signed-off-by: Sriharsha Basavapatna <email address hidden>
    (cherry picked from commit 84688a22db22039f5566c1439c3983db23672a45)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-vif 1.9.2

This issue was fixed in the openstack/os-vif 1.9.2 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.