p4lang / tutorials

P4 language tutorials
Apache License 2.0
1.3k stars 873 forks source link

running bmv2 on DPU BlueField-2 #513

Closed mashemat closed 7 months ago

mashemat commented 1 year ago

Hello everyone,

I am trying to run exercises on BlueField-2 SmartNIC with ARM cores. However, I receive the following error, could you please help me with this:

mkdir -p build pcaps logs p4c-bm2-ss --p4v 16 --p4runtime-files build/calc.p4.p4info.txt -o build/calc.json calc.p4 make: p4c-bm2-ss: Command not found make: *** [../../utils/Makefile:43: calc.json] Error 127

Thanks,

jafingerhut commented 1 year ago

The command p4c-bm2-ss is a combination of the open source front end P4 compiler, plus the open source back end for the behavioral-model (aka BMv2) simple_switch software switch (that is what the ss is for in the name p4c-bm2-ss).

I would be very surprised if that back end produces output that is usable by a BlueField-2 SmartNIC, but I have never used one nor read its documentation, so I could be wrong about that. I would recommend checking with official support for BlueField-2 SmartNICs what they recommend for compiling P4 programs that you want to run on that hardware.

If you want to compile and load a program into the BMv2 simple_switch software switch, you can find scripts for installing it, and VM images with the open source development tools already compiled and ready for use, here: https://github.com/jafingerhut/p4-guide/blob/master/bin/README-install-troubleshooting.md

mashemat commented 1 year ago

Hi jafingerhut,

Thank you very much for your reply and description. Actually, this issue was resolved. The problem was double installation of p4c :). However, still I am struggling to make a simple p4 tutorial exercise work on BlueField-2.

Thanks for your sugesstions!

Regards,

jafingerhut commented 1 year ago

The tutorial exercises are written to run using a P4 architecture called v1model, intended to model a switch with ingress processing, a traffic manager, then egress processing. I do not know what P4 architectures BlueField-2 supports, but it might be very different than v1model, which means that you would need to understand the other architecture that the device supports, and most likely manually change the code in many places (or rewrite it from scratch) in order to enable it to compile and do something useful.

mashemat commented 1 year ago

Yes, I am going to open a case for that and ask which architecture BlueField-2 supports. I just noticed itself with DOCA it supports some packages that I was struggling to install: grpc

I can update here what I hear from NVIDIA support.

Thanks,

jafingerhut commented 1 year ago

Warning: Be careful, you may be obligated by a license agreement with Nvidia NOT to report details about its inner workings in a public place. I do not know the details of your license agreement, but you should check before saying things about it publicly.