Skip to content

[p4, sidecar] fix underlay/external mcast counter ops - #362

Open
zeeshanlakhani wants to merge 1 commit into
zl/mcast-default-featurefrom
zl/mcast-p4-counters
Open

[p4, sidecar] fix underlay/external mcast counter ops#362
zeeshanlakhani wants to merge 1 commit into
zl/mcast-default-featurefrom
zl/mcast-p4-counters

Conversation

@zeeshanlakhani

@zeeshanlakhani zeeshanlakhani commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

A replica still carrying a Geneve header at the egress counter block is bound for an underlay port, while external replicas are decapsulated earlier, at ingress, for external-only groups or in mcast_egress for bifurcated (external + underlay members) ones. Previously, we used a conditional:

else if (hdr.geneve.isValid()) {

... on Geneve hdr validity too early in the chain to determine an external- vs underlay-destined packet, and we didn't consider using the is_egress_rid_mcast check at all.

The Fix

Now, we treat the three conditions for link-local, external mcast, and underlay mcast independently and more explicitly given the egress rid, which is 0 for link-local multicast packets and combines with Geneve hdr validity to determine the count for underlay vs external.

The underlay and external arms key on is_egress_rid_mcast and not the negation of is_link_local_ipv6_mcast: the compiler doesn't carry the negation into the later gateways of the pipeline, which meant that a link-local packet incremented external_mcast_ctr alongside its own counter. This is now handled because link-local replicas arrive with egress_rid of 0, and scope 2 is refused at group creation, so no replicated packet ever carries a link-local outer destination.

@zeeshanlakhani
zeeshanlakhani force-pushed the zl/mcast-p4-counters branch 5 times, most recently from ee83887 to 873c3d3 Compare September 3, 2026 05:25
@zeeshanlakhani zeeshanlakhani changed the title [p4, sidecar] attribute egress mcast counters by Geneve validity [p4, sidecar] fix underlay/external mcast counter ops Sep 3, 2026
A replica still carrying a Geneve header at the egress counter block is bound
for an underlay port, while external replicas are decapsulated earlier, at
ingress, for external-only groups or in `mcast_egress` for bifurcated
(external + underlay members) ones. Previously, we used a conditional:

```p4
else if (hdr.geneve.isValid()) {
```

... on Geneve hdr validity too early in the chain to determine an
external- vs underlay-destined packet, and we didn't consider using the
`is_egress_rid_mcast` check at all.

## The Fix

Now, we treat the three conditions for link-local, external mcast, and
underlay mcast independently and more explicitly given the egress rid,
which is 0 for link-local multicast packets and combines with Geneve hdr
validity to determine the count for underlay vs external.

The underlay and external arms key on `is_egress_rid_mcast` and not the
negation of `is_link_local_ipv6_mcast`: the compiler doesn't carry the
negation into the later gateways of the pipeline, which meant that a
link-local packet incremented `external_mcast_ctr` alongside its own
counter. This is now handled because link-local replicas arrive with
`egress_rid` of 0, and scope 2 is refused at group creation, so no
replicated packet ever carries a link-local outer destination.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant