[P4-dev] Binding a table to an interface

Antonin Bas antonin at barefootnetworks.com
Tue Jan 16 14:05:47 EST 2018


Hi,

I can think of several possible ways of doing something like this:
1. use if statements in the ingress control and dispatch to the appropriate
control based on the ingress interface. You can also use a table (possibly
with static const entries if you are using P4_16). If you are writing your
own compiler backend, you could possibly optimize this "dispatcher" out and
allocate each sub-control to its own router ingress.
2. you could write a different P4 program for each ingress
3. if you are using P4_16, you could define your own P4 architecture
definition (https://p4.org/p4-spec/docs/P4-16-v1.0.0-spec.html#sec-arch)
which would expose each ingress in your router as a separate entity and let
you provide a different control instance for each.

I would say solution 3. is the best one (after all this is why we have the
notion of architecture in P4_16), but it is hard to say without more
details.

Thanks,

Antonin

On Mon, Jan 15, 2018 at 10:32 PM, Ganesh C S <ch.sa.ganesh at gmail.com> wrote:

> Having a global table with interface identifier looks to be a hack.
>
> Some routers have separate ingress that can be populated with locally
> relevant logic. I am looking for p4 equivalent of this.
>
> regs
> Ganesh
>
> On Sun, Jan 14, 2018 at 5:21 AM, Hardik Soni <hardik.soni at inria.fr> wrote:
>
>> put InControl.inputPort as a match field for the tables.
>>
>> -Hardik
>>
>> ------------------------------
>>
>> *From: *"Ganesh C S" <ch.sa.ganesh at gmail.com>
>> *To: *p4-dev at lists.p4.org
>> *Sent: *Sunday, 14 January, 2018 12:16:06 PM
>> *Subject: *[P4-dev] Binding a table to an interface
>>
>>
>> Hi,
>>
>> I am new to P4 and am trying to bind specific match-action tables to
>> interfaces. In my case, a packet received on ingress interface A, it should
>> look at table A. Similarly, ingress interface B should look at table B and
>> so on.
>>
>> Any way of binding the tables to the interfaces ?
>>
>> regs
>> Ganesh
>>
>> _______________________________________________
>> 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
>



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


More information about the P4-dev mailing list