• Yonghong Song's avatar
    net: bpf: add a test for skb_segment in test_bpf module · 76db8087
    Yonghong Song authored
    Without the previous commit,
    "modprobe test_bpf" will have the following errors:
    ...
    [   98.149165] ------------[ cut here ]------------
    [   98.159362] kernel BUG at net/core/skbuff.c:3667!
    [   98.169756] invalid opcode: 0000 [#1] SMP PTI
    [   98.179370] Modules linked in:
    [   98.179371]  test_bpf(+)
    ...
    which triggers the bug the previous commit intends to fix.
    
    The skbs are constructed to mimic what mlx5 may generate.
    The packet size/header may not mimic real cases in production. But
    the processing flow is similar.
    Signed-off-by: default avatarYonghong Song <yhs@fb.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    76db8087
test_bpf.c 153 KB