How to add entries to tables in control plane in bmv2 switch?

I worked with Intel Tofino switches and adding/changing entries in the control plane was easy.

Now I am trying to add entries in the control plane in bmv2 switch by using : ./tools/behavioral-model/tools/runtime_CLI.py file.

RuntimeCmd: table_info MyIngress.ipv4_lpm

MyIngress.ipv4_lpm             [implementation=None, mk=ipv4.dstAddr(lpm, 32)]
********************************************************************************
MyIngress.drop                 []
MyIngress.ipv4_forward         [dstAddr(48),	port(9)]
NoAction                       []

Now I want to add values to MyIngress.ipv4_forward table but wasn’t successful.

Is there any source where I can learn control plane configuration of bmv2 switch architecture?

Any help is appreciated.

Kind regards,
Nagmat

Hi @nagmat

The syntax is table_add table_name action_name match_criteria => value

1 Like

It worked out, Thanks!

RuntimeCmd: table_add MyIngress.ipv4_lpm MyIngress.ipv4_forward 10.0.3.0/24 => 3 3
Adding entry to lpm match table MyIngress.ipv4_lpm
match key:           LPM-0a:00:03:00/24
action:              MyIngress.ipv4_forward
runtime data:        00:00:00:00:00:03	00:03
Entry has been added with handle 0

As a follow-up to my previous question.

{
  "target": "bmv2",
  "p4info": "build/mri.p4.p4info.txt",
  "bmv2_json": "build/mri.json",
  "table_entries": [
    {
      "table": "MyEgress.swtrace",
      "default_action": true,
      "action_name": "MyEgress.add_swtrace",
      "action_params": {
         "swid": 1
       }
    },

I could add table_add MyEgress.swtrace MyEgress.add_swtrace => 1

match key:           
action:              MyEgress.add_swtrace
runtime data:        00:00:00:01
Entry has been added with handle 0

but couldn’t set the default_action to True. Does anyone know how to set the default_action to True?

Kind regards,
Nagmat