-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* built on Linux * ne files * renaming * split socket funcs * refactor from win * build from linux * more on linux * rename and generate * use libbpf * oops * rebase and add new member * unify CxPlatTryAddSocket * pass datapath tests * integrate Ubuntu 22.04 default libbpf v0.5.0 * temporally * multithread. all test passed * secnetperf works * update build scripts * nit update * add duonic installer script for linux * add xdp-tools directory * cleanup * fix Windows build * fix windows xdp build * add Github action * nit fix * fix dependencies for Install-DuoNic * add udpate * add linux xdp dependencies to docker file * fix installation script * initialize submodules/xdp-tools recursively * temporal fix * make XDP optional * use ShutdownSqe * fix yaml files * remove gcc-multilib and include explicitly * fix tcp socket to allocate raw * install xdp deps for linux * libxdp bug workaround * oops * fix idempotency and add one more dep * TODO: remove this * enable x86_64 and Ubuntu22.04 * fix type mismatch of uint16_t and UINT16 * add aarch64 * fix * use flag * change arch check and file copy * fix static build and android * update clog * clog fix * fix Clang link issue * fix CodeCheck and prepare-machine for build * disable ANDROID for xdp * fix clog * Support XDP from 'test.ps1 -UseXdp' * link libxdp from artifact * fix dependency * fix dep * update xdp-tools to v1.4.2 * fix runtime deps * fix deps * Fix Umem addressing and make Rx path async to efficiently fill FQ * fix CodeQL analyze deps * fix Analyze * fix analyze * linux xdp to use sudo * change 'if' order * path fix? * sudo pwsh * add retry for xsk_socket__create when returns -EBUSY * cleanup xdp program before running * Fix cargo build --all * fix cargo test dynamic linking * remove Sanitize for initial commit * generate artifact * fix yml syntax issue * fix CodeQl Analysys * forget to add Partition declaration * Use Rundown to wait for deleting socket before binding next * fix Rundown for all xdp socket * Fix EBUSY issue when binding xdp socket * explictly disable port sharing test * refactoring and cleanup * fix pipeline. else for normal linux socket * Fix cargo linking issue? * disable xdp for cargo build * fix codeql * rollback build.rs * fix package runtime link and codeql * wrap packet dump function to DEBUG macro * check dependency * another check * leave only LD_LIBRARY_PATH * iterate attach mode * fix codeql * add IP address check in XDP prog * break is enough & avoid compiler bug * fix CodeCheck * Fix use of RxHeadroom * fix umem leak when failed to initialize * use pool alloc for Interface * fix ipv4 check * remove workaround * cleanup. from snake case to pascal case * fix clog * try ubuntu20.04 and enable stress test * few fix of stress test yml * integrate package libxdp linking * fix RX parse error case * disable ubuntu20.04 * remove 2 env variable to run * add document * fix ForBuild && clog * stop installing deps on Ubuntu 20.04 * fix build * fix libc6-dev-i386 side effect * Add one more dependency (libzstd) for static build * new line fix * always install libc6-dev-i386 * fix install order * fix CMakeLists.txt to cover qns.Dockerfile case * remove env var dep, update doc * fix stress.yml * add env var for xdp knob and fix stress * fix stress * update clog * update doc * Fix doc appearance and words * add UseXdp * Update docs/BUILD.md Co-authored-by: Nick Banks <[email protected]> * Update docs/BUILD.md Co-authored-by: Nick Banks <[email protected]> * use SKB mode for now * move Linux XDP logging to TSG.md * stop warning print from libxdp/libbpf * move CxPlat definitions to each plat * initial commit * common xdp utilities * move sudo inside scripts * fix comments * fix clog * fix ifdef syntax * fix annotations * all arch to build dataptah_xplat.c * fix mac build * fix lisence of ebpf prog * fix spin.ps1 to propagate parameter * Ether and IPv6 was not set appropriately * Update docs/TSG.md * remove warning supression * remove BuildLibXdpFromSource --------- Co-authored-by: ami-GS <azureuser@node1.s4l0gsbs5l2efgb53yvjusshdg.xx.internal.cloudapp.net> Co-authored-by: Nick Banks <[email protected]>
- Loading branch information
1 parent
131cace
commit 5052f34
Showing
63 changed files
with
6,677 additions
and
2,670 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#!/bin/bash | ||
|
||
# Set the number of NIC pairs | ||
NumNicPairs=1 | ||
|
||
if [ "$1" == "install" ]; then | ||
# Configure each pair separately with its own hard-coded subnet, ie 192.168.x.0/24 and fc00::x/112 | ||
for ((i=1; i<=NumNicPairs; i++)); do | ||
echo "Plumbing IP config for pair $i" | ||
|
||
# Generate the "ID" of the NICs, eg 1 and 2 for the first pair | ||
nic1="duo$((i * 2 - 1))" | ||
nic2="duo$((i * 2))" | ||
|
||
# Create veth pair | ||
sudo ip link add ${nic1} type veth peer name ${nic2} | ||
|
||
# Set the veth interfaces up | ||
sudo ip link set ${nic1} up | ||
sudo ip link set ${nic2} up | ||
|
||
# Assign IPv4 addresses | ||
sudo ip addr add 192.168.${i}.11/24 dev ${nic1} | ||
sudo ip addr add 192.168.${i}.12/24 dev ${nic2} | ||
|
||
# Assign IPv6 addresses | ||
sudo ip -6 addr add fc00::${i}:11/112 dev ${nic1} | ||
sudo ip -6 addr add fc00::${i}:12/112 dev ${nic2} | ||
|
||
# Add static neighbor entries (ARP) | ||
sudo ip neigh add 192.168.${i}.12 lladdr 22:22:22:22:00:0$((i * 2)) dev ${nic1} nud permanent | ||
sudo ip neigh add 192.168.${i}.11 lladdr 22:22:22:22:00:0$((i * 2 - 1)) dev ${nic2} nud permanent | ||
|
||
# Add static neighbor entries (IPv6) | ||
sudo ip -6 neigh add fc00::${i}:12 lladdr 22:22:22:22:00:0$((i * 2)) dev ${nic1} nud permanent | ||
sudo ip -6 neigh add fc00::${i}:11 lladdr 22:22:22:22:00:0$((i * 2 - 1)) dev ${nic2} nud permanent | ||
|
||
# Configure routing rules for IPv4 | ||
sudo ip route add 192.168.${i}.12/32 dev ${nic1} metric 0 | ||
sudo ip route add 192.168.${i}.11/32 dev ${nic2} metric 0 | ||
|
||
|
||
|
||
# Configure routing rules for IPv6 | ||
sudo ip -6 route add fc00::${i}:12/128 dev ${nic1} metric 0 | ||
sudo ip -6 route add fc00::${i}:11/128 dev ${nic2} metric 0 | ||
|
||
# Configure firewall rules for IPv4 | ||
sudo iptables -A INPUT -p all -s 192.168.${i}.0/24 -i ${nic1} -j ACCEPT | ||
sudo iptables -A INPUT -p all -s 192.168.${i}.0/24 -i ${nic2} -j ACCEPT | ||
|
||
# Configure firewall rules for IPv6 | ||
sudo ip6tables -A INPUT -p all -s fc00::${i}:0/112 -i ${nic1} -j ACCEPT | ||
sudo ip6tables -A INPUT -p all -s fc00::${i}:0/112 -i ${nic2} -j ACCEPT | ||
|
||
sleep 2 | ||
sudo ip route change 192.168.${i}.12 dev duo1 src 192.168.${i}.11 | ||
sudo ip route change 192.168.${i}.11 dev duo2 src 192.168.${i}.12 | ||
|
||
sudo ip -6 route change fc00::${i}:12 dev duo1 src fc00::${i}:11 | ||
sudo ip -6 route change fc00::${i}:11 dev duo2 src fc00::${i}:12 | ||
done | ||
elif [ "$1" == "uninstall" ]; then | ||
# Cleanup each pair separately | ||
for ((i=1; i<=NumNicPairs; i++)); do | ||
echo "Cleaning up pair $i" | ||
|
||
# Generate the "ID" of the NICs, eg 1 and 2 for the first pair | ||
nic1="duo$((i * 2 - 1))" | ||
nic2="duo$((i * 2))" | ||
|
||
# Delete firewall rules for IPv4 | ||
sudo iptables -D INPUT -p all -s 192.168.${i}.0/24 -i ${nic1} -j ACCEPT | ||
sudo iptables -D INPUT -p all -s 192.168.${i}.0/24 -i ${nic2} -j ACCEPT | ||
|
||
# Delete firewall rules for IPv6 | ||
sudo ip6tables -D INPUT -p all -s fc00::${i}:0/112 -i ${nic1} -j ACCEPT | ||
sudo ip6tables -D INPUT -p all -s fc00::${i}:0/112 -i ${nic2} -j ACCEPT | ||
|
||
# Remove routing rules for IPv4 | ||
sudo ip route del 192.168.${i}.12/32 dev ${nic1} | ||
sudo ip route del 192.168.${i}.11/32 dev ${nic2} | ||
|
||
# Remove routing rules for IPv6 | ||
sudo ip -6 route del fc00::${i}:12/128 dev ${nic1} | ||
sudo ip -6 route del fc00::${i}:11/128 dev ${nic2} | ||
|
||
# Remove static neighbor entries (ARP) | ||
sudo ip neigh del 192.168.${i}.12 lladdr 22:22:22:22:00:0$((i * 2)) dev ${nic1} | ||
sudo ip neigh del 192.168.${i}.11 lladdr 22:22:22:22:00:0$((i * 2 - 1)) dev ${nic2} | ||
|
||
# Remove static neighbor entries (IPv6) | ||
sudo ip -6 neigh del fc00::${i}:12 lladdr 22:22:22:22:00:0$((i * 2)) dev ${nic1} | ||
sudo ip -6 neigh del fc00::${i}:11 lladdr 22:22:22:22:00:0$((i * 2 - 1)) dev ${nic2} | ||
|
||
# Remove the veth pair | ||
sudo ip link delete ${nic1} | ||
done | ||
else | ||
echo "Usage: $0 {install|uninsatll}" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.