[resolved] P4runtime: No forwarding pipeline config or SEGFAULT

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

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

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

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

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

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

?

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

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 :slight_smile:

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

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 :slight_smile:

– ah the simple_switch_grpc logs [P4Runtime] Invalid P4 id

1 Like

last bits with Invalid P4 id also fixed :slight_smile: I now have a functional p4runtime_client :slightly_smiling_face:

2 Likes