antoninbas/p4runtime-go-client

Question regarding p4runtime-go-client/example

Closed this issue · 1 comments

I have been using your example from https://github.com/pins/p4runtime-go-client/blob/main/cmd/example/main.go to understand client connection and I was able to get primary connection.
You have a var binPath, what does it refer to?

/ondatra/featureprofiles/feature/p4runtime-go-client/cmd/example# go run main.go
INFO[0000] Connecting to server at 10.49.181.175:50051
INFO[0000] Connected to server at 10.49.181.175:50051
INFO[0000] New p4rt client connection made? 10.49.181.175:50051
INFO[0000] We are the primary client!
INFO[0000] Setting forwarding pipe
FATA[0000] Error when setting forwarding pipe: error when reading binary device config: read /root/go/bin: is a directory

binPath should be set to the path of a file whose contents will be used to populate the p4_device_config field of the P4Runtime ForwardingPipelineConfig message: https://p4.org/p4-spec/p4runtime/v1.0.0/P4Runtime-Spec.html#sec-p4-fwd-pipe-config

For bmv2, it is simply the JSON file output by the p4c compiler. For other targets, it will be some other compilation artifact produced by the compiler (or a combination of multiple compilation artifacts).