• Hangbin Liu's avatar
    selftests: forwarding: use proto icmp for {gretap, ip6gretap}_mac testing · e8023b03
    Hangbin Liu authored
    For tc ip_proto filter, when we extract the flow via __skb_flow_dissect()
    without flag FLOW_DISSECTOR_F_STOP_AT_ENCAP, we will continue extract to
    the inner proto.
    
    So for GRE + ICMP messages, we should not track GRE proto, but inner ICMP
    proto.
    
    For test mirror_gre.sh, it may make user confused if we capture ICMP
    message on $h3(since the flow is GRE message). So I move the capture
    dev to h3-gt{4,6}, and only capture ICMP message.
    
    Before the fix:
    ]# ./mirror_gre.sh
    TEST: ingress mirror to gretap (skip_hw)                            [ OK ]
    TEST: egress mirror to gretap (skip_hw)                             [ OK ]
    TEST: ingress mirror to ip6gretap (skip_hw)                         [ OK ]
    TEST: egress mirror to ip6gretap (skip_hw)                          [ OK ]
    TEST: ingress mirror to gretap: envelope MAC (skip_hw)              [FAIL]
     Expected to capture 10 packets, got 0.
    TEST: egress mirror to gretap: envelope MAC (skip_hw)               [FAIL]
     Expected to capture 10 packets, got 0.
    TEST: ingress mirror to ip6gretap: envelope MAC (skip_hw)           [FAIL]
     Expected to capture 10 packets, got 0.
    TEST: egress mirror to ip6gretap: envelope MAC (skip_hw)            [FAIL]
     Expected to capture 10 packets, got 0.
    TEST: two simultaneously configured mirrors (skip_hw)               [ OK ]
    WARN: Could not test offloaded functionality
    
    After fix:
    ]# ./mirror_gre.sh
    TEST: ingress mirror to gretap (skip_hw)                            [ OK ]
    TEST: egress mirror to gretap (skip_hw)                             [ OK ]
    TEST: ingress mirror to ip6gretap (skip_hw)                         [ OK ]
    TEST: egress mirror to ip6gretap (skip_hw)                          [ OK ]
    TEST: ingress mirror to gretap: envelope MAC (skip_hw)              [ OK ]
    TEST: egress mirror to gretap: envelope MAC (skip_hw)               [ OK ]
    TEST: ingress mirror to ip6gretap: envelope MAC (skip_hw)           [ OK ]
    TEST: egress mirror to ip6gretap: envelope MAC (skip_hw)            [ OK ]
    TEST: two simultaneously configured mirrors (skip_hw)               [ OK ]
    WARN: Could not test offloaded functionality
    
    Fixes: ba8d3987 ("selftests: forwarding: Add test for mirror to gretap")
    Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
    Reviewed-by: default avatarPetr Machata <pmachata@gmail.com>
    Tested-by: default avatarPetr Machata <pmachata@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    e8023b03
mirror_gre.sh 3.29 KB