From afb2eca1079081146b2a4555e010ddc721c3706f Mon Sep 17 00:00:00 2001 From: Roy Date: Wed, 8 Jan 2025 18:52:00 +0000 Subject: [PATCH 1/2] Send request to set oper status state for host interfaces. --- dataplane/saiserver/hostif.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dataplane/saiserver/hostif.go b/dataplane/saiserver/hostif.go index f6e5789c..27c37dba 100644 --- a/dataplane/saiserver/hostif.go +++ b/dataplane/saiserver/hostif.go @@ -91,6 +91,16 @@ func (hostif *hostif) CreateHostif(ctx context.Context, req *saipb.CreateHostifR PortId: id, } + oper_status := pktiopb.PortOperation_PORT_OPERATION_SET_DOWN + if req.oper_status { + oper_status = pktiopb.PortOperation_PORT_OPERATION_SET_UP + } + + operReq := &pktiopb.HostPortControlMessage{ + PortId: id, + Op: oper_status, + } + switch req.GetType() { case saipb.HostifType_HOSTIF_TYPE_GENETLINK: name := string(req.GetName()) // The name can be genl_packet_q0, but the netlink family is gen_packet. @@ -157,6 +167,9 @@ func (hostif *hostif) CreateHostif(ctx context.Context, req *saipb.CreateHostifR if err := hostif.remotePortReq(ctlReq); err != nil { return nil, err } + if err := hostif.remotePortReq(operReq); err != nil { + return nil, err + } attr := &saipb.HostifAttribute{ OperStatus: proto.Bool(true), From 9d0dccd028ba6389f52b60f63eb3adb92a041de9 Mon Sep 17 00:00:00 2001 From: Roy Date: Wed, 8 Jan 2025 18:52:00 +0000 Subject: [PATCH 2/2] Send request to set oper status state for host interfaces. --- dataplane/saiserver/hostif.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dataplane/saiserver/hostif.go b/dataplane/saiserver/hostif.go index 27c37dba..7f949792 100644 --- a/dataplane/saiserver/hostif.go +++ b/dataplane/saiserver/hostif.go @@ -92,7 +92,8 @@ func (hostif *hostif) CreateHostif(ctx context.Context, req *saipb.CreateHostifR } oper_status := pktiopb.PortOperation_PORT_OPERATION_SET_DOWN - if req.oper_status { + + if req.GetOperStatus() { oper_status = pktiopb.PortOperation_PORT_OPERATION_SET_UP }