Skip to content

Commit 4414b60

Browse files
[mcast] merge main + handle stage changes associated + cleanup
The sidecar pipeline lands at 16 ingress stages without multicast and 19 with multicast, all without sacrificing unicast LPM capacity in either build. Includes: * Merges origin/main, picking up the RFD 619 dpd-api refactor (#259). * v6 unicast TTL=1 handling via per-prefix skip_ttl bit + inline check (saves a stage vs the v4-style compound TTL key). Service-port routes skip the TTL exception so userspace still receives the packet. This helped after the table-sizing changes on main (and making MCAST align). * Multicast tables are now sized per-workload (separate constants per table) rather than via a single global ceiling. * Lots of misc cleanup.
2 parents 808e4dd + 85d6fc9 commit 4414b60

123 files changed

Lines changed: 4868 additions & 3740 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/buildomat/common.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/bash
22

3-
# The tofino2 has 20 stages. The base sidecar.p4 needs 15 stages, and with
4-
# multicast enabled it needs 18. Specifying the number of stages isn't
3+
# The tofino2 has 20 stages. The base sidecar.p4 builds at 16 stages, and,
4+
# with multicast enabled, at 19. Specifying the number of stages isn't
55
# strictly necessary, but it allows us to track when we exceed the current
66
# ceiling. The underlying intention is to grow deliberately and thoughtfully,
77
# given the limited space on the ASIC.
8-
TOFINO_STAGES=15
8+
#
9+
# Note: p4c does multiple placement rounds. table_summary.log reports each
10+
# round. The first (unconstrained) is informational, and the final (at the
11+
# bottom of the log) is what the binary actually uses. If
12+
# --num-stages-override cannot be satisfied, the assembler errors out and
13+
# no binary is produced.
14+
TOFINO_STAGES=16
915

1016
# These describe which version of the SDE to download and where to find it
1117
SDE_COMMIT=2a6b33211c9675996dcb99fe939045506667ae94

.github/buildomat/packet-test-common.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ if [ x$MULTICAST == x ]; then
1919
fi
2020

2121
if [ x$MULTICAST == x ]; then
22-
TOFINO_STAGES=15
22+
TOFINO_STAGES=16
2323
else
24-
TOFINO_STAGES=18
24+
TOFINO_STAGES=19
2525
fi
2626

2727
function cleanup {

Cargo.lock

Lines changed: 15 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ members = [
99
"dpd-api",
1010
"dpd-client",
1111
"dpd-types",
12+
"dpd-types/versions",
1213
"dropshot-apis",
1314
"packet",
1415
"pcap",
@@ -35,6 +36,7 @@ asic = { path = "asic" }
3536
dpd-api = { path = "dpd-api" }
3637
dpd-client = { path = "dpd-client" }
3738
dpd-types = { path = "dpd-types" }
39+
dpd-types-versions = { path = "dpd-types/versions" }
3840
common = { path = "common" }
3941
packet = { path = "packet" }
4042
pcap = { path = "pcap" }

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ To build the p4 program:
3232
$ cargo xtask codegen [ -n <p4 program name> ] [--sde <sde directory> ]
3333
```
3434

35+
*Note*: The final stage count for the binary is reported in
36+
`target/proto/opt/oxide/dendrite/sidecar/pipe/logs/table_summary.log`.
37+
If the requested stage allotment cannot be met, the assembler errors
38+
out and no binary is produced.
39+
3540
The Tofino model is not yet available for `illumos`/`helios`. To run the
3641
compiled p4 program on the Tofino model on a Linux system:
3742

asic/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ doctest = false
2323
[dependencies]
2424
aal.workspace = true
2525
common.workspace = true
26-
dpd-api.workspace = true
26+
dpd-types.workspace = true
2727

2828
propolis = { workspace = true, optional = true , features = ["falcon"] }
2929
tofino = { workspace = true, optional = true }

asic/src/tofino_asic/serdes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::tofino_asic::genpd::*;
1616
use crate::tofino_asic::ports;
1717
use crate::tofino_asic::{CheckError, Handle};
1818
use aal::{AsicError, AsicResult, PortHdl};
19-
use dpd_api::{
19+
use dpd_types::serdes::{
2020
AnLtStatus, AnStatus, DfeAdaptationState, EncSpeed, LaneEncoding, LaneMap,
2121
LaneStatus, LpPages, LtStatus, RxSigInfo, SerdesEye,
2222
};

asic/src/tofino_common/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use std::collections::HashMap;
88
use std::ffi::OsStr;
9+
use std::fs;
910
use std::path::PathBuf;
1011

1112
use serde::Deserialize;
@@ -348,6 +349,10 @@ fn infer_p4_dir() -> AsicResult<String> {
348349
let mut exe_path = std::env::current_exe().map_err(|e| {
349350
AsicError::P4Missing(format!("looking up dpd path: {e:?}"))
350351
})?;
352+
// Canonicalize the path in case we're using a symlinked exe.
353+
exe_path = fs::canonicalize(exe_path).map_err(|e| {
354+
AsicError::P4Missing(format!("canonicalizing dpd path: {e:?}"))
355+
})?;
351356

352357
// Pop off the trailing "dpd":
353358
exe_path = expect_name(exe_path, "dpd")?;

dpd-api/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ edition = "2024"
66
[dependencies]
77
common.workspace = true
88
dpd-types.workspace = true
9+
dpd-types-versions.workspace = true
910
dropshot.workspace = true
1011
dropshot-api-manager-types.workspace = true
11-
oxnet.workspace = true
12-
schemars.workspace = true
13-
serde.workspace = true
1412
transceiver-controller.workspace = true
15-
uuid.workspace = true

0 commit comments

Comments
 (0)