ipdk-io / ipdk

Infrastructure Programmer Development Kit (IPDK) is an open source, vendor agnostic framework of drivers and APIs for infrastructure offload and management that runs on a CPU, IPU, DPU or switch.
Apache License 2.0
185 stars 68 forks source link

Error: P4Runtime RPC error (INTERNAL): 'bf_pal_device_add(dev_id, &device_profile)' failed with error message: Unexpected error. #405

Open RogueCHU opened 11 months ago

RogueCHU commented 11 months ago

Hey, guys. I wrote a p4 program and p4c-dpdk compiled it successfully. But I couldn't send binary pipeline to the dataplane. The p4_driver.log shows as follow. It seems that there is a problem with my pipeline instructions configuration. But where can I find the "pipeline instructions configuration"?

2023-11-30 08:52:11.755315 INFO  BF_DVM bf_device_warm_init_begin:218 Entering WARM_INIT_BEGIN for device 0 with warm_init_mode 1 
2023-11-30 08:52:11.755382 INFO  BF_DVM bf_device_warm_init_begin:255 Exiting WARM_INIT_BEGIN for device 0
2023-11-30 08:52:11.757741 INFO  BF_DVM bf_device_add dev id 0, is_sw_model 1
2023-11-30 08:52:11.757776 INFO  BF_LLD Entering :lld_dev_add

2023-11-30 08:52:11.757789 INFO  BF_LLD Exiting :lld_dev_add

2023-11-30 08:52:11.757799 INFO  BF_PAL Entering fixed_function_dev_add
2023-11-30 08:52:11.757809 INFO  BF_PAL Exiting fixed_function_dev_add
2023-11-30 08:52:11.757818 INFO  BF_PORT Entering port_mgr_dev_add
2023-11-30 08:52:11.757828 INFO  BF_PORT Enter port_mgr_config_import
2023-11-30 08:52:11.757837 INFO  BF_PORT port_mgr_config_import: device 0, file (null)
2023-11-30 08:52:11.757847 INFO  BF_PORT Exit port_mgr_config_import
2023-11-30 08:52:11.774894 **ERROR** BF_PIPE dal_enable_pipeline line:101 Error -22 at line 0: Pipeline instructions configuration error.

2023-11-30 08:52:11.775125 **ERROR** BF_PIPE Failed to Build Pipeline pipe
2023-11-30 08:52:11.775202 **ERROR** BF_DVM Device add handling failed for dev 0, sts Unexpected error (15), Client pipe-mgr 
2023-11-30 08:52:11.775283 **ERROR** BF_DVM Device add failed for dev 0, sts Unexpected error (15)
2023-11-30 08:52:11.775414 INFO  BF_PORT Entering port_mgr_dev_remove
2023-11-30 08:52:11.775515 INFO  BF_PAL STUB fixed_function_dev_remove
2023-11-30 08:52:11.775539 INFO  BF_LLD Entering dummy STUB:lld_dev_remove

2023-11-30 08:52:11.775551 INFO  BF_LLD Exiting dummy STUB:lld_dev_remove

And the infrap4d.ERROR shows as follow.

E20231130 08:58:15.065459  8768 dpdk_sde_target.cc:170] StratumErrorSpace::ERR_INTERNAL: 'bf_pal_device_add(dev_id, &device_profile)' failed with error message: Unexpected error. 
E20231130 08:58:15.065549  8768 tdi_node.cc:145] Return Error: tdi_sde_interface_->AddDevice(device_id_, tdi_config_) failed with StratumErrorSpace::ERR_INTERNAL: 'bf_pal_device_add(dev_id, &device_profile)' failed with error message: Unexpected error. 
E20231130 08:58:15.065577  8768 dpdk_switch.cc:71] Return Error: tdi_node->PushForwardingPipelineConfig(config) failed with StratumErrorSpace::ERR_INTERNAL: 'bf_pal_device_add(dev_id, &device_profile)' failed with error message: Unexpected error. 
E20231130 08:58:15.065608  8768 error_buffer.cc:30] (p4_service.cc:468): Failed to set forwarding pipeline config for node 1: 'bf_pal_device_add(dev_id, &device_profile)' failed with error message: Unexpected error. 

Any ideas? Thank you.

ffoulkes commented 9 months ago

This is apparently due to a restriction in DPDK that the number of ports must be power of 2. When this condition is not met, a generic error is returned. There was some talk of removing this restriction, but I don't know if this has been done (or if, alternatively, the code has been modified to return an intelligible error message in this case).

Our resources are focused entirely on ES2K support, which means that DPDK is not being updated. We might not have pulled in the fix even if it is available.