k8snetworkplumbingwg / ib-sriov-cni

InfiniBand SR-IOV CNI
Other
42 stars 27 forks source link

pkg/sriov: Restore VF name after rebinding #52

Closed DmytroLinkin closed 4 years ago

DmytroLinkin commented 4 years ago

Due to kernel driver constraints, on cmdDel the plugin is required to rebind the VF in order to restore the VF's GUID value. During VF rebind the kernel may assign the VF netdev a new name from predefined scheme, which can differs from its initial name that the plugin caches. This may cause conflicts with other VFs that are currently cached and processed by plugin. For example: Two pods were created:

If pod B is deleted first, then after GUID value is restored (driver rebind occurs) it will get the netdev name ib0. This causes the plugin to fail on Pod A pod deletion, when, on CmdDel, it tries to move

netdev to the host netns, since its cached (original) name `ib0' already exist. We fix that by restoring initial name from the cached config after VF rebinding. Fix: #51
coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 137


Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/sriov/sriov.go 14 24 58.33%
<!-- Total: 14 24 58.33% -->
Totals Coverage Status
Change from base Build 161: 0.5%
Covered Lines: 241
Relevant Lines: 543

💛 - Coveralls