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

gh-787 better egress hook support for in-cluster mode #790

Merged
merged 4 commits into from
Sep 5, 2024
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
9 changes: 0 additions & 9 deletions .github/workflows/advanced-lb-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/basic-sanity-ubuntu-22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@ jobs:
- run: |
sudo ip netns add test
sudo ip netns del test
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/basic-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev elfutils dwarves git linux-tools-$(uname -r) libbsd-dev bridge-utils unzip build-essential bison flex iproute2
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/cluster-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/ipsec-sanity-ubuntu-22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-13 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/ipsec-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/liveness-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/nat66-sanity-ubuntu-22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-13 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/nat66-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/scale-sanity-ubuntu-22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-13 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat lksctp-tools
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/scale-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/sctp-sanity-ubuntu-22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-13 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool lksctp-tools
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/sctp-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/sctpmh-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool curl lksctp-tools
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tcp-sanity-ubuntu-22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-13 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tcp-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/udp-sanity-ubuntu-22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-13 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/udp-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ jobs:
go-version: '>=1.18.0'
- run: sudo apt-get update
- run: sudo apt-get -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool
- run: |
git clone --recurse-submodules https://github.com/loxilb-io/iproute2 iproute2-main
cd iproute2-main/libbpf/src/
sudo make install
mkdir build
DESTDIR=build OBJDIR=build make install
cd -
cd iproute2-main/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd`/libbpf/src/ && LIBBPF_FORCE=on LIBBPF_DIR=`pwd`/libbpf/src/build ./configure && make && sudo cp -f tc/tc /usr/local/sbin/ntc && cd -
- run: loxilb-ebpf/utils/mkllb_bpffs.sh
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
Expand Down
7 changes: 6 additions & 1 deletion pkg/loxinet/dpebpf_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,12 @@ func DpRouteMod(w *RouteDpWorkQ) int {
}
}
} else {
dat.ca.act_type = C.DP_SET_TOCP
mLen, _ := w.Dst.Mask.Size()
if mLen == 32 || mLen == 128 {
dat.ca.act_type = C.DP_SET_TOCP
} else {
dat.ca.act_type = C.DP_SET_NOP
}
}

if w.RtMark > 0 {
Expand Down
Loading