stratum / fabric-tna

The SD-Fabric data plane
https://docs.sd-fabric.org/
30 stars 15 forks source link

SPGW byte counters include compiler-generated bridged metadata #116

Closed abhilashendurthi closed 3 years ago

abhilashendurthi commented 4 years ago

The ingress byte counters vary by 4 bytes and egress counters vary by 50 bytes for FabricSpgwUplinkTest, FabricSpgwDownlinkTest. We need to check how counters work for tofino and understand if the behavior is expected.

ccascone commented 3 years ago

@Yi-Tseng has been digging deep into this to find out that the egress pipe byte counters include the size of bridged metadata. Unfortunately, since we use @flexible the actual size is determined at compile-time, as the compiler can decide to insert padding. Today we hardcode these values in the PTF tests, so every time we change the bridged metadata or use a new compiler version, we can expect tests to fail because the size of metadata changes.

I'm not sure what is the issue with the ingress pipe...

However, we should consider replacing TNA counters for the SPGW tables with registers and register actions to count just the bytes that matter wrt accounting capabilities, i.e. exclude bridged metadata and any other header which is not user-generated. This would also remove the dependency in the PTF tests on the size of bridged metadata.