# \[resolved\] P4runtime: No forwarding pipeline config or SEGFAULT

**URL:** <https://forum.p4.org/t/resolved-p4runtime-no-forwarding-pipeline-config-or-segfault/1061>\
**Category:** P4 Dev\
**Created:** [December 16, 2023, 10:58pm UTC](https://forum.p4.org/t/resolved-p4runtime-no-forwarding-pipeline-config-or-segfault/1061 "2023-12-16T22:58:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonderooij](https://avatars.discourse-cdn.com/v4/letter/l/7bcc69/32.png) [@leonderooij](https://forum.p4.org/u/leonderooij)\
**Post date:** [December 16, 2023, 10:58pm UTC](https://forum.p4.org/t/resolved-p4runtime-no-forwarding-pipeline-config-or-segfault/1061/1 "2023-12-16T22:58:57Z")

</div>

Hi all!

I’m experimenting with creating a p4 application that forwards packets to a different destination based on table entries set by a custom c/c++ application.

The p4 program is here: [rtpengine/test-dpu-offload/p4/softdpu.p4 at dpu\_offload · oshlabs/rtpengine · GitHub](https://github.com/oshlabs/rtpengine/blob/dpu_offload/test-dpu-offload/p4/softdpu.p4)

It allows the table entries to be set as is described here: [rtpengine/test-dpu-offload/p4/README.md at dpu\_offload · oshlabs/rtpengine · GitHub](https://github.com/oshlabs/rtpengine/blob/dpu_offload/test-dpu-offload/p4/README.md)

So this all works when I’m using the regular simple\_switch and manipulating the table using simple\_switch\_CLI.

I’m now trying to populate the tables over GRPC using p4runtime with the program that’s located here: [rtpengine/test-dpu-offload/p4runtimeclient at dpu\_offload · oshlabs/rtpengine · GitHub](https://github.com/oshlabs/rtpengine/tree/dpu_offload/test-dpu-offload/p4runtimeclient)

But if I run it as it is there, the simple\_switch\_grpc segfaults.

It doesn’t segfault if I comment out this line: [rtpengine/test-dpu-offload/p4runtimeclient/p4runtime\_client\_wrapper.cpp at dpu\_offload · oshlabs/rtpengine · GitHub](https://github.com/oshlabs/rtpengine/blob/dpu_offload/test-dpu-offload/p4runtimeclient/p4runtime_client_wrapper.cpp#L28)

But then I get the following error:

> Failed to insert table entry: No forwarding pipeline config set for this device

Does anyone know what I’m doing wrong?

Thank you,

Leon

---

<div class="post-metadata">

**Author:** ![leonderooij](https://avatars.discourse-cdn.com/v4/letter/l/7bcc69/32.png) [@leonderooij](https://forum.p4.org/u/leonderooij)\
**Post date:** [December 16, 2023, 11:03pm UTC](https://forum.p4.org/t/resolved-p4runtime-no-forwarding-pipeline-config-or-segfault/1061/2 "2023-12-16T23:03:36Z")

</div>

Wondering if it’s correct to push the literal JSON here:

> <https://github.com/oshlabs/rtpengine/blob/dpu_offload/test-dpu-offload/p4runtimeclient/p4runtime_client_wrapper.cpp#L67>

?

---

<div class="post-metadata">

**Author:** ![leonderooij](https://avatars.discourse-cdn.com/v4/letter/l/7bcc69/32.png) [@leonderooij](https://forum.p4.org/u/leonderooij)\
**Post date:** [December 17, 2023, 9:06am UTC](https://forum.p4.org/t/resolved-p4runtime-no-forwarding-pipeline-config-or-segfault/1061/3 "2023-12-17T09:06:56Z")

</div>

I made a pcap of the p4runtime/grpc traffic going over the wire, it can be found here: [rtpengine/test-dpu-offload/simple\_switch\_grpc\_crash.pcap at dpu\_offload · oshlabs/rtpengine · GitHub](https://github.com/oshlabs/rtpengine/blob/dpu_offload/test-dpu-offload/simple_switch_grpc_crash.pcap)

I see the whole JSON is sent (frame 9, 10, 12 [large MTU therefore fits in so few packets]).

But not sure how to further interpret this and whether it’s correct what’s being sent.

I tried recompiling simple\_switch\_grpc with `-ggdb` and `-O0`, with `ulimit -c unlimited` and analyze the coredump in GDB, but getting some weird errors like:

- `warning: core file may not match specified executable file.`
- `warning: Section .reg-xstate/1058446 in core file too small.`
- of course nothing in the backtrace after that

while I’m sure the binary executable is the same while running vs what’s passed to GDB.

I think I will try to:

- use another tool to interface with the simple\_switch\_grpc to see if that works (i believe there is some python/shell thing that uses grpc?)
- try to lookup more examples to see how the `SetForwardingPipelineConfig()` is being used…

Hope someone has a hint, thanks 🙂

---

<div class="post-metadata">

**Author:** ![leonderooij](https://avatars.discourse-cdn.com/v4/letter/l/7bcc69/32.png) [@leonderooij](https://forum.p4.org/u/leonderooij)\
**Post date:** [December 17, 2023, 9:43am UTC](https://forum.p4.org/t/resolved-p4runtime-no-forwarding-pipeline-config-or-segfault/1061/4 "2023-12-17T09:43:00Z")

</div>

Alright! I was just experimenting a bit, and I can prevent the segfault if I do `VERIFY_AND_COMMIT` instead of `RECONCILE_AND_COMMIT` !!! 😄

When doing the insert I don’t get the `No forwarding pipeline config set for this device` error anymore… Just an empty error: `Failed to insert table entry:` … anyway progress 🙂

– ah the simple\_switch\_grpc logs `[P4Runtime] Invalid P4 id`

---

<div class="post-metadata">

**Author:** ![leonderooij](https://avatars.discourse-cdn.com/v4/letter/l/7bcc69/32.png) [@leonderooij](https://forum.p4.org/u/leonderooij)\
**Post date:** [December 17, 2023, 10:15pm UTC](https://forum.p4.org/t/resolved-p4runtime-no-forwarding-pipeline-config-or-segfault/1061/5 "2023-12-17T22:15:49Z")

</div>

last bits with Invalid P4 id also fixed 🙂 I now have a functional p4runtime\_client 🙂
