Skip to content

Proposal for setting packets and bytes counter widths separately #119

@qobilidop

Description

@qobilidop

Currently in PNA, a counter extern is defined as the following:

enum PNA_CounterType_t {
    PACKETS,
    BYTES,
    PACKETS_AND_BYTES
}

extern Counter<W, S> {
  Counter(bit<32> n_counters, PNA_CounterType_t type);
  void count(in S index, @optional in bit<32> increment);
}

When type == PNA_CounterType_t.PACKETS_AND_BYTES, the counter is used to count both packets and bytes. The way it works (as I understand) is that some bits of the counter works as the packets counter, while the rest of the bits work as the bytes counter. The issue here is that we can only specify the total width of the combined counter through W, but not the 2 counters separately.

Would it be a good idea to enable setting packets and bytes counter widths separately?

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