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

**URL:** <https://forum.p4.org/t/how-to-add-entries-to-tables-in-control-plane-in-bmv2-switch/765>\
**Category:** Getting Started with P4\
**Created:** [May 1, 2023, 6:19pm UTC](https://forum.p4.org/t/how-to-add-entries-to-tables-in-control-plane-in-bmv2-switch/765 "2023-05-01T18:19:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nagmat](https://avatars.discourse-cdn.com/v4/letter/n/e68b1a/32.png) [@nagmat](https://forum.p4.org/u/nagmat)\
**Post date:** [May 1, 2023, 6:19pm UTC](https://forum.p4.org/t/how-to-add-entries-to-tables-in-control-plane-in-bmv2-switch/765/1 "2023-05-01T18:19:34Z")

</div>

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`

```auto
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

---

<div class="post-metadata">

**Author:** ![DavideS](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/davides/32/120_2.png) [@DavideS](https://forum.p4.org/u/DavideS)\
**Post date:** [May 1, 2023, 6:58pm UTC](https://forum.p4.org/t/how-to-add-entries-to-tables-in-control-plane-in-bmv2-switch/765/2 "2023-05-01T18:58:36Z")

</div>

Hi @nagmat

The syntax is `table_add table_name action_name match_criteria => value`

> <https://github.com/p4lang/behavioral-model/blob/adff022fc8679f5436d07e7af73c3300431df785/tools/runtime_CLI.py#L1143>

---

<div class="post-metadata">

**Author:** ![nagmat](https://avatars.discourse-cdn.com/v4/letter/n/e68b1a/32.png) [@nagmat](https://forum.p4.org/u/nagmat)\
**Post date:** [May 1, 2023, 8:34pm UTC](https://forum.p4.org/t/how-to-add-entries-to-tables-in-control-plane-in-bmv2-switch/765/3 "2023-05-01T20:34:23Z")

</div>

> [@DavideS](#):
>
> `action_name`

It worked out, Thanks!

```auto
RuntimeCmd: table_add MyIngress.ipv4_lpm MyIngress.ipv4_forward 10.0.3.0/24 => 3 3

```

```auto
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

```

---

<div class="post-metadata">

**Author:** ![nagmat](https://avatars.discourse-cdn.com/v4/letter/n/e68b1a/32.png) [@nagmat](https://forum.p4.org/u/nagmat)\
**Post date:** [May 11, 2023, 11:41pm UTC](https://forum.p4.org/t/how-to-add-entries-to-tables-in-control-plane-in-bmv2-switch/765/4 "2023-05-11T23:41:00Z")

</div>

As a follow-up to my previous question.

```auto
{
  "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`

```plaintext
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
