p4lang / behavioral-model

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

Does bmv2 have the same concept of stages as Tofino? #1158

Closed KekeZheng closed 1 year ago

KekeZheng commented 1 year ago

Hello, I am a little confused about the relationship between the p4 program and the use of stage. Can we use the p4 program to control the use of the stage? I saw that some of the previous questions said that bmv2 is different from Tofino. There is no concept of stage on bmv2? Because it seems that only one stage can be accessed at a time on the RMT architecture. I thought it was the same on bmv2 before, but when i saw#1034, i realized i might be mistaken. In that case, I would like to ask about the deployment of Count-Min Sketch in bmv2. Each row of sketch is placed in the pipeline separately or in the same stage? Should a sketch be split into multiple stages for deployment?

Thank you in advance for taking the time to answer the question.

jafingerhut commented 1 year ago

bmv2 runs on a general purpose CPU. You can write P4 programs with thousands of tables if you want, and bmv2 will execute them, even though such a P4 program would never fit within the hardware limitations of Tofino.

bmv2 does have some artificially imposed limitations in the P4 programs you can write, e.g. you cannot apply() the same table twice in the same control (except in very special restricted situations, but often no). But except for those few artificially imposed limitations, the sky is the limit for the P4 programs that can run on bmv2.

KekeZheng commented 1 year ago

Thank you very much for your answer, I understand it.

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