NFD endpoints:bind endpoint 1 on card 0 to CPU 6
root@ubuntu-PowerEdge-R720:/home/ubuntu# echo -n 6 > /sys/module/nfemsg_nfp/card0endpoint1_counters/cpu_bind
bash: echo: write error: Operation not permitted
操作失败!
编译测试文件,compile
samples/nfm_sample_packet.c
root@ubuntu-PowerEdge-R720:/opt/netronome/samples# gcc -Wall -W -I/opt/netronome/include -O2 \
//-Wall -W 表示显示所有警告信息
//-Ixx增加目录xx,让编译器可以在xx下寻找头文件,-O2 进一步优化。
> -L/opt/netronome/lib -W1,-R/opt/netronome/lib \ //-Lxx 表示增加目录xx,让编译器可以在xx下寻找库文件
//
-Wl,表示后面的参数将传给link程序ld
> -W1,-rpath,/opt/netronome/lib -lnfm_packet -lnfm_error \ //-lxx 表示动态加载libxx.so库
> -lpthread -lnfm_error -lnfm_log -lnfm_framework \
> -o nfm_sample_packet nfm_sample_packet.c //-o FILE 生成指定的输出文件。用在生成可执行文件时。
nfm_sample_packet.c: In function ‘main’:
nfm_sample_packet.c:289:20: warning: ‘start_us’ may be used uninitialized in this function [-Wmaybe-uninitialized]
unsigned int us = end_us - start_us;
^
/usr/bin/ld: cannot find -lnfm_packet
/usr/bin/ld: cannot find -lnfm_error
collect2: error: ld returned 1 exit status
出现错误!修改了nfm_sample_packet.c文件后,再编译一次
root@ubuntu-PowerEdge-R720:/opt/netronome/samples# gcc -Wall -W -I/opt/netronome/include -O2 -L/opt/netronome/lib -Wl,-R/opt/netronome/lib -Wl,-rpath,/opt/netronome/lib -lnfm_packet -lnfm_error -lpthread -lnfm_error -lnfm_log -lnfm_framework -o nfm_sample_packet nfm_sample_packet.c
/usr/bin/ld: cannot find -lnfm_packet
/usr/bin/ld: cannot find -lnfm_error
collect2: error: ld returned 1 exit status
发现其他两个错误还是存在。
原因:在目录/opt/netronome/lib下确实没找到libnfm_packet和libnfm_error库文件
执行当前目录下makefile文件,显示如下:
root@ubuntu-PowerEdge-R720:/opt/netronome/samples# make
gcc -o nfm_sample_log nfm_sample_log.c
-Wall -W -I/opt/netronome/include -I/opt/netronome/include
-O0 -g -ggdb -DDEBUG -lnfp -lns_armctrl //
-O0 不进行优化处理。
-g
该选项可以利用操作系统的“原生格式(native format)”生成调试
信息。GDB 可以直接利用这个信息,其它调试器也可以使用这个调试信息
-ggdb
使 GCC 为 GDB 生成专用的更为丰富的调试信息,但是,此时就不能用其
他的调试器来进行调试了 (如 ddx)
该选项可以利用操作系统的“原生格式(native format)”生成调试
信息。GDB 可以直接利用这个信息,其它调试器也可以使用这个调试信息
-ggdb
使 GCC 为 GDB 生成专用的更为丰富的调试信息,但是,此时就不能用其
他的调试器来进行调试了 (如 ddx)
-L/opt/netronome/lib -L/opt/netronome/lib -lstdc++
-Wl,-R/opt/netronome/lib -Wl,-R/opt/netronome/lib
-g -ggdb -lnfm -lpthread
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
make: *** [nfm_sample_log] Error 1
存在错误。
原因:在目录
/opt/netronome/lib下确实没找到libstdc++库文件
修改Jumbo frames,即改变数据帧的尺寸:
root@ubuntu-PowerEdge-R720:/opt/netronome/samples# /opt/netronome/bin/nfm-initd.sh stop //关闭NFM
Stopping Netronome Flow Manager:
************** Stop NFM on Wed Jul 8 01:03:14 HKT 2015 ****************
--- Disabling traffic
Disabling traffic on NFE 0
--- Stopping NFM daemons on host
--- Stopping the NFM driver
--- Stopping the NFD drivers
--- Unloading the firmware on NFE 0
--- Establishing SSH communication with the ARM on NFE 0
--- Stopping daemons on the ARM on NFE 0
Stopping nfmmsgd: OK
Stopping tcammsgd: OK
************** Stop complete on Wed Jul 8 01:03:23 HKT 2015 ****************
success.
root@ubuntu-PowerEdge-R720:/opt/netronome/samples# vi /etc/netronome.conf //使用vi命令编辑
netronome.conf 配置文件
root@ubuntu-PowerEdge-R720:/opt/netronome/samples# /opt/netronome/bin/nfm-initd.sh start //启动NFM
Starting Netronome Flow Manager: nfe_net 13309 0
Attempting SSH to nvn0
Starting NFP 0 firmware /lib/firmware/nfm_app_nfp_no_tcam_jumbo.fw
success.
验证是否修改成功:
root@ubuntu-PowerEdge-R720:/opt/netronome/samples# /opt/netronome/bin/nfmconfig
nfe.present = 1
ports.min = 1
ports.max = 2
nfe 0 ports.hw_min = 0
nfe 0 ports.hw_max = 1
ports.switch_tag = 0 (off)
nfm.reuse_syn = 1 (RESET)
nfm.lb_tuple = TWO_TUPLE
nfm.lb_hash = 0 (FLETCHER)
nfm.errored_packet = 1 (DELIVER)
nfm.default_rule = 1 (PASS)
nfm.valhalla_action = 0x0000000000000000
nfm.mpls_depth = 6
me version word = 0x02070003
me revision word = 0x00001e98
Microcode supports jumbo frames. //启动成功
发现修改成功!