• Alexander Duyck's avatar
    ixgbe: Add support for maximum headroom when using build_skb · 541ea69a
    Alexander Duyck authored
    This patch increases the headroom allocated when using build_skb on a
    system with 4K pages.  Specifically the breakdown of headroom versus cache
    size is as follows:
        L1 Cache Size           Headroom
        64                      192
        64, NET_IP_ALIGN == 2   194
        128                     128
        128, NET_IP_ALIGN == 2  130
        256                     512
        256, NET_IP_ALIGN == 2  258
    
    I stopped at supporting only a cache line size of 256 as that was the
    largest cache size I could find supported in the kernel.
    
    With this we are guaranteeing at least 128 bytes of headroom to spare in
    the frame.  This should be enough for us to insert a couple of IPv6 headers
    if needed which is likely enough room for anything XDP should need.
    
    I'm leaving the padding for systems with pages larger than 4K unmodified
    for now.  XDP currently isn't really setup to work on those types of
    systems so we can cross that bridge when we get there.
    Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    541ea69a
ixgbe_main.c 284 KB