p4lang / behavioral-model

The reference P4 software switch
Apache License 2.0
545 stars 329 forks source link

Multi pipeline simulation using BMV2 #1118

Closed drobinkent closed 1 year ago

drobinkent commented 2 years ago

Typically programmable switches contain multiple pipelines to achieve higher throughput. For example, a Tofino switch may contain 4-6 pipelines where each pipeline can achieve 1 Tbps throughput. All of these pipelines run independently. Is it possible to run multiple such pipelines in a switch using BMv2?

jafingerhut commented 2 years ago

I believe that currently there is no support in simple_switch or simple_switch_grpc to emulate multiple parallel pipes that, like Tofino, have independent table storage and counter/meter/register state from each other. It could be implemented, of course, but would require some changes to the C++ code of BMv2, and if you wanted each pipeline to be a separate copy of the counter/meter/register and P4 table state, you would also need changes to the control plane API to make it appear that way to the control plane software.

antoninbas commented 2 years ago

Just to add on to @jafingerhut's answer. There is some support for multiple pipelines in the bmv2 "core" library code: https://github.com/p4lang/behavioral-model/blob/f16d0de3486aa7fb2e1fe554aac7d237cc1adc33/include/bm/bm_sim/switch.h#L100. A pipeline is referred to as a "context". However, there is no existing bmv2 target in p4lang that leverages this support.

rst0git commented 2 years ago

The MTPSA BMv2 target is using the "context" functionality to enable support for multiple user pipelines.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment, or this will be closed in 180 days