Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit bb51497

Browse files
committed
fix find bridge function
VPP changed default calue for SwIfIndex to 4294967295 As go was setting this to 0 the bridge was never found Signed-off-by: John O'Loughlin <[email protected]>
1 parent 957c06e commit bb51497

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Diff for: cnivpp/api/bridge/bridge.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424

2525
"github.com/intel/userspace-cni-network-plugin/cnivpp/bin_api/interface_types"
2626
"github.com/intel/userspace-cni-network-plugin/cnivpp/bin_api/l2"
27+
. "github.com/intel/userspace-cni-network-plugin/pkg/types"
2728
"go.fd.io/govpp/api"
2829
)
2930

@@ -174,7 +175,7 @@ func DumpBridge(ch api.Channel, bridgeDomain uint32) {
174175

175176
// Populate the Message Structure
176177
req := &l2.BridgeDomainDump{
177-
BdID: bridgeDomain,
178+
BdID: bridgeDomain, SwIfIndex: DefaultSwIfIndex,
178179
}
179180

180181
reply := &l2.BridgeDomainDetails{}
@@ -220,7 +221,7 @@ func findBridge(ch api.Channel, bridgeDomain uint32) (bool, uint32) {
220221

221222
// Populate the Message Structure
222223
req := &l2.BridgeDomainDump{
223-
BdID: bridgeDomain,
224+
BdID: bridgeDomain, SwIfIndex: DefaultSwIfIndex,
224225
}
225226
reqCtx := ch.SendMultiRequest(req)
226227

Diff for: pkg/types/types.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ import (
1919
current "github.com/containernetworking/cni/pkg/types/100"
2020
)
2121

22-
//
2322
// Exported Types
24-
//
2523
type MemifConf struct {
2624
Role string `json:"role,omitempty"` // Role of memif: master|slave
2725
Mode string `json:"mode,omitempty"` // Mode of memif: ip|ethernet|inject-punt
@@ -115,13 +113,15 @@ type NetConf struct {
115113
}
116114

117115
// Defines the JSON data written to container. It is either written to:
118-
// 1) Annotation - "userspace/configuration-data"
119-
// -- OR --
120-
// 2) a file in the directory designated by NetConf.SharedDir.
116+
// 1. Annotation - "userspace/configuration-data"
117+
// -- OR --
118+
// 2. a file in the directory designated by NetConf.SharedDir.
121119
type ConfigurationData struct {
122120
ContainerId string `json:"containerId"` // From args.ContainerId, used locally. Used in several place, namely in the socket filenames.
123121
IfName string `json:"ifName"` // From args.IfName, used locally. Used in several place, namely in the socket filenames.
124122
Name string `json:"name"` // From NetConf.Name
125123
Config UserSpaceConf `json:"config"` // From NetConf.ContainerConf
126124
IPResult current.Result `json:"ipResult"` // Network Status also has IP, but wrong format
127125
}
126+
127+
const DefaultSwIfIndex = 4294967295 // vpp default interface id, used when querying bridges

0 commit comments

Comments
 (0)