Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send request to set oper status state for host interfaces. #524

Closed
wants to merge 3 commits into from
Closed
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
14 changes: 14 additions & 0 deletions dataplane/saiserver/hostif.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ func (hostif *hostif) CreateHostif(ctx context.Context, req *saipb.CreateHostifR
PortId: id,
}

oper_status := pktiopb.PortOperation_PORT_OPERATION_SET_DOWN

if req.GetOperStatus() {
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.
Expand Down Expand Up @@ -157,6 +168,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),
Expand Down