From f8ca43cd0dc513eb3e99ed9ff69444dd8b792770 Mon Sep 17 00:00:00 2001 From: Nikita Skrynnik <93182827+NikitaSkrynnik@users.noreply.github.com> Date: Mon, 2 Oct 2023 20:41:53 +1100 Subject: [PATCH] use new genericsync.Maps (#754) Signed-off-by: Nikita Skrynnik --- pkg/networkservice/acl/acl_indices_map.gen.go | 75 ------------------- pkg/networkservice/acl/gen.go | 26 ------- pkg/networkservice/acl/server.go | 3 +- .../mechanisms/vlan/mtu/client.go | 3 +- pkg/networkservice/mechanisms/vlan/mtu/gen.go | 26 ------- .../mechanisms/vlan/mtu/mtu_map.gen.go | 75 ------------------- pkg/networkservice/pinhole/client.go | 5 +- pkg/networkservice/pinhole/gen.go | 26 ------- pkg/networkservice/pinhole/server.go | 5 +- .../pinhole/tunnel_ip_map.gen.go | 75 ------------------- .../xconnect/l2bridgedomain/common.go | 5 +- .../xconnect/l2bridgedomain/gen.go | 26 ------- .../l2_bridge_domain_map.gen.go | 75 ------------------- .../xconnect/l2bridgedomain/server.go | 3 +- 14 files changed, 15 insertions(+), 413 deletions(-) delete mode 100644 pkg/networkservice/acl/acl_indices_map.gen.go delete mode 100644 pkg/networkservice/acl/gen.go delete mode 100644 pkg/networkservice/mechanisms/vlan/mtu/gen.go delete mode 100644 pkg/networkservice/mechanisms/vlan/mtu/mtu_map.gen.go delete mode 100644 pkg/networkservice/pinhole/gen.go delete mode 100644 pkg/networkservice/pinhole/tunnel_ip_map.gen.go delete mode 100644 pkg/networkservice/xconnect/l2bridgedomain/gen.go delete mode 100644 pkg/networkservice/xconnect/l2bridgedomain/l2_bridge_domain_map.gen.go diff --git a/pkg/networkservice/acl/acl_indices_map.gen.go b/pkg/networkservice/acl/acl_indices_map.gen.go deleted file mode 100644 index 264514ef..00000000 --- a/pkg/networkservice/acl/acl_indices_map.gen.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by "-output acl_indices_map.gen.go -type aclIndicesMap -output acl_indices_map.gen.go -type aclIndicesMap"; DO NOT EDIT. -// Install -output acl_indices_map.gen.go -type aclIndicesMap by "go get -u github.com/searKing/golang/tools/-output acl_indices_map.gen.go -type aclIndicesMap" - -package acl - -import ( - "sync" // Used by sync.Map. -) - -// Generate code that will fail if the constants change value. -func _() { - // An "cannot convert aclIndicesMap literal (type aclIndicesMap) to type sync.Map" compiler error signifies that the base type have changed. - // Re-run the go-syncmap command to generate them again. - _ = (sync.Map)(aclIndicesMap{}) -} - -var _nil_aclIndicesMap_uint32_value = func() (val []uint32) { return }() - -// Load returns the value stored in the map for a key, or nil if no -// value is present. -// The ok result indicates whether value was found in the map. -func (m *aclIndicesMap) Load(key string) ([]uint32, bool) { - value, ok := (*sync.Map)(m).Load(key) - if value == nil { - return _nil_aclIndicesMap_uint32_value, ok - } - return value.([]uint32), ok -} - -// Store sets the value for a key. -func (m *aclIndicesMap) Store(key string, value []uint32) { - (*sync.Map)(m).Store(key, value) -} - -// LoadOrStore returns the existing value for the key if present. -// Otherwise, it stores and returns the given value. -// The loaded result is true if the value was loaded, false if stored. -func (m *aclIndicesMap) LoadOrStore(key string, value []uint32) ([]uint32, bool) { - actual, loaded := (*sync.Map)(m).LoadOrStore(key, value) - if actual == nil { - return _nil_aclIndicesMap_uint32_value, loaded - } - return actual.([]uint32), loaded -} - -// LoadAndDelete deletes the value for a key, returning the previous value if any. -// The loaded result reports whether the key was present. -func (m *aclIndicesMap) LoadAndDelete(key string) (value []uint32, loaded bool) { - actual, loaded := (*sync.Map)(m).LoadAndDelete(key) - if actual == nil { - return _nil_aclIndicesMap_uint32_value, loaded - } - return actual.([]uint32), loaded -} - -// Delete deletes the value for a key. -func (m *aclIndicesMap) Delete(key string) { - (*sync.Map)(m).Delete(key) -} - -// Range calls f sequentially for each key and value present in the map. -// If f returns false, range stops the iteration. -// -// Range does not necessarily correspond to any consistent snapshot of the Map's -// contents: no key will be visited more than once, but if the value for any key -// is stored or deleted concurrently, Range may reflect any mapping for that key -// from any point during the Range call. -// -// Range may be O(N) with the number of elements in the map even if f returns -// false after a constant number of calls. -func (m *aclIndicesMap) Range(f func(key string, value []uint32) bool) { - (*sync.Map)(m).Range(func(key, value interface{}) bool { - return f(key.(string), value.([]uint32)) - }) -} diff --git a/pkg/networkservice/acl/gen.go b/pkg/networkservice/acl/gen.go deleted file mode 100644 index 6684ad23..00000000 --- a/pkg/networkservice/acl/gen.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021 Doc.ai and/or its affiliates. -// -// SPDX-License-Identifier: Apache-2.0 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package acl - -import ( - "sync" -) - -//go:generate go-syncmap -output acl_indices_map.gen.go -type aclIndicesMap - -// aclIndicesMap - sync.Map with key connection ID value of int index -type aclIndicesMap sync.Map diff --git a/pkg/networkservice/acl/server.go b/pkg/networkservice/acl/server.go index 98b4a9b4..01c45a6b 100644 --- a/pkg/networkservice/acl/server.go +++ b/pkg/networkservice/acl/server.go @@ -22,6 +22,7 @@ package acl import ( "context" + "github.com/edwarnicke/genericsync" "github.com/golang/protobuf/ptypes/empty" "github.com/networkservicemesh/govpp/binapi/acl" "github.com/networkservicemesh/govpp/binapi/acl_types" @@ -38,7 +39,7 @@ import ( type aclServer struct { vppConn api.Connection aclRules []acl_types.ACLRule - aclIndices aclIndicesMap + aclIndices genericsync.Map[string, []uint32] } // NewServer creates a NetworkServiceServer chain element to set the ACL on a vpp interface diff --git a/pkg/networkservice/mechanisms/vlan/mtu/client.go b/pkg/networkservice/mechanisms/vlan/mtu/client.go index ec3c9661..adc0e1ba 100644 --- a/pkg/networkservice/mechanisms/vlan/mtu/client.go +++ b/pkg/networkservice/mechanisms/vlan/mtu/client.go @@ -25,6 +25,7 @@ import ( "google.golang.org/grpc" "google.golang.org/protobuf/types/known/emptypb" + "github.com/edwarnicke/genericsync" "github.com/networkservicemesh/sdk/pkg/networkservice/core/next" "github.com/networkservicemesh/sdk/pkg/networkservice/utils/metadata" "github.com/networkservicemesh/sdk/pkg/tools/postpone" @@ -38,7 +39,7 @@ import ( type mtuClient struct { vppConn api.Connection - mtu mtuMap + mtu genericsync.Map[string, uint32] deviceNames map[string]string } diff --git a/pkg/networkservice/mechanisms/vlan/mtu/gen.go b/pkg/networkservice/mechanisms/vlan/mtu/gen.go deleted file mode 100644 index 3271da17..00000000 --- a/pkg/networkservice/mechanisms/vlan/mtu/gen.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2022 Nordix Foundation. -// -// SPDX-License-Identifier: Apache-2.0 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package mtu - -import ( - "sync" -) - -//go:generate go-syncmap -output mtu_map.gen.go -type mtuMap - -// mtuMap - sync.Map with key as interface name and value as MTU -type mtuMap sync.Map diff --git a/pkg/networkservice/mechanisms/vlan/mtu/mtu_map.gen.go b/pkg/networkservice/mechanisms/vlan/mtu/mtu_map.gen.go deleted file mode 100644 index 0656bc6e..00000000 --- a/pkg/networkservice/mechanisms/vlan/mtu/mtu_map.gen.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by "-output mtu_map.gen.go -type mtuMap -output mtu_map.gen.go -type mtuMap"; DO NOT EDIT. -// Install -output mtu_map.gen.go -type mtuMap by "go get -u github.com/searKing/golang/tools/-output mtu_map.gen.go -type mtuMap" - -package mtu - -import ( - "sync" // Used by sync.Map. -) - -// Generate code that will fail if the constants change value. -func _() { - // An "cannot convert mtuMap literal (type mtuMap) to type sync.Map" compiler error signifies that the base type have changed. - // Re-run the go-syncmap command to generate them again. - _ = (sync.Map)(mtuMap{}) -} - -var _nil_mtuMap_uint32_value = func() (val uint32) { return }() - -// Load returns the value stored in the map for a key, or nil if no -// value is present. -// The ok result indicates whether value was found in the map. -func (m *mtuMap) Load(key string) (uint32, bool) { - value, ok := (*sync.Map)(m).Load(key) - if value == nil { - return _nil_mtuMap_uint32_value, ok - } - return value.(uint32), ok -} - -// Store sets the value for a key. -func (m *mtuMap) Store(key string, value uint32) { - (*sync.Map)(m).Store(key, value) -} - -// LoadOrStore returns the existing value for the key if present. -// Otherwise, it stores and returns the given value. -// The loaded result is true if the value was loaded, false if stored. -func (m *mtuMap) LoadOrStore(key string, value uint32) (uint32, bool) { - actual, loaded := (*sync.Map)(m).LoadOrStore(key, value) - if actual == nil { - return _nil_mtuMap_uint32_value, loaded - } - return actual.(uint32), loaded -} - -// LoadAndDelete deletes the value for a key, returning the previous value if any. -// The loaded result reports whether the key was present. -func (m *mtuMap) LoadAndDelete(key string) (value uint32, loaded bool) { - actual, loaded := (*sync.Map)(m).LoadAndDelete(key) - if actual == nil { - return _nil_mtuMap_uint32_value, loaded - } - return actual.(uint32), loaded -} - -// Delete deletes the value for a key. -func (m *mtuMap) Delete(key string) { - (*sync.Map)(m).Delete(key) -} - -// Range calls f sequentially for each key and value present in the map. -// If f returns false, range stops the iteration. -// -// Range does not necessarily correspond to any consistent snapshot of the Map's -// contents: no key will be visited more than once, but if the value for any key -// is stored or deleted concurrently, Range may reflect any mapping for that key -// from any point during the Range call. -// -// Range may be O(N) with the number of elements in the map even if f returns -// false after a constant number of calls. -func (m *mtuMap) Range(f func(key string, value uint32) bool) { - (*sync.Map)(m).Range(func(key, value interface{}) bool { - return f(key.(string), value.(uint32)) - }) -} diff --git a/pkg/networkservice/pinhole/client.go b/pkg/networkservice/pinhole/client.go index 7d900f31..fad645d0 100644 --- a/pkg/networkservice/pinhole/client.go +++ b/pkg/networkservice/pinhole/client.go @@ -21,6 +21,7 @@ import ( "fmt" "sync" + "github.com/edwarnicke/genericsync" "github.com/golang/protobuf/ptypes/empty" "github.com/pkg/errors" "go.fd.io/govpp/api" @@ -33,8 +34,8 @@ import ( ) type pinholeClient struct { - vppConn api.Connection - ipPortMap + vppConn api.Connection + ipPortMap genericsync.Map[IPPort, struct{}] // We need to protect ACL rules applying with a mutex. // Because adding new entries is based on a dump and applying modified data. diff --git a/pkg/networkservice/pinhole/gen.go b/pkg/networkservice/pinhole/gen.go deleted file mode 100644 index 7df12fa5..00000000 --- a/pkg/networkservice/pinhole/gen.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2022 Cisco and/or its affiliates. -// -// SPDX-License-Identifier: Apache-2.0 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package pinhole - -import ( - "sync" -) - -//go:generate go-syncmap -output tunnel_ip_map.gen.go -type ipPortMap - -// IPPortMap - sync.Map with key IPPort value of struct{} -type ipPortMap sync.Map diff --git a/pkg/networkservice/pinhole/server.go b/pkg/networkservice/pinhole/server.go index dff28c37..939f389e 100644 --- a/pkg/networkservice/pinhole/server.go +++ b/pkg/networkservice/pinhole/server.go @@ -21,6 +21,7 @@ import ( "fmt" "sync" + "github.com/edwarnicke/genericsync" "github.com/golang/protobuf/ptypes/empty" "github.com/pkg/errors" "go.fd.io/govpp/api" @@ -32,8 +33,8 @@ import ( ) type pinholeServer struct { - vppConn api.Connection - ipPortMap + vppConn api.Connection + ipPortMap genericsync.Map[IPPort, struct{}] // We need to protect ACL rules applying with a mutex. // Because adding new entries is based on a dump and applying modified data. diff --git a/pkg/networkservice/pinhole/tunnel_ip_map.gen.go b/pkg/networkservice/pinhole/tunnel_ip_map.gen.go deleted file mode 100644 index 6c61b3ef..00000000 --- a/pkg/networkservice/pinhole/tunnel_ip_map.gen.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by "-output tunnel_ip_map.gen.go -type ipPortMap -output tunnel_ip_map.gen.go -type ipPortMap"; DO NOT EDIT. -// Install -output tunnel_ip_map.gen.go -type ipPortMap by "go get -u github.com/searKing/golang/tools/-output tunnel_ip_map.gen.go -type ipPortMap" - -package pinhole - -import ( - "sync" // Used by sync.Map. -) - -// Generate code that will fail if the constants change value. -func _() { - // An "cannot convert ipPortMap literal (type ipPortMap) to type sync.Map" compiler error signifies that the base type have changed. - // Re-run the go-syncmap command to generate them again. - _ = (sync.Map)(ipPortMap{}) -} - -var _nil_ipPortMap_struct___value = func() (val struct{}) { return }() - -// Load returns the value stored in the map for a key, or nil if no -// value is present. -// The ok result indicates whether value was found in the map. -func (m *ipPortMap) Load(key IPPort) (struct{}, bool) { - value, ok := (*sync.Map)(m).Load(key) - if value == nil { - return _nil_ipPortMap_struct___value, ok - } - return value.(struct{}), ok -} - -// Store sets the value for a key. -func (m *ipPortMap) Store(key IPPort, value struct{}) { - (*sync.Map)(m).Store(key, value) -} - -// LoadOrStore returns the existing value for the key if present. -// Otherwise, it stores and returns the given value. -// The loaded result is true if the value was loaded, false if stored. -func (m *ipPortMap) LoadOrStore(key IPPort, value struct{}) (struct{}, bool) { - actual, loaded := (*sync.Map)(m).LoadOrStore(key, value) - if actual == nil { - return _nil_ipPortMap_struct___value, loaded - } - return actual.(struct{}), loaded -} - -// LoadAndDelete deletes the value for a key, returning the previous value if any. -// The loaded result reports whether the key was present. -func (m *ipPortMap) LoadAndDelete(key IPPort) (value struct{}, loaded bool) { - actual, loaded := (*sync.Map)(m).LoadAndDelete(key) - if actual == nil { - return _nil_ipPortMap_struct___value, loaded - } - return actual.(struct{}), loaded -} - -// Delete deletes the value for a key. -func (m *ipPortMap) Delete(key IPPort) { - (*sync.Map)(m).Delete(key) -} - -// Range calls f sequentially for each key and value present in the map. -// If f returns false, range stops the iteration. -// -// Range does not necessarily correspond to any consistent snapshot of the Map's -// contents: no key will be visited more than once, but if the value for any key -// is stored or deleted concurrently, Range may reflect any mapping for that key -// from any point during the Range call. -// -// Range may be O(N) with the number of elements in the map even if f returns -// false after a constant number of calls. -func (m *ipPortMap) Range(f func(key IPPort, value struct{}) bool) { - (*sync.Map)(m).Range(func(key, value interface{}) bool { - return f(key.(IPPort), value.(struct{})) - }) -} diff --git a/pkg/networkservice/xconnect/l2bridgedomain/common.go b/pkg/networkservice/xconnect/l2bridgedomain/common.go index 3aba4917..307a5a9d 100644 --- a/pkg/networkservice/xconnect/l2bridgedomain/common.go +++ b/pkg/networkservice/xconnect/l2bridgedomain/common.go @@ -22,6 +22,7 @@ import ( "context" "time" + "github.com/edwarnicke/genericsync" interfaces "github.com/networkservicemesh/govpp/binapi/interface" "github.com/networkservicemesh/govpp/binapi/interface_types" "github.com/networkservicemesh/govpp/binapi/l2" @@ -46,7 +47,7 @@ type bridgeDomainKey struct { clientIfIndex interface_types.InterfaceIndex } -func addBridgeDomain(ctx context.Context, vppConn api.Connection, bridges *l2BridgeDomain, vlanID uint32) error { +func addBridgeDomain(ctx context.Context, vppConn api.Connection, bridges *genericsync.Map[bridgeDomainKey, *bridgeDomain], vlanID uint32) error { clientIfIndex, ok := ifindex.Load(ctx, true) if !ok { return nil @@ -92,7 +93,7 @@ func addBridgeDomain(ctx context.Context, vppConn api.Connection, bridges *l2Bri return nil } -func delBridgeDomain(ctx context.Context, vppConn api.Connection, bridges *l2BridgeDomain, vlanID uint32) error { +func delBridgeDomain(ctx context.Context, vppConn api.Connection, bridges *genericsync.Map[bridgeDomainKey, *bridgeDomain], vlanID uint32) error { if clientIfIndex, ok := ifindex.Load(ctx, true); ok { key := bridgeDomainKey{ vlanID: vlanID, diff --git a/pkg/networkservice/xconnect/l2bridgedomain/gen.go b/pkg/networkservice/xconnect/l2bridgedomain/gen.go deleted file mode 100644 index e1da13a7..00000000 --- a/pkg/networkservice/xconnect/l2bridgedomain/gen.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2022 Nordix Foundation. -// -// SPDX-License-Identifier: Apache-2.0 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package l2bridgedomain - -import ( - "sync" -) - -//go:generate go-syncmap -output l2_bridge_domain_map.gen.go -type l2BridgeDomain - -// l2BridgeDomain - sync.Map storing *bridgeDomain values to bridgeDomainKey(VLAN-ID, clientIfIndex) -type l2BridgeDomain sync.Map diff --git a/pkg/networkservice/xconnect/l2bridgedomain/l2_bridge_domain_map.gen.go b/pkg/networkservice/xconnect/l2bridgedomain/l2_bridge_domain_map.gen.go deleted file mode 100644 index d2b46709..00000000 --- a/pkg/networkservice/xconnect/l2bridgedomain/l2_bridge_domain_map.gen.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by "-output l2_bridge_domain_map.gen.go -type l2BridgeDomain -output l2_bridge_domain_map.gen.go -type l2BridgeDomain"; DO NOT EDIT. -// Install -output l2_bridge_domain_map.gen.go -type l2BridgeDomain by "go get -u github.com/searKing/golang/tools/-output l2_bridge_domain_map.gen.go -type l2BridgeDomain" - -package l2bridgedomain - -import ( - "sync" // Used by sync.Map. -) - -// Generate code that will fail if the constants change value. -func _() { - // An "cannot convert l2BridgeDomain literal (type l2BridgeDomain) to type sync.Map" compiler error signifies that the base type have changed. - // Re-run the go-syncmap command to generate them again. - _ = (sync.Map)(l2BridgeDomain{}) -} - -var _nil_l2BridgeDomain_bridgeDomain_value = func() (val *bridgeDomain) { return }() - -// Load returns the value stored in the map for a key, or nil if no -// value is present. -// The ok result indicates whether value was found in the map. -func (m *l2BridgeDomain) Load(key bridgeDomainKey) (*bridgeDomain, bool) { - value, ok := (*sync.Map)(m).Load(key) - if value == nil { - return _nil_l2BridgeDomain_bridgeDomain_value, ok - } - return value.(*bridgeDomain), ok -} - -// Store sets the value for a key. -func (m *l2BridgeDomain) Store(key bridgeDomainKey, value *bridgeDomain) { - (*sync.Map)(m).Store(key, value) -} - -// LoadOrStore returns the existing value for the key if present. -// Otherwise, it stores and returns the given value. -// The loaded result is true if the value was loaded, false if stored. -func (m *l2BridgeDomain) LoadOrStore(key bridgeDomainKey, value *bridgeDomain) (*bridgeDomain, bool) { - actual, loaded := (*sync.Map)(m).LoadOrStore(key, value) - if actual == nil { - return _nil_l2BridgeDomain_bridgeDomain_value, loaded - } - return actual.(*bridgeDomain), loaded -} - -// LoadAndDelete deletes the value for a key, returning the previous value if any. -// The loaded result reports whether the key was present. -func (m *l2BridgeDomain) LoadAndDelete(key bridgeDomainKey) (value *bridgeDomain, loaded bool) { - actual, loaded := (*sync.Map)(m).LoadAndDelete(key) - if actual == nil { - return _nil_l2BridgeDomain_bridgeDomain_value, loaded - } - return actual.(*bridgeDomain), loaded -} - -// Delete deletes the value for a key. -func (m *l2BridgeDomain) Delete(key bridgeDomainKey) { - (*sync.Map)(m).Delete(key) -} - -// Range calls f sequentially for each key and value present in the map. -// If f returns false, range stops the iteration. -// -// Range does not necessarily correspond to any consistent snapshot of the Map's -// contents: no key will be visited more than once, but if the value for any key -// is stored or deleted concurrently, Range may reflect any mapping for that key -// from any point during the Range call. -// -// Range may be O(N) with the number of elements in the map even if f returns -// false after a constant number of calls. -func (m *l2BridgeDomain) Range(f func(key bridgeDomainKey, value *bridgeDomain) bool) { - (*sync.Map)(m).Range(func(key, value interface{}) bool { - return f(key.(bridgeDomainKey), value.(*bridgeDomain)) - }) -} diff --git a/pkg/networkservice/xconnect/l2bridgedomain/server.go b/pkg/networkservice/xconnect/l2bridgedomain/server.go index 54e95caa..2770cc44 100644 --- a/pkg/networkservice/xconnect/l2bridgedomain/server.go +++ b/pkg/networkservice/xconnect/l2bridgedomain/server.go @@ -23,6 +23,7 @@ import ( "go.fd.io/govpp/api" + "github.com/edwarnicke/genericsync" "github.com/golang/protobuf/ptypes/empty" "github.com/pkg/errors" @@ -37,7 +38,7 @@ import ( type l2BridgeDomainServer struct { vppConn api.Connection - b l2BridgeDomain + b genericsync.Map[bridgeDomainKey, *bridgeDomain] } // NewServer returns a Client chain element that will add client and server vpp interface (if present) to a dridge domain