Skip to content

L3 router drops never increment relevant counters #404

Open

Description

@FelixMcFelix

dendrite/dpd/p4/sidecar.p4

Lines 1273 to 1283 in 4448f2e

if (!fwd.is_hit) {
icmp_error(ICMP_DEST_UNREACH, ICMP_DST_UNREACH_NET);
// Dont set meta.dropped because we want an error packet
// to go out.
meta.drop_reason = DROP_IPV4_UNROUTEABLE;
} else if (hdr.ipv4.ttl == 1 && !IS_SERVICE(fwd.port)) {
icmp_error(ICMP_TIME_EXCEEDED, ICMP_EXC_TTL);
// Dont set meta.dropped because we want an error packet
// to go out.
meta.drop_reason = DROP_IPV4_TTL_EXCEEDED;
} else {

Router4/Router6 (and their multicast cousins) set a drop reason on lookup or TTL failure, but need to delegate packet handling to the switch zone via the CPU port. So they cannot set meta.dropped -- we need to transform the packet and keep it moving. However, all of our drop counters in the ingress pipeline only touch drop statistics if we're actually dropping the packet, rather than transforming it:

dendrite/dpd/p4/sidecar.p4

Lines 2189 to 2193 in 4448f2e

if (meta.dropped) {
// Handle dropped packets
ig_dprsr_md.drop_ctl = 1;
drop_port_ctr.count(ig_intr_md.ingress_port);
drop_reason_ctr.count(meta.drop_reason);

We need to perform the counter operations on meta.drop_reason != 0, as egress does. We could also possibly replace meta.dropped with direct use of ig_dprsr_md.drop_ctl if needed.

Activity

  1. zeeshanlakhani commented on Oct 14, 2026

    @zeeshanlakhani
    Contributor

    #400 handles this on the mcast side.

  2. added 2 commits that reference this issue on Oct 16, 2026
    21e3553
    c406851
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions