Re: [PATCH bpf-next v2] bpf testing: permit ingress_ifindex in bpf_prog_test_run_xattr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/28/21 3:14 AM, Neil Spring wrote:
bpf_prog_test_run_xattr takes a struct __sk_buff, but did not permit
that __skbuff to include an nonzero ingress_ifindex.

This patch updates to allow ingress_ifindex, convert the __sk_buff field to
sk_buff (skb_iif) and back, and test that the value is present from
tested bpf.  The test sets an unlikely distinct value for ingress_ifindex
(11) from ifindex (1), but that seems in keeping with the rest of the
synthetic fields.

Adding this support allows testing BPF that operates differently on
incoming and outgoing skbs by discriminating on this field.

Signed-off-by: Neil Spring <ntspring@xxxxxx>

This triggers CI test suite failure, pls double check and fix:

  [...]
  test_skb_ctx:PASS:load 0 nsec
  test_skb_ctx:PASS:ctx_size_in 0 nsec
  test_skb_ctx:PASS:ctx_size_out 0 nsec
  test_skb_ctx:PASS:len 0 nsec
  test_skb_ctx:PASS:tc_index 0 nsec
  test_skb_ctx:PASS:hash 0 nsec
  test_skb_ctx:PASS:sk 0 nsec
  test_skb_ctx:PASS:run 146200 nsec
  test_skb_ctx:PASS:ctx_size_out 146200 nsec
  test_skb_ctx:PASS:ctx_out_cb 146200 nsec
  test_skb_ctx:PASS:ctx_out_cb 146200 nsec
  test_skb_ctx:PASS:ctx_out_cb 146200 nsec
  test_skb_ctx:PASS:ctx_out_cb 146200 nsec
  test_skb_ctx:PASS:ctx_out_cb 146200 nsec
  test_skb_ctx:PASS:ctx_out_priority 146200 nsec
  test_skb_ctx:PASS:ctx_out_ifindex 146200 nsec
  test_skb_ctx:FAIL:ctx_out_ifindex skb->ifindex == 1, expected 11
  test_skb_ctx:PASS:ctx_out_tstamp 146200 nsec
  test_skb_ctx:PASS:ctx_out_mark 146200 nsec
  #111 skb_ctx:FAIL
  [...]

https://github.com/kernel-patches/bpf/runs/3466106681?check_suite_focus=true

Thanks,
Daniel



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux