How to run stratum on tofino software model ?

22 views
Skip to first unread message

Xiaochou Chen

unread,
Feb 5, 2022, 2:40:47 AMFeb 5
to stratum-dev

on ubuntun 16, I can successfully run the following command
./run_tofino_model.sh -p simple_l3
./run_switchd.sh -p simple_l3

It looks like I can run the P4 program on the tofino software model, but how can I run stratum on the tofino software model?

Can anyone tell me the steps to do this? Or where can I get the information I need?

Maximilian Pudelko

unread,
Feb 7, 2022, 9:42:58 PMFeb 7
to Xiaochou Chen, stratum-dev

--
You received this message because you are subscribed to the Google Groups "stratum-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stratum-dev...@opennetworking.org.
To view this discussion on the web visit https://groups.google.com/a/opennetworking.org/d/msgid/stratum-dev/70328bb7-8980-4e0b-a06c-aa32ace0f486n%40opennetworking.org.
Message has been deleted

Maximilian Pudelko

unread,
Feb 12, 2022, 3:27:16 PMFeb 12
to Xiaochou Chen, stratum-dev
Hi Xiaochou,

Tofino-model does not need a portmap. Something must have gone wrong in the startup process.

Also check out how tofino-model is used in fabric-tna:
https://github.com/stratum/fabric-tna/blob/main/ptf/run/tm/base.sh#L114-L133


Max


On Wed, Feb 9, 2022 at 5:00 AM Xiaochou Chen <xcc...@xmu.edu.my> wrote:
Hi Max,

Thank you very much for your reply.

on ubuntu16, 
Followed those steps and I made docker image:   stratumproject/tofino-model:9.3.1

Then, run command:
cxc@u16-108:~$ docker run --rm -it --privileged   --network=host   stratumproject/tofino-model:9.3.1
No of Veths is 64
Adding CPU veth
vm.nr_hugepages = 128
 PRIVS: Eff=0x00000000 Perm=0x00002006 Inh=0x00000000
Performing preliminary checks on config file
Opening p4 target config file '/usr/share/stratum/tofino_skip_p4.conf' ...
Loaded p4 target config file
 Package size 1
 No of Chips is 1
 No of Packages is 1
Chip 0 SKU: defaulting to BFN77110
Chip 0 SKU setting: sku 0 pipe mode 0
Chip 0 Physical pipes enabled bitmap 0xf
Adding interface veth0 as port 0
Adding interface veth2 as port 1
Adding interface veth4 as port 2
Adding interface veth6 as port 3
Adding interface veth8 as port 4
Adding interface veth10 as port 5
Adding interface veth12 as port 6
Adding interface veth14 as port 7
Adding interface veth16 as port 8
Adding interface veth18 as port 9
Adding interface veth20 as port 10
Adding interface veth22 as port 11
Adding interface veth24 as port 12
Adding interface veth26 as port 13
Adding interface veth28 as port 14
Adding interface veth30 as port 15
Adding interface veth32 as port 16
Adding interface veth250 as port 64
Simulation target: Asic Model
Using TCP port range: 8001-8004
Listen socket created
bind done on port 8001. Listening..
CLI listening on port 8000
Waiting for incoming connections...

Afterwards, I ran it in another terminal window, but encountered a problem:

cxc@u16-108:~$ PLATFORM=barefoot-tofino-model /home/cxc/start_stratum.9.2.0.sh  -bf_switchd_background=false  --chassis_config_file=/etc/stratum/barefoot-tofino-model/chassis_config.pb.txt  -enable_onlp=false
+ [[ -z barefoot-tofino-model ]]
+ [[ -z barefoot-tofino-model ]]
+ '[' -d /etc/onl ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ LOG_DIR=/var/log
+ SDE_VERSION=9.2.0
++ uname -r
+ KERNEL_VERSION=4.15.0-142-generic
+ DOCKER_IMAGE=stratumproject/stratum-bf
+ DOCKER_IMAGE_TAG=bf-sde-9.2.0.tar-linux-4.14.151-OpenNetworkLinux
++ uname -r
++ uname -r
+ docker run -it --rm --privileged -v /dev:/dev -v /sys:/sys -v /lib/modules/4.15.0-142-generic:/lib/modules/4.15.0-142-generic --env PLATFORM=barefoot-tofino-model -p 28000:28000 -p 9339:9339 -p 9559:9559 -v /var/log:/var/log/stratum stratumproject/stratum-bf:bf-sde-9.2.0.tar-linux-4.14.151-OpenNetworkLinux -bf_switchd_background=false --chassis_config_file=/etc/stratum/barefoot-tofino-model/chassis_config.pb.txt -enable_onlp=false
Cannot find port map file /etc/stratum/barefoot-tofino-model/port_map.json



Can you give me an example of a port-map.json that can be used for tofino-model?


Reply all
Reply to author
Forward
0 new messages