diff --git a/.github/buildomat/jobs/multicast-test.sh b/.github/buildomat/jobs/multicast-test.sh deleted file mode 100755 index a6e1669f..00000000 --- a/.github/buildomat/jobs/multicast-test.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -#: -#: name = "multicast-test" -#: variety = "basic" -#: target = "ubuntu-22.04" -#: rust_toolchain = true -#: -#: output_rules = [ -#: "/work/simulator.log", -#: "/work/dpd.log", -#: ] -#: - -#### >>>>>>>>>>>>>>>>>>>>>>>>>>>> Local Usage >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -#### -#### The following environment variables are useful. -#### -#### - JUST_TEST=1 Just runs the tests, skipping system prep. -#### - TESTNAME='$name' Will just run the specified test. -#### - STARTUP_TIMEOUT=n Seconds to wait for tofino-model/dpd to start. -#### Defaults to 15. -#### - NOBUILD=1 Don't build sidecar.p4 (in case you've already -#### built it) -#### -#### <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - -export RUST_BACKTRACE=1 - -set -o errexit -set -o pipefail -set -o xtrace - -export MULTICAST=1 -source .github/buildomat/packet-test-common.sh diff --git a/.github/buildomat/packet-test-common.sh b/.github/buildomat/packet-test-common.sh index 44855110..e72d1fb0 100755 --- a/.github/buildomat/packet-test-common.sh +++ b/.github/buildomat/packet-test-common.sh @@ -10,15 +10,7 @@ STARTUP_TIMEOUT=${STARTUP_TIMEOUT:=120} DENDRITE_TEST_HOST=${DENDRITE_TEST_HOST:="[::1]"} DENDRITE_TEST_VERBOSITY=${DENDRITE_TEST_VERBOSITY:=3} -if [ "$MULTICAST" == "" ]; then - BUILD_FEATURES=tofino_asic - CODEGEN_FEATURES=() - SWADM_FEATURES=() -else - BUILD_FEATURES=tofino_asic,multicast - CODEGEN_FEATURES=(--multicast) - SWADM_FEATURES=(--features=multicast) -fi +BUILD_FEATURES=tofino_asic function cleanup { set +o errexit @@ -64,7 +56,7 @@ export SDE=/opt/oxide/tofino_sde banner "Build" if [[ $NOBUILD -ne 1 ]]; then cargo build --features=$BUILD_FEATURES --bin dpd --bin swadm - cargo xtask codegen --stages "$TOFINO_STAGES" "${CODEGEN_FEATURES[@]}" + cargo xtask codegen --stages "$TOFINO_STAGES" fi banner "Test" @@ -125,12 +117,10 @@ pushd swadm cargo test \ --no-fail-fast \ - "${SWADM_FEATURES[@]}" \ -- \ --ignored cargo test \ - --no-fail-fast \ - "${SWADM_FEATURES[@]}" + --no-fail-fast popd diff --git a/aal/Cargo.toml b/aal/Cargo.toml index 81ecdb6f..4452a133 100644 --- a/aal/Cargo.toml +++ b/aal/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = "2024" [features] +default = ["multicast"] multicast = [] [dependencies] diff --git a/asic/Cargo.toml b/asic/Cargo.toml index 96d42164..14a517b0 100644 --- a/asic/Cargo.toml +++ b/asic/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = "2024" [features] +default = ["multicast"] tofino_asic = [ "dep:lazy_static", "dep:transceiver-controller", diff --git a/dpd-client/Cargo.toml b/dpd-client/Cargo.toml index 7998da4d..e2b26661 100644 --- a/dpd-client/Cargo.toml +++ b/dpd-client/Cargo.toml @@ -5,6 +5,7 @@ edition = "2024" description = "Client library for the Dendrite data plane daemon" [features] +default = ["multicast"] multicast = ["asic/multicast"] chaos = ["asic/chaos"] tofino_asic = ["asic/tofino_asic"] diff --git a/dpd/Cargo.toml b/dpd/Cargo.toml index 05726534..968fa6f7 100644 --- a/dpd/Cargo.toml +++ b/dpd/Cargo.toml @@ -5,6 +5,7 @@ authors = ["nils "] edition = "2024" [features] +default = ["multicast"] multicast = ["aal/multicast", "asic/multicast"] tofino_asic = ["asic/tofino_asic"] tofino_stub = ["asic/tofino_stub"] diff --git a/dpd/src/mcast/mod.rs b/dpd/src/mcast/mod.rs index 5a685415..3ac32330 100644 --- a/dpd/src/mcast/mod.rs +++ b/dpd/src/mcast/mod.rs @@ -2393,15 +2393,16 @@ mod tests { None ); - // Vec with only Exact sources stays as-is + // Vec with only Exact sources is deduplicated and sorted let exact_sources = vec![ IpSrc::Exact(IpAddr::V4(Ipv4Addr::new(192, 168, 1, 1))), IpSrc::Exact(IpAddr::V4(Ipv4Addr::new(10, 0, 0, 1))), ]; - assert_eq!( - canonicalize_sources(Some(exact_sources.clone())), - Some(exact_sources) - ); + let expected = vec![ + IpSrc::Exact(IpAddr::V4(Ipv4Addr::new(10, 0, 0, 1))), + IpSrc::Exact(IpAddr::V4(Ipv4Addr::new(192, 168, 1, 1))), + ]; + assert_eq!(canonicalize_sources(Some(exact_sources)), Some(expected)); // Single Exact source stays as-is let single_exact = vec![IpSrc::Exact(IpAddr::V6(Ipv6Addr::new( diff --git a/swadm/Cargo.toml b/swadm/Cargo.toml index 57ceccdf..eabb9018 100644 --- a/swadm/Cargo.toml +++ b/swadm/Cargo.toml @@ -6,6 +6,7 @@ authors = ["nils "] edition = "2024" [features] +default = ["multicast"] multicast = [] [dependencies] diff --git a/xtask/src/main.rs b/xtask/src/main.rs index f7cdda5c..bccddecb 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -80,9 +80,9 @@ enum XtaskCommands { #[clap(long)] stages: Option, - /// Include support for multicast + /// exclude multicast support from the P4 build #[clap(long)] - multicast: bool, + no_multicast: bool, }, /// build an installable dataplane controller package Dist { @@ -251,8 +251,8 @@ async fn main() { if let Err(e) = match task.subcommand { XtaskCommands::Openapi(external) => external .exec_bin("dendrite-dropshot-apis", "dendrite-dropshot-apis"), - XtaskCommands::Codegen { name, sde, stages, multicast } => { - codegen::build(name, sde, stages, multicast) + XtaskCommands::Codegen { name, sde, stages, no_multicast } => { + codegen::build(name, sde, stages, !no_multicast) } XtaskCommands::Dist { features, names, release, format } => { plat::dist(features, names, release, format).await