[P4-dev] graph search in P4

Andy Fingerhut andy.fingerhut at gmail.com
Tue Oct 17 17:38:33 EDT 2017


To quantify Mihai's "every iteration will be very expensive" just a bit:

Call a packet that does ingress+egress processing, then leaves, "1 pass".

If it does ingress+egress, then recirculates and does ingress+egress once
more, then leaves, "2 pass".  Generalize that to an "N pass" packet.

There are hardware implementations of P4 that, among other finite limits,
have a maximum packet rate they support.  To give a generic example that
doesn't necessarily match any particular implementation, but lets you
figure out how to calculate it yourself, if an ASIC implementation was
limited to at most 1 billion (10^9) packets per second for 1-pass packets,
and it had 8 100 Gigabit Ethernet ports, then it can handle line-rate
traffic on all 8 of those ports only if the average packet size is (8 ports
* (100 * 10^9 bits/sec) / port) / ((8 bits/byte) * (10^9 packets/sec)) =
100 bytes, or more.  If the average packet size is smaller than that, it is
possible to send such an ASIC more than 10^9 packets/sec, and it will have
to start dropping traffic without processing it at all.  That is usually a
situation you want to avoid.

If you wrote a P4 program that made every packet take an average of 2
passes, then the maximum packet rate is cut in 1/2.  If every packet takes
an average of N passes, the maximum packet rate is divided by N.  That
either multiplies the average packet size you can handle at line rate by N,
or it means you have to leave a fraction of those 16 ports not connected to
anything so the input packet rate goes down.

Andy

On Tue, Oct 17, 2017 at 9:41 AM, Mihai Budiu <mbudiu at vmware.com> wrote:

> Yes can use recirculate to create a loop, but every iteration will be very
> expensive.
>
> Mihai
>
> -----Original Message-----
> From: Roshan [mailto:sedar at oasis.uclouvain.be]
> Sent: Tuesday, October 17, 2017 9:32 AM
> To: Mihai Budiu <mbudiu at vmware.com>; p4-dev <p4-dev at lists.p4.org>
> Subject: Re: [P4-dev] graph search in P4
>
> I see that. Could recirculate primitive behave/use for looping mechanism?
>
>
> Thanks!
>
>
> Cheers,
>
> R-
>
>
> On 2017-10-17 18:02, Mihai Budiu wrote:
> > P4 does not really support data structures or loops, so you cannot
> really do anything useful with graphs in P4.
> >
> > Mihai
> >
> > -----Original Message-----
> > From: P4-dev [mailto:p4-dev-bounces at lists.p4.org] On Behalf Of Roshan
> > Sent: Tuesday, October 17, 2017 8:54 AM
> > To: p4-dev <p4-dev at lists.p4.org>
> > Subject: [P4-dev] graph search in P4
> >
> > Hi,
> >
> >
> > Is there any reference or example material for an implementation of
> graph search/traversal in P4 to have a look at?
> >
> > Is this type of implementation is doable in P4?
> >
> >
> > Any advices would be great!
> >
> >
> > Thanks!
> >
> >
> > Cheers,
> >
> > R-
> >
> >
> > _______________________________________________
> > P4-dev mailing list
> > P4-dev at lists.p4.org
> > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.
> p4.org_mailman_listinfo_p4-2Ddev-5Flists.p4.org&d=DwICAg&
> c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54
> GGvw-b21n7aWg&m=OnrkGWQxzKA_7Gi4GzAXqDNHlJ0XuhifOTDhGrQPND4&s=
> 7Zd7D805wh5blEOPAX5mLwquUzcvy1WVwrPccrpqBGM&e=
> >
> > _______________________________________________
> > P4-dev mailing list
> > P4-dev at lists.p4.org
> > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.
> p4.org_mailman_listinfo_p4-2Ddev-5Flists.p4.org&d=DwICaQ&
> c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54
> GGvw-b21n7aWg&m=2FHzx-q10Mq-utErUIq4z9qLNvMLglNQD6taUDjtAKM&s=
> 6rbMVcGsxrDqyRhEwhkyuWxer1-hweQu6D1czcIsl7o&e=
>
> _______________________________________________
> 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/20171017/29fd9d8b/attachment-0002.html>


More information about the P4-dev mailing list