OSDN Git Service

ixgbe: Add support for maximum headroom when using build_skb
authorAlexander Duyck <alexander.h.duyck@intel.com>
Thu, 2 Mar 2017 23:01:05 +0000 (15:01 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 18 Apr 2017 20:32:45 +0000 (13:32 -0700)
commit541ea69a909739229962ef2c762074550a56fc0c
tree213d4717a96f114749f4cb11f34a4457a5ca93a7
parentf4a6374ba46132896154397ce3c559ccb0d15e60
ixgbe: Add support for maximum headroom when using build_skb

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: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe.h
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c