[P4-dev] Extracting queueing metadata from bmv2

Antonin Bas antonin at barefootnetworks.com
Mon Mar 19 13:55:35 EDT 2018

Hi Vikas,

If you don't limit the queue rate in simple_switch, congestion will happen
at the interface before the ingress pipeline instead of at the bmv2 queue
between ingress & egress, and you will not be able to observe any
congestion with the standard_metadata.
You can set the queue rate with the CLI command "set_queue_rate". You want
to make sure that the rate is set to something smaller than what the
ingress pipeline can support. This will depend on how you compile bmv2 /
which P4 program you are running / which machine you are running bmv2 on. I
suggest you start with a conservative number, like 100pps. If you compiled
bmv2 with O2 and you disabled the logging macros, you could use something
between 1,000pps and 10,000pps.

On Sat, Mar 17, 2018 at 1:24 PM, Vikas Kumar <mailvikasnow at gmail.com> wrote:

> Hello Everyone,
> I am trying to collect switch statistics for INT from each switch. I am
> successfully able to collect some metrics like ingress port,egress port,
> hop latency. But for some queuing metadata like enq_qdepth and deq_qdepth I
> am getting 0 value always. However these metadta are declared in v1model.p4
> (https://github.com/p4lang/p4c/blob/master/p4include/v1model.p4 ). Is it
> that bmv2 still does not expose these intrinsic queueing metadata mentioned
> here ( https://github.com/p4lang/behavioral-model/blob/master/
> docs/simple_switch.md)?
> action int_set_header_3() {
> hdr.int_q_occupancy.setValid();
>      hdr.int_q_occupancy.q_id = 0; //assuming there is only 1 queue
> hdr.int_q_occupancy.q_occupancy =
> (bit<24>) standard_metadata.deq_qdepth;
> }
> I observed that while sending burst traffic from source to destination the
> hop latency changes from switch to switch but the enq_qdepth always remains
> 0.
> --
> <http://moodi.org/>
> *Vikas Kumar | ** Hospitality & PR Coordinator*
> *Mood Indigo, IIT Bombay*
> *+91-9694532954 <+91%2096945%2032954> | mailvikasnow at gmail.com
> <mailvikasnow at gmail.com>*
> [image: Facebook] <https://www.facebook.com/vikas.cse.iitb>
>> <https://mailtrack.io/> Sent with Mailtrack
> <https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality&>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20180319/fd2c7ac2/attachment.html>

More information about the P4-dev mailing list