[P4-dev] Questions for 'egress port TX Link utilization' (INT metadata) in BMv2

Antonin Bas antonin at barefootnetworks.com
Wed Apr 5 19:11:21 EDT 2017


Hi Dongeun,

It is unlikely that a specific architecture / target would expose "egress
port tx utilization" as metadata. I imagine that it would be the
responsibility of the P4 program to compute this value using a P4 byte
counter (per-port) and some port speed information provided by the control
plane (e.g. as table data).
So if you want to populate that INT field, you need to compute it in your
P4 program. There is no division in P4 so it may be a little tricky to
do (although
I am sure you can find some existing methods for approximating it), which
is why I imagine it is not in switch.p4 today.

Of course you can always modify simple_switch.cpp if you want, but IMO this
is not representative of what P4-programmable hardware would do. You would
need to maintain some per-port state in simple_switch (port speed, which
you would need to obtain somehow, and counter), compute the utilization
value, write it to a specific intrinsic metadata field defined by you and
copy it to the packet in the egress pipeline (this last step would be done
in P4).

On Tue, Apr 4, 2017 at 5:20 AM, Dongeun Suh <dongeunsuh at gmail.com> wrote:

> Hello everyone,
>
> I'm trying to write an INT application that monitors 'egress port tx
> utilization' (defined as baseline metadata in INT spec) based on switch.p4
> + bmv2 (simple_switch.cpp).
>
> However, I found that bmv2 does not support 'egress port tx utilization'
> as metadata.
>
> Is there any way to obtain this information from the bmv2 without
> modifying 'simple_switch.cpp'?
> If it is required to modify 'simple_siwtch.cpp', any advises to do this
> would be very helpful.
>
> Thanks in advance.
> Dongeun Suh.
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>



-- 
Antonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20170405/1e501a68/attachment-0002.html>


More information about the P4-dev mailing list