nsg-ethz/p4-learning

Questions about controller program

ls760008979 opened this issue · 4 comments

I want to know what the function "bm_mgmt_get_info()" do, and where can i get these information from?

Which appear in l2-learning excises"https://github.com/nsg-ethz/p4-learning/blob/master/exercises/04-L2_Learning/solution/l2_learning_controller.py",i don't know what the function is it.Thanks in advance!

If you have the VM setup, the function is declared in "/home/p4/p4-tools/bmv2/src/bm_runtime/Standard_server.cpp".

image

Hi !

You can also check the thrift API here and see that that function will return the following struct:

struct BmConfig {
 1:i64 device_id,
 2:i32 thrift_port,
 3:optional string notifications_socket,
 4:optional string elogger_socket,
 5:optional string debugger_socket
}

See:
https://github.com/p4lang/behavioral-model/blob/main/thrift_src/standard.thrift#L273

Thanks a lot!