问题描述
VtsKernelNetTest failed
VtsKernelNetTest#testKernelNetworking
failed traceback :
ERROR: testUpdateActiveSaMarks (xfrm_test.XfrmOutputMarkTest)
Test that the OUTPUT_MARK can be updated on an ACTIVE SA.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/data/nativetest64/kernel_net_tests/kernel_net_tests/xfrm_test.py", line 833, in testUpdateActiveSaMarks
outNoStateCount = self.getXfrmStat(XFRM_STATS_OUT_NO_STATES);
File "/data/nativetest64/kernel_net_tests/kernel_net_tests/xfrm_test.py", line 806, in getXfrmStat
with open(XFRM_STATS_PROCFILE, 'r') as f:
IOError: [Errno 2] No such file or directory: '/proc/net/xfrm_stat'
解决方案
Failed是因为没有enable CONFIG_XFRM_STATISTICS,所以找不到/proc/net/xfrm_stat'。
Google要求Q至少kernel4.9,而且CONFIG_XFRM_STATISTICS是在kernel4.9 default enable的,k50s project是kernel3.18,default没开这个config
Kernel3.18,enable CONFIG_XFRM_STATISTICS后,failed的backtrace是
Test case测试是update xfrm state by output_mark,output_mark正好是netid,然后tunnel mode发dns query包,预期包能发送出去。
Tunnel mode会查找两次route,第一次route mark正确,第二次route mark不正确
Kernel3.18,enable CONFIG_XFRM_STATISTICS后,failed的backtrace是
Test case测试是update xfrm state by output_mark,output_mark正好是netid,然后tunnel mode发dns query包,预期包能发送出去。
Tunnel mode会查找两次route,第一次route mark正确,第二次route mark不正确
<3>[ 163.900873] (0)[3564:kernel_net_test][ADDLOG][fib_rule_match] rule->mark = 96, fl->flowi_mark = c8, rule->mark_mask = ffff
<3>[ 163.901505] (0)[3564:kernel_net_test][ADDLOG][fib_rule_match] rule->mark = c8, fl->flowi_mark = 0, rule->mark_mask = ffff
第二次查route是通过xfrm_bundle_create->xfrm_dst_lookup()查找
<3>[ 163.901505] (0)[3564:kernel_net_test][ADDLOG][fib_rule_match] rule->mark = c8, fl->flowi_mark = 0, rule->mark_mask = ffff
第二次查route是通过xfrm_bundle_create->xfrm_dst_lookup()查找
对比pass log,发现是call xfrm_State_update()的时候update了smark的值,而kernel3.18没有。自己写code update后case pass
Google回复kernel3.18他们有更新patch,如下:
https://android-review.googlesource.com/c/kernel/common/+/748010
q0.mp1申请patch:ALPS05043308