运行环境:
BlueFied-2 型号MBF2H516A-CEEOT
Linux version 5.15.0-1060-bluefield (buildd@bos03-arm64-114)
DOCA 2.10.0087
情况:
我在参照switch示例程序说明运行程序(https://docs.nvidia.com/doca/sdk/doca+switch+application+guide/index.html),执行了./doca_switch – -p 03:00.0 -r vf[0-1] -l 60,成功运行。
进入switch程序的命令行之后,输入了如下的命令(1):
create fwd type=port,port_id=0xffff
create pipe port_id=0,name=p0_to_vf1,root_enable=1,fwd=1
create fwd type=port,port_id=1
add entry pipe_queue=0,fwd=1,pipe_id=1012
query entry_id=3415432416174012788
但在query entry_id这一步,出现了段错误,我使用gdb进行调试,发现崩溃点在doca_flow_resource_query_entry () from /opt/mellanox/doca/lib/aarch64-linux-gnu/libdoca_flow.so.2。
函数参数有entry和stats,调试中print stats和*stats,发现stats 是有效的,并且内容可读,print entry也有正确内存地址的输出,猜测可能是entry中某个字段为空导致的问题,所以调整了执行的命令行,输入如下命令(2):
create fwd type=port,port_id=0xffff
create pipe port_id=0,name=p0_to_vf1,root_enable=1,fwd=1
create entry_match outer.eth.src_mac=11:22:33:44:55:66,outer.eth.dst_mac=66:55:44:33:22:11
create actions encap_src_ip_type=ipv4
create monitor flags=0x3,cir=100,cbs=100
create fwd type=port,port_id=1
add entry pipe_id=16057732822350369178,pipe_queue=0,monitor=1,fwd=1
query entry_id=3415432416174012788
执行后,依旧出现了段错误问题,在gdb中print actions,有输出,但是属于未赋值状态,对之前没有创建字段运行的程序(命令1)进行调试print actions,发现处于一样的状态(actions内部值全为0)。但print monitor两次结果却不一样,这可能说明在命令2中monitor的参数传入了entry。
问题:
段错误问题是因为我的输入命令的有误造成的吗?或是库函数的问题?该怎么解决呢?