p4lang / p4runtime

Specification documents for the P4Runtime control-plane API
Apache License 2.0
140 stars 86 forks source link

API for GetForwardingpipelineconfig #397

Closed Johnny-dai-git closed 1 year ago

Johnny-dai-git commented 1 year ago

HI,

I am trying to use the GetForwardingpipelineconfig RPC to retrieve the p4info from the device ( simple_switch_grpc with start with input json file).

However, I can not find enough information to help me finish this goal and I do not see the support api in the switch.py.

Could we have such feature and API ? It will provide greate help in some scenario.

Best Regards,

antoninbas commented 1 year ago

I am trying to use the GetForwardingpipelineconfig RPC to retrieve the p4info from the device ( simple_switch_grpc with start with input json file).

GetForwardingPipelineConfig cannot retrieve a P4Info if you didn't previously push it to the switch with SetForwardingPipelineConfig. Providing a json file to simple_switch_grpc when starting the process is not the recommended way to use simple_switch_grpc with P4Runtime, as mentioned in the documentation.

However, I can not find enough information to help me finish this goal and I do not see the support api in the switch.py.

I don't know what switch.py refers to. But hopefully the P4Runtime spec describes usage of SetForwardingPipelineConfig / GetForwardingPipelineConfig with enough details.

Could we have such feature and API ? It will provide greate help in some scenario.

If you mean support for GetForwardingPipelineConfig without an earlier call to SetForwardingPipelineConfig, no that won't be supported. It doesn't make sense in the context of P4Runtime. And bmv2 / simple_switch_grpc has no ability to generate the P4Info from the bmv2 JSON.

If you need more examples for using P4Runtime, I can refer you to:

Finally, the P4 forum is a better place to ask such questions. You can also search through previously asked questions.

Johnny-dai-git commented 1 year ago

Hi,

Thank you so much !

Best Regards,

On Thu, Sep 15, 2022 at 1:55 PM Antonin Bas @.***> wrote:

I am trying to use the GetForwardingpipelineconfig RPC to retrieve the p4info from the device ( simple_switch_grpc with start with input json file).

GetForwardingPipelineConfig cannot retrieve a P4Info if you didn't previously push it to the switch with SetForwardingPipelineConfig. Providing a json file to simple_switch_grpc when starting the process is not the recommended way to use simple_switch_grpc with P4Runtime, as mentioned in the documentation https://github.com/p4lang/behavioral-model/tree/main/targets/simple_switch_grpc .

However, I can not find enough information to help me finish this goal and I do not see the support api in the switch.py.

I don't know what switch.py refers to. But hopefully the P4Runtime spec describes usage of SetForwardingPipelineConfig / GetForwardingPipelineConfig with enough details.

Could we have such feature and API ? It will provide greate help in some scenario.

If you mean support for GetForwardingPipelineConfig without an earlier call to SetForwardingPipelineConfig, no that won't be supported. It doesn't make sense in the context of P4Runtime. And bmv2 / simple_switch_grpc has no ability to generate the P4Info from the bmv2 JSON.

If you need more examples for using P4Runtime, I can refer you to:

Finally, the P4 forum https://forum.p4.org/ is a better place to ask such questions. You can also search through previously asked questions.

— Reply to this email directly, view it on GitHub https://github.com/p4lang/p4runtime/issues/397#issuecomment-1248423299, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANDGLBZI2DHZGNP3UQQ7JZTV6NPJBANCNFSM6AAAAAAQJ5M4EM . You are receiving this because you authored the thread.Message ID: @.***>

-- Yuanjun Dai (he/him) P.hd Department of Computer and Data Sciences Case Western Reserve University Phone: (216)-235-8330 Office: Glennan 505