About multi-pipe and multi-program support

Hi,

In my understanding, multi-pipe and multi-program support use the “pipe_scope” field in configuration file to determine the allocated pipeline.

And the only difference between multi-pipe and multi-program is that multi-pipe happens in exact one compilation process while multi-program has multiple compilations for different programs, right?

I have some questions:

(1) Is the 9-bit port number used in Tofino p4 programming related to the pipeline used by each program? In my understanding, the first 2 bits specify the pipeline number, so the program allocated to pipeline 0 can not access the port number of pipeline 1, right?

(2) As the Tofino supports multiple program or pipe, can we evict program from one pipe and load another on-the-fly? Or we have to relaunch all from the beginning?

Thanks in advance.

Best,

Tao

Hi,

I’m currently exploring multi-pipe and multiprogram TOFINO feature.
And I would like the test these features on WEDGE-BF100-32X hardware.

while the binding for profile_a and profile_b between Pipeline() ans Switch() is clear in multi-pipe tna_32q_2pipe example:

Pipeline(SwitchIngressParser_a(),<br>SwitchIngress_a(),<br>SwitchIngressDeparser_a(),<br>SwitchEgressParser_a(),<br>SwitchEgress_a(),<br>SwitchEgressDeparser_a()) pipeline_profile_a;<br><br>Pipeline(SwitchIngressParser_b(),<br>SwitchIngress_b(),<br>SwitchIngressDeparser_b(),<br>SwitchEgressParser_b(),<br>SwitchEgress_b(),<br>SwitchEgressDeparser_b()) pipeline_profile_b;<br><br>Switch(pipeline_profile_a, pipeline_profile_b) main;

Therefore, in the wedge-bf100-32x I can run:

run_switch -p tna_32q_2pipe (after having compiled tna_32q_2pipe.p4)

However, it is unclear as per my perspective how this binding is done in multi-program example as I dont’t have tna_32q_multiprogram.p4 that stitch these 2 programs together to the same TOFINO device/NPU.

As per multi-program property program_a and program_b can be compiled separately (or it can be TWO instances of the SAME program

in the example file i see a file: custom_conf_file → mentioning [multiprogram_custom_bfrt.conf] this file correspond include p4 description file meant to be run by “run_tofino_model -c <path to multiprogram_custom_bfrt.conf>”

My questions are:
- do I have to write a tna_32q_multiprogram.p4 binding pragram_a and program_b ? But this would involve a 3rd compilation of tna_32q_multiprogram.p4
- Is there a way to generate: [multiprogram_custom_bfrt.conf]  and have run_switch using “run_switchd -p <program_a> -c <my-multiprogram_custom_bfrt.conf” / “run_switchd -p <program_b> -c <my-multiprogram_custom_bfrt.conf>”  ? In case of real hardware we don’t run the model … so this file might be useless …
- The other solution would be tna_32q_multiprogram/test.py would program the pipe independently using 2 grpc client_id for program_a and program_b.
- Should I run “run_switchd” once ?:

run_switchd -p <program_a> -p <program_b> -c <my-multiprogram_custom_bfrt.conf>

-Or i’ll have to start “run_switchd” twice ?:

run_switchd -p <program_a> -c <my-multiprogram_custom_bfrt.conf><br>run_switchd -p <program_a> -c <my-multiprogram_custom_bfrt.conf>

Sorry if I miss where the information on FASTER portal.

But I could not find the right information on my BA-102 course regarding multi-pipe/program topics. (I do remember some questions were raised though on the topic)

PS: side (silly) question: on our WEDGE-BF100-32X we have only 2 pipes. So it should be a TOFINO BFN-T10-032D, however how can I check this ? On my data sheet from STORDIS I have only a reference to TOFINO-3.3 Tb/s which matches also BFN-T10-032Q (which have 4 pipes) Is the example shown above is also valid for BFN-T10-032D ?

Thanks for your help !

All the best

Frederic

EDIT: I found a "manual solution:

I copied the file in:

$SDE_INSTALL/share/tofinopd/<my_program>/<my_program>.conf

renamed it:

multi_<my_program>_custom_bfrt.conf

added <program_b> structure definition as it is in “tna_32q_multiprogram” example.

and ran bf_switchd:

./run_switchd.sh -p <program_a> <program_b> -c /path/to/multi_<my_program>_custom_bfrt.conf

in case I want to run 2 instances of the same program in 2 distinct pipes, is it sufficient to add a program definition using the same program name with a different scope ID in multi_<my_program>_custom_bfrt.conf ?

Or should I copy the full program ?:

  • change the program name (my_program → my_program_a) change the pipe binding: i.e Switch(my_pipe_a)
  • and respectively (my_program → my_program_b) and Switch(my_pipe_b)

Thanks for your support !

Frederic

Hi Vladimir,

First many thanks for your prompt answer.

TBH p4_build.sh works so i great that I forgot that p4studio_build.sh even exist. I’ll then have a thorough look at it.

I managed to run multiple program on different pipe on the WEDGE.

Now I’m getting grpc issue in order to opee 2 grpc clients pointing working on pipe_0 and pipe_1. I’ll look at test.py in the tna_32q_multiprogram example in order to sort this out.

You are right in mentioning that running multi-program using distinct pipe. In our case, we have deployed our p4 testbed sucessfully and multi-program would be a convenient way for our lab users to “have” the impression to have 2 “p4 devices” with one WEDGEBF100X node.

Thanks again,

Take care.

Frederic

Hi Vladimir,

I have a follow-up question regarding this topic.

As you mentioned in the answer, replacing the program running on one pipe still requires us to perform a full core reset that will clear the other pipes too. I am curious about the reasons for this constraint.

Could you let me know whether there is a fundamental reason why Tofino does not support a `partial pipe programming’ feature today?

Thanks,

Daehyeok