[P4-dev] How to send packet-in for a new PI target

Antonin Bas antonin at barefootnetworks.com
Wed Jan 17 14:15:26 EST 2018


Hi Alan,

If you are supporting P4 Runtime by using the p4lang open-source server and
by implementing the PI library C stubs, then all you need to do is call
pi_packetin_receive.
This method will call the callback registered by the gRPC server with the
PI library and a StreamMessageResponse protobuf message will be generated
and sent on the stream to your client / application.
There is an example here for the bmv2 simple_switch_grpc target:
https://github.com/p4lang/behavioral-model/blob/master/targets/simple_switch_grpc/switch_runner.cpp#L276
If you need more information, please ask, although it may be better to open
an issue in the p4lang/PI repository.

Thanks,

Antonin

On Wed, Jan 17, 2018 at 11:03 AM, Alan Lo <alanlo at mellanox.com> wrote:

> Hi,
>
> I am trying to integrate in a new target platform in PI code. We've
> created an "extension" in PI/targets for this.
> Southbound APIs to our HW SDK calls are fairly straight forward, and from
> src/pi_rpc_server.c I see all the southbound APIs to the target specific
> implementation, but I am looking for the mechanism for sending packets
> northbound to the controller. It appears to be a StreamMessageResponse? Can
> someone point me to the methods/interface that needs to be implemented?
>
> Thanks,
> Alan
>
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>



-- 
Antonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20180117/95fd775b/attachment-0002.html>


More information about the P4-dev mailing list