[P4-dev] queue manipulation

Andy Fingerhut andy.fingerhut at gmail.com
Wed Aug 16 13:33:30 EDT 2017


A key fact about P4 right now is that different implementations of P4 can
have different capabilities from each other.  Neither the P4_14 nor P4_16
language specs contain anything I can think of that would directly enable
you to implement the things you ask about.  That doesn't stop _particular
P4 implementations_ from providing additional mechanisms to do so, but of
course that can limit the portability of P4 programs wanting to implement
such features.

The Portable Switch Architecture (PSA) spec is in draft form right now, and
I can speak to its current contents, and what I expect it might include
when it reaches version 1.0.

1. can queue depth be manipulated through P4?

There is a proposal to include as part of the PSA the ability to make
visible to your P4 egress control block the depth that a queue had at the
time a packet was enqueued at its end, here:
https://github.com/p4lang/p4-spec/issues/335   The title of that issue, and
some of the comments there, suggest making it readable from the ingress
control block before enqueuing it, but that seems to be a less favored
approach due to implementation difficulties in some ASIC implementations.

2. can the queue congestion avoidance algorithms or associated parameters
per egress queue be manipulated?

"queue congestion avoidance algorithms" covers a lot of possibilities, so
it is difficult to answer that question without knowing more about what
visibility to the system state you need for a particular algorithm.  If you
have one in mind that can be implemented without knowing about current
queue depths, i.e. it can be implemented using the Register extern to read
state, modify it in your P4 program, and write it back, e.g. elephant
traps, Bloom filters, etc. etc., then most likely yes.

3. you mentioned control plane APIs exist for configuring scheduling
policies, could you elaborate it a bit more? don't think P4 can describe
scheduling polices at this moment? or treat scheduler as an 'extern'? till
P4 can have programmable packet scheduling?

If we split hairs a bit, I didn't actually say they exist :-)  Whether a P4
implementation has multiple class of service queues, with scheduling
parameters that can be configured via a control plane API, is not part of
the PSA, and I would guess it will not be, except to specify how the
ingress P4 code could specify one of several class-of-service queues for
the selected output port (but allowing an implementation to only have 1
queue per output port).  The P4-API effort might choose to define APIs for
configuring parameters for a scheduler, but I am not sure whether that is
part of that group's plans.

Note that even if a P4 implementation contained some non-P4-programmable
scheduling algorithms, e.g. weighted fair queueing with run-time
configurable weight values for each queue, that can be tremendously
useful.  P4_16 definitely takes the approach that these are in externs.

Andy

On Wed, Aug 16, 2017 at 9:43 AM, Peng He <peng.he.2000 at gmail.com> wrote:

> Sorry to jump here.. I have similar question about queue:
>
> 1. can queue depth be manipulated through P4?
> 2. can the queue congestion avoidance algorithms or associated parameters
> per egress queue be manipulated?
> 3. you mentioned control plane APIs exist for configuring scheduling
> policies, could you elaborate it a bit more? don't think P4 can describe
> scheduling polices at this moment? or treat scheduler as an 'extern'? till
> P4 can have programmable packet scheduling?
>
> Regards,
> Peng
>
> On Wed, Aug 16, 2017 at 10:24 AM, Andy Fingerhut <andy.fingerhut at gmail.com
> > wrote:
>
>> In P4 source code, you typically do not manipulate queues.  You select
>> which queue a packet should be enqueued upon in P4 source code, e.g. by
>> assigning a value to a metadata field that selects an output port for the
>> packet, or multiple output ports via a multicast group.  In the most common
>> case those queues will be FIFO.  I guess if that is what you meant by
>> manipulating queues, then that is how it is typically done.
>>
>> Can you say a little more about what kinds of queue manipulation you are
>> interested in here?
>>
>> For example, are asking about what kind of control plane APIs exist for
>> configuring scheduling policies between multiple queues leading to the same
>> output port?
>>
>> Something else?
>>
>> And
>>
>>
>> On Tue, Aug 15, 2017 at 10:04 PM, Wallas Fróes <wallasync at gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> I have a question.
>>> Would I like to know, how I do for manipulating the queues in P4?
>>>
>>> --
>>> Att,
>>>
>>> Wallas Fróes
>>> Information Security in Computer Networks
>>> Computer Engineer
>>> Cel: (77) 8841-0762
>>>
>>> _______________________________________________
>>> P4-dev mailing list
>>> P4-dev at lists.p4.org
>>> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>>>
>>
>>
>> _______________________________________________
>> 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/20170816/4bfbdc9e/attachment-0002.html>


More information about the P4-dev mailing list