From 5152732898e8e9469890193f4ebce4f322967615 Mon Sep 17 00:00:00 2001 From: Adrian Chiris Date: Tue, 29 Jun 2021 18:52:09 +0300 Subject: [PATCH] Change default controller ID to 1 Kernel 5.10 or newer added support for encoding controler ID in the physical port name of the representor in cases where external controller exists (Smart-NICs). This controller ID is by default 1 and not 0. Signed-off-by: Adrian Chiris --- sriovnet_switchdev.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sriovnet_switchdev.go b/sriovnet_switchdev.go index f919590..39db709 100644 --- a/sriovnet_switchdev.go +++ b/sriovnet_switchdev.go @@ -202,11 +202,11 @@ func GetVfRepresentorSmartNIC(pfID, vfIndex string) (string, error) { // Note: no supoport for Multi-Chassis Smart-NICs expectedPhysPortNames := map[string]interface{}{ fmt.Sprintf("pf%svf%s", pfID, vfIndex): nil, - fmt.Sprintf("c0pf%svf%s", pfID, vfIndex): nil, + fmt.Sprintf("c1pf%svf%s", pfID, vfIndex): nil, } netdev, err := findNetdevWithPortNameCriteria(func(portName string) bool { - // if phys port name == pfvf or c0pfvf we have a match + // if phys port name == pfvf or c1pfvf we have a match if _, ok := expectedPhysPortNames[portName]; ok { return true }