Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
421 changes: 307 additions & 114 deletions dataplane/proto/sai/fdb.pb.go

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions dataplane/proto/sai/fdb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,23 @@ service Fdb {
rpc GetFdbEntryAttribute (GetFdbEntryAttributeRequest) returns (GetFdbEntryAttributeResponse) {}
rpc CreateFdbEntries (CreateFdbEntriesRequest) returns (CreateFdbEntriesResponse) {}
rpc RemoveFdbEntries (RemoveFdbEntriesRequest) returns (RemoveFdbEntriesResponse) {}
rpc CreateFdbFlush (CreateFdbFlushRequest) returns (CreateFdbFlushResponse) {}
}

enum FdbFlushAttr {
FDB_FLUSH_ATTR_UNSPECIFIED = 0;
FDB_FLUSH_ATTR_BRIDGE_PORT_ID = 1;
FDB_FLUSH_ATTR_BV_ID = 2;
FDB_FLUSH_ATTR_ENTRY_TYPE = 3;
}

message CreateFdbFlushRequest {
option (sai_type) = OBJECT_TYPE_FDB_FLUSH;
optional uint64 bridge_port_id = 1 [(attr_enum_value) = 1];
optional uint64 bv_id = 2 [(attr_enum_value) = 2];
optional int32 entry_type = 3 [(attr_enum_value) = 3];
}

message CreateFdbFlushResponse {
uint64 oid = 1;
}
38 changes: 38 additions & 0 deletions dataplane/proto/sai/fdb_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dataplane/saiserver/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go_library(
name = "saiserver",
srcs = [
"acl.go",
"fdb.go",
"hostif.go",
"isolation_group.go",
"l2.go",
Expand Down
43 changes: 43 additions & 0 deletions dataplane/saiserver/fdb.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright 2024 Google LLC
//
// 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 saiserver

import (
"context"

"google.golang.org/grpc"

saipb "github.com/openconfig/lemming/dataplane/proto/sai"
"github.com/openconfig/lemming/dataplane/saiserver/attrmgr"
)

type fdb struct {
saipb.UnimplementedFdbServer
mgr *attrmgr.AttrMgr
dataplane switchDataplaneAPI
}

func newFdb(mgr *attrmgr.AttrMgr, dataplane switchDataplaneAPI, s *grpc.Server) (*fdb, error) {
f := &fdb{
mgr: mgr,
dataplane: dataplane,
}
saipb.RegisterFdbServer(s, f)
return f, nil
}

func (f *fdb) CreateFdbFlush(ctx context.Context, req *saipb.CreateFdbFlushRequest) (*saipb.CreateFdbFlushResponse, error) {
return &saipb.CreateFdbFlushResponse{}, nil
}
12 changes: 6 additions & 6 deletions dataplane/saiserver/saiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ type dtel struct {
saipb.UnimplementedDtelServer
}

type fdb struct {
saipb.UnimplementedFdbServer
}

type ipmcGroup struct {
saipb.UnimplementedIpmcGroupServer
}
Expand Down Expand Up @@ -202,14 +198,19 @@ func New(ctx context.Context, mgr *attrmgr.AttrMgr, s *grpc.Server, opts *dplane
return nil, err
}

fdb, err := newFdb(mgr, fwdCtx, s)
if err != nil {
return nil, err
}

srv := &Server{
mgr: mgr,
forwardingContext: fwdCtx,
bfd: &bfd{},
counter: &counter{},
debugCounter: &debugCounter{},
dtel: &dtel{},
fdb: &fdb{},
fdb: fdb,
ipmcGroup: &ipmcGroup{},
ipmc: &ipmc{},
ipsec: &ipsec{},
Expand All @@ -232,7 +233,6 @@ func New(ctx context.Context, mgr *attrmgr.AttrMgr, s *grpc.Server, opts *dplane
saipb.RegisterCounterServer(s, srv.counter)
saipb.RegisterDebugCounterServer(s, srv.debugCounter)
saipb.RegisterDtelServer(s, srv.dtel)
saipb.RegisterFdbServer(s, srv.fdb)
saipb.RegisterIpmcGroupServer(s, srv.ipmcGroup)
saipb.RegisterIpmcServer(s, srv.ipmc)
saipb.RegisterIpsecServer(s, srv.ipsec)
Expand Down
Loading