Skip to content

Conversation

@Nieuwejaar
Copy link
Collaborator

Adds table counters to the 2 mac rewrite tables.
Adds new counters to the Service control, so each path is counted - including "take no action".
Adds a counter for unicast packets in the Egress pipeline
dpd was returning the pipe.Egress.mcast_ctr counter for all multicast counter requests from swadm. Added new CounterId variants to catch them all.

@Nieuwejaar Nieuwejaar linked an issue Aug 7, 2025 that may be closed by this pull request
mcast_ctr.count(eg_intr_md.egress_port);

if (is_ipv6_mcast) {
if (!is_ipv6_mcast) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At line 2122 we have:

is_ipv6_mcast = (ipv6_prefix != 16w0xff02);

ff02 is for link-local multicast, so is_ipv6_mcast means any non-linklocal multicast, right? So we want to bump the link-local counter for !is_ipv6_mcast? Or am I getting turned around by all the nots?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic or possibly the variable naming seems kind of confused here, before this change. 0xff is the multi-cast prefix, and 0x02 means "link-local scope". So is_ipv6_mcast is true for anything that is not exactly a link-local multicast address. It is true for multicast addresses of other scopes, or for addresses that aren't multicast at all like link-local addresses or globally-unique addresses.

What are we trying to catch here? Only link-local multicast addresses? If that's true, then I'd probably invert the prefix check on L2122 and rename the variable to is_ipv6_ll_mcast or something like that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nieuwejaar yeah. My bad. I think this got lost in the review changes. This should be renamed to is_link_local_mcastv6 and be

is_link_local_ipv6_mcast = (ipv6_prefix == 16w0xff02);

egress_rid will capture replicated mcast packets. So, I think it's renamed for the counter, and we don't need the !.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic or possibly the variable naming seems kind of confused here, before this change. 0xff is the multi-cast prefix, and 0x02 means "link-local scope". So is_ipv6_mcast is true for anything that is not exactly a link-local multicast address. It is true for multicast addresses of other scopes, or for addresses that aren't multicast at all like link-local addresses or globally-unique addresses.

What are we trying to catch here? Only link-local multicast addresses? If that's true, then I'd probably invert the prefix check on L2122 and rename the variable to is_ipv6_ll_mcast or something like that.

Yeah. What I said in my comment (before I expanded yours @bnaecker) haha.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the suggested change to is_link_local_ipv6_mcast

@zeeshanlakhani
Copy link
Contributor

Good catch on the CounterIDs @Nieuwejaar. I forgot that's what the stats client relies on.

zeeshanlakhani added a commit that referenced this pull request Aug 7, 2025
Closes:
    * #86

Includes:
    * Update packet-test.sh to list expected counters with `swadm`

Notes:
    * Currently PR'ed against
    #88 counter(s) updates
zeeshanlakhani added a commit that referenced this pull request Aug 7, 2025
Closes:
  * #86

Includes:
  * Update packet-test.sh to list expected counters with `swadm`

Notes:
  * Currently PR'ed against
    #88 counter(s) updates
@Nieuwejaar Nieuwejaar merged commit ab1dc8b into main Aug 7, 2025
6 checks passed
@Nieuwejaar Nieuwejaar deleted the counters branch August 7, 2025 15:48
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.

all tables should have counters added

4 participants