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

Set of fixes and features for SAI #217

Merged
merged 8 commits into from
Jul 26, 2023
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
3 changes: 2 additions & 1 deletion cloudbuild/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ make load-operator
kubectl set image -n lemming-operator deployment/lemming-controller-manager manager=us-west1-docker.pkg.dev/openconfig-lemming/release/operator:ga
make load
make itest
cd cloudbuild && ./fp-test.sh
# Reenable these tests once not flaky.
# cd cloudbuild && ./fp-test.sh

exit "${rc}"
2 changes: 1 addition & 1 deletion dataplane/forwarding/fwdport/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func Input(port Port, packet fwdpacket.Packet, dir fwdpb.PortAction, ctx *fwdcon
Increment(port, packet.Length(), fwdpb.CounterId_COUNTER_ID_RX_PACKETS, fwdpb.CounterId_COUNTER_ID_RX_OCTETS)
SetInputPort(packet, port)

packet.Log().V(1).Info("input packet", "port", port.ID(), "frame", fwdpacket.IncludeFrameInLog)
packet.Log().V(3).Info("input packet", "port", port.ID(), "frame", fwdpacket.IncludeFrameInLog)
state, err := fwdaction.ProcessPacket(packet, port.Actions(dir), port)
if err != nil {
Increment(port, packet.Length(), fwdpb.CounterId_COUNTER_ID_RX_ERROR_PACKETS, fwdpb.CounterId_COUNTER_ID_RX_ERROR_OCTETS)
Expand Down
5 changes: 5 additions & 0 deletions dataplane/forwarding/fwdport/ports/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func (p *kernelPort) process() {
continue
}
fwdPkt.Debug(debug.ExternalPortPacketTrace)
fwdPkt.Log().V(2).Info("input packet", "device", p.devName, "port", p.ID(), "frame", fwdpacket.IncludeFrameInLog)
fwdport.Process(p, fwdPkt, fwdpb.PortAction_PORT_ACTION_INPUT, p.ctx, "Kernel")
}
}
Expand Down Expand Up @@ -189,6 +190,10 @@ func (kernelBuilder) Build(portDesc *fwdpb.PortDesc, ctx *fwdcontext.Context) (f
if err := p.InitCounters("", list...); err != nil {
return nil, err
}
if err := p.ifaceMgr.LinkSubscribe(p.linkUpdateCh, p.linkDoneCh); err != nil {
return nil, err
}

p.process()
return p, nil
}
1 change: 1 addition & 0 deletions dataplane/forwarding/fwdport/ports/tap.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func (p *tapPort) process() {
continue
}
fwdPkt.Debug(debug.TAPPortPacketTrace)
fwdPkt.Log().V(2).Info("input packet", "device", p.devName, "port", p.ID(), "frame", fwdpacket.IncludeFrameInLog)
fwdport.Process(p, fwdPkt, fwdpb.PortAction_PORT_ACTION_INPUT, p.ctx, "TAP")
}
}()
Expand Down
10 changes: 7 additions & 3 deletions dataplane/handlers/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,9 @@ func (ni *Interface) handleNeighborUpdate(ctx context.Context, nu *netlink.Neigh
switch nu.Type {
case unix.RTM_DELNEIGH:
req := &dpb.RemoveNeighborRequest{
PortId: ni.internalToExternalPort[ni.idxToName[nu.LinkIndex]],
Dev: &dpb.RemoveNeighborRequest_PortId{
PortId: ni.internalToExternalPort[ni.idxToName[nu.LinkIndex]],
},
Ip: &dpb.RemoveNeighborRequest_IpBytes{
IpBytes: ipToBytes(nu.IP),
},
Expand All @@ -504,8 +506,10 @@ func (ni *Interface) handleNeighborUpdate(ctx context.Context, nu *netlink.Neigh
return
}
req := &dpb.AddNeighborRequest{
PortId: ni.internalToExternalPort[ni.idxToName[nu.LinkIndex]],
Mac: nu.HardwareAddr,
Dev: &dpb.AddNeighborRequest_PortId{
PortId: ni.internalToExternalPort[ni.idxToName[nu.LinkIndex]],
},
Mac: nu.HardwareAddr,
Ip: &dpb.AddNeighborRequest_IpBytes{
IpBytes: ipToBytes(nu.IP),
},
Expand Down
3 changes: 3 additions & 0 deletions dataplane/internal/engine/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ go_library(
"//proto/dataplane",
"//proto/forwarding",
"@com_github_golang_glog//:glog",
"@com_github_vishvananda_netlink//:netlink",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
],
)
Loading