• Willem de Bruijn's avatar
    net: add skb_segment kunit test · b3098d32
    Willem de Bruijn authored
    Add unit testing for skb segment. This function is exercised by many
    different code paths, such as GSO_PARTIAL or GSO_BY_FRAGS, linear
    (with or without head_frag), frags or frag_list skbs, etc.
    
    It is infeasible to manually run tests that cover all code paths when
    making changes. The long and complex function also makes it hard to
    establish through analysis alone that a patch has no unintended
    side-effects.
    
    Add code coverage through kunit regression testing. Introduce kunit
    infrastructure for tests under net/core, and add this first test.
    
    This first skb_segment test exercises a simple case: a linear skb.
    Follow-on patches will parametrize the test and add more variants.
    
    Tested: Built and ran the test with
    
        make ARCH=um mrproper
    
        ./tools/testing/kunit/kunit.py run \
            --kconfig_add CONFIG_NET=y \
            --kconfig_add CONFIG_DEBUG_KERNEL=y \
            --kconfig_add CONFIG_DEBUG_INFO=y \
            --kconfig_add=CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y \
            net_core_gso
    Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
    Reviewed-by: default avatarFlorian Westphal <fw@strlen.de>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    b3098d32
Makefile 1.52 KB