From 3d9257dc2d4929724ba8d0da4e5fcf5e469a7050 Mon Sep 17 00:00:00 2001 From: Daniel Grau Date: Tue, 1 Oct 2024 22:51:58 +0000 Subject: [PATCH] build fix --- .github/workflows/buildtest.yml | 2 +- .github/workflows/golangci-lint.yml | 2 +- cloudbuild/buildtest.yaml | 4 ++-- cloudbuild/lemming-test.sh | 2 +- cloudbuild/operator-test.sh | 2 +- cloudbuild/presubmit.sh | 2 +- dataplane/saiserver/ports.go | 10 ++++------ 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index c6947cde..f7f7c548 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -36,7 +36,7 @@ jobs: ${{ runner.os }}-bazel- - name: Install pcap run: | - sudo apt-get install libpcap-dev + sudo apt-get install libpcap-dev libnl-genl-3-dev libnl-3-dev - name: Build Lemming run: bazel build //... - name: Save Bazel Cache diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index e5f24c6f..140a5a9b 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v3 - name: Install pcap run: | - sudo apt-get install libpcap-dev + sudo apt-get install libpcap-dev libnl-genl-3-dev libnl-3-dev - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: diff --git a/cloudbuild/buildtest.yaml b/cloudbuild/buildtest.yaml index 28802101..bea38783 100644 --- a/cloudbuild/buildtest.yaml +++ b/cloudbuild/buildtest.yaml @@ -4,12 +4,12 @@ steps: script: | curl -Lo bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64 && \ install bazel /usr/local/bin/ - apt-get update && apt-get -y install libpcap-dev + apt-get update && apt-get -y install libpcap-dev libnl-genl-3-dev libnl-3-dev bazel build --remote_cache=https://storage.googleapis.com/lemming-bazel-cache --google_default_credentials //... - id: test name: gcr.io/cloud-builders/bazel script: | - apt-get update && apt-get -y install libpcap-dev + apt-get update && apt-get -y install libpcap-dev libnl-genl-3-dev libnl-3-dev bazel test --test_output=errors --combined_report=lcov --remote_cache=https://storage.googleapis.com/lemming-bazel-cache --google_default_credentials \ $(bazel query 'attr(size, small, tests("//...")) + attr(size, medium, tests("//..."))') timeout: 3600s diff --git a/cloudbuild/lemming-test.sh b/cloudbuild/lemming-test.sh index 162b49f6..411b545e 100755 --- a/cloudbuild/lemming-test.sh +++ b/cloudbuild/lemming-test.sh @@ -26,7 +26,7 @@ gopath=$(go env GOPATH) export PATH=${PATH}:$gopath/bin curl -Lo bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64 && \ sudo install bazel /usr/local/bin/ -sudo apt-get -y install libpcap-dev +sudo apt-get -y install libpcap-dev libnl-genl-3-dev libnl-3-dev cd /tmp/workspace kne deploy ~/kne-internal/deploy/kne/kind-bridge.yaml diff --git a/cloudbuild/operator-test.sh b/cloudbuild/operator-test.sh index a485c433..71d14af7 100755 --- a/cloudbuild/operator-test.sh +++ b/cloudbuild/operator-test.sh @@ -27,7 +27,7 @@ curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffo sudo install skaffold /usr/local/bin/ curl -Lo bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64 && \ sudo install bazel /usr/local/bin/ -sudo apt-get -y install libpcap-dev +sudo apt-get -y install libpcap-dev libnl-genl-3-dev libnl-3-dev cd /tmp/workspace kne deploy ~/kne-internal/deploy/kne/kind-bridge.yaml diff --git a/cloudbuild/presubmit.sh b/cloudbuild/presubmit.sh index adeea4ac..cfb41e1a 100755 --- a/cloudbuild/presubmit.sh +++ b/cloudbuild/presubmit.sh @@ -35,7 +35,7 @@ curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffo sudo install skaffold /usr/local/bin/ curl -Lo bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64 && \ sudo install bazel /usr/local/bin/ -sudo apt-get -y install libpcap-dev +sudo apt-get -y install libpcap-dev libnl-genl-3-dev libnl-3-dev cd /tmp/workspace kne deploy ~/kne-internal/deploy/kne/kind-bridge.yaml diff --git a/dataplane/saiserver/ports.go b/dataplane/saiserver/ports.go index 0f1c44cc..66c18cea 100644 --- a/dataplane/saiserver/ports.go +++ b/dataplane/saiserver/ports.go @@ -61,7 +61,6 @@ var getInterface = net.InterfaceByName func getPreIngressPipeline() []*fwdpb.ActionDesc { return []*fwdpb.ActionDesc{ fwdconfig.Action(fwdconfig.LookupAction(tunTermTable)).Build(), // Decap the packet if we have a tunnel. - fwdconfig.Action(fwdconfig.LookupAction(VlanTable)).Build(), // Tag VLAN. fwdconfig.Action(fwdconfig.LookupAction(inputIfaceTable)).Build(), // Match packet to interface. fwdconfig.Action(fwdconfig.LookupAction(IngressVRFTable)).Build(), // Match interface to VRF. fwdconfig.Action(fwdconfig.LookupAction(PreIngressActionTable)).Build(), // Run pre-ingress actions. @@ -73,9 +72,9 @@ func getL3Pipeline() []*fwdpb.ActionDesc { return []*fwdpb.ActionDesc{ fwdconfig.Action(fwdconfig.LookupAction(IngressActionTable)).Build(), // Run ingress action. fwdconfig.Action(fwdconfig.DecapAction(fwdpb.PacketHeaderId_PACKET_HEADER_ID_ETHERNET)).Build(), // Decap L2 header. - fwdconfig.Action(fwdconfig.LookupAction(FIBSelectorTable)).Build(), // Lookup in FIB. // Do not forward packets with invalid fields. + fwdconfig.Action(fwdconfig.LookupAction(FIBSelectorTable)).Build(), // Lookup in FIB. fwdconfig.Action(fwdconfig.UpdateAction(fwdpb.UpdateType_UPDATE_TYPE_DEC, fwdpb.PacketFieldNum_PACKET_FIELD_NUM_IP_HOP).WithValue([]byte{0x1})).Build(), // Decrement TTL. - fwdconfig.Action(fwdconfig.EncapAction(fwdpb.PacketHeaderId_PACKET_HEADER_ID_ETHERNET)).Build(), // Encap L2 header. // Drop invalid packets the FIB. + fwdconfig.Action(fwdconfig.EncapAction(fwdpb.PacketHeaderId_PACKET_HEADER_ID_ETHERNET)).Build(), // Encap L2 header. fwdconfig.Action(fwdconfig.LookupAction(outputIfaceTable)).Build(), // Match interface to port fwdconfig.Action(fwdconfig.LookupAction(NeighborTable)).Build(), // Lookup in the neighbor table. } @@ -90,9 +89,8 @@ func getL2Pipeline() []*fwdpb.ActionDesc { func getEgressPipeline() []*fwdpb.ActionDesc { return []*fwdpb.ActionDesc{ - fwdconfig.Action(fwdconfig.LookupAction(EgressActionTable)).Build(), // Run egress actions - fwdconfig.Action(fwdconfig.LookupAction(SRCMACTable)).Build(), // Lookup interface's MAC addr. - fwdconfig.Action(fwdconfig.DecapAction(fwdpb.PacketHeaderId_PACKET_HEADER_ID_ETHERNET_VLAN)).Build(), // TODO: Revise the code if trunk mode needs to be supported. + fwdconfig.Action(fwdconfig.LookupAction(EgressActionTable)).Build(), // Run egress actions + fwdconfig.Action(fwdconfig.LookupAction(SRCMACTable)).Build(), // Lookup interface's MAC addr. { ActionType: fwdpb.ActionType_ACTION_TYPE_OUTPUT, },