p4lang / project-ideas

Ideas for P4 Projects.
Apache License 2.0
2 stars 0 forks source link

Support bitwidths larger than 64 bit on the DPDK target and p4c-dpdk-pna compiler. #13

Open fruffy opened 4 days ago

fruffy commented 4 days ago

https://github.com/p4lang/p4c/issues/4174

jafingerhut commented 4 days ago

I will double-check and report back here later, but I believe that perhaps p4c-dpdk can compile the DASH P4 program (with appropriate small changes to use the PNA architecture instead of the v1model architecture, which I believe there are #ifdef's for), and has been able to do so for several months now.

Another potential blocking issue: if you try to use open source IPDK with its P4Runtime API server, it does not correctly implement adding table entries with actions where parameters are 128 bits in size (and perhaps the maximum size supported without errors is 64 bits today). https://github.com/sonic-net/DASH/issues/408#issuecomment-1963097123

An alternative would be to try using a "native" control plane API for the DPDK software switch for installing such table entries. I do not know where to find documentation or examples of such things to try them out. If someone can point to a documentation or example for that, it would be helpful.

fruffy commented 3 days ago

I will double-check and report back here later, but I believe that perhaps p4c-dpdk can compile the DASH P4 program (with appropriate small changes to use the PNA architecture instead of the v1model architecture, which I believe there are #ifdef's for), and has been able to do so for several months now.

If you try you will see these errors:

dash-pipeline-pna-dpdk.p4(640): [--Werror=target-error] error: Unsupported bitwidth 128 in (bit<128>)hdr.u0_ipv4.dst_addr & ~meta._overlay_data_dip_mask57
...ipv6.dst_addr = (IPv6Address)hdr.u0_ipv4.dst_addr & ~meta.overlay_data.dip_mask | meta.overlay...
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dash-pipeline-pna-dpdk.p4(640): [--Werror=target-error] error: Unsupported bitwidth 128 in meta._overlay_data_dip55 & meta._overlay_data_dip_mask57
...ipv4.dst_addr & ~meta.overlay_data.dip_mask | meta.overlay_data.dip & meta.overlay_data.dip_mask;
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dash-pipeline-pna-dpdk.p4(1219): [--Werror=target-error] error: Unsupported bitwidth 128 in meta._overlay_data_sip_mask56
        routing_action_apply.apply(hdr, meta);
...