[P4-dev] Binding a table to an interface

Vladimir Gurevich vladimir.gurevich at barefootnetworks.com
Tue Jan 16 21:17:48 EST 2018


Hello Ganesh,

I do not think that the proposed solutions are "a hack". You need to
consider how exactly this "separate ingress logic per port" is implemented
in these routers. Obviously, if the data plane is done in the software then
anything is possible, but if you closely examine a modern high-speed
dataplane, you will find out that the algorithm is more-or-less the same as
was proposed by Hardik. Instead, it is the control plane (e.g. your NOS
command line) that creates *an illusion* of these separate tables.

There are certainly other methods to achieve that in pure P4 (in this case
P4_14, but P4_16 can be used too) and, again, the control plane will create
an allusion of this binding.
For example:

action do_table_1() {}
action do_table_2() {}
. . .
action do_table_n() {}

table my_mux {
    reads {
        standard_metadata.ingress_port : exact;
    }
    actions {
        do_table_1; do_table_2; . . . do_table_N;
    }
}

control table_mux {
    apply(my_mux) {
        do_table_1 { apply(table_1); }
        do_table_2 { apply(table_2); }
        . . .
        do_table_N { apply(table_N); }
    }
}

This particular method still requires 1 stage and provides flexible binding
that can be changed at run-time.

Happy Hacking
Vladimir


*Vladimir Gurevich*

*Barefoot Networks*
*Technical Lead, Customer Engineering*
Email: vag at barefootnetworks.com
Phone: (408) 833-4505


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20180116/04ea9295/attachment-0002.html>


More information about the P4-dev mailing list