]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: provide 256 bytes of XDP headroom in all configurations
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 28 Apr 2017 04:06:20 +0000 (21:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 May 2017 02:37:00 +0000 (22:37 -0400)
commit3cc59d366f53ac56148a364e0a45bdf5eda0fc4c
tree603726e2646701fc1dfe5028226ee88efae578f1
parent587c4f9f32b19f51d4191b9a2f1fa44f1df90f72
nfp: provide 256 bytes of XDP headroom in all configurations

For legacy reasons NFP FW may be compiled to DMA packets to a constant
offset into the buffer and use the space before it for metadata.  This
ensures that packets data always start at a certain offset regardless of
the amount of preceding metadata.

If rx offset is set to 0 there may still be up to 64 bytes of metadata
but metadata will start at the beginning of the buffer, instead of:

    data_start_offset = rx_offset - meta_len

Even though we make the buffers larger to accommodate up to 64 bytes of
metadata, if there is only N bytes of metadata, we will end up with
N bytes of headroom and 64 - N bytes of tailroom.  Therefore we can't
rely on that space for XDP headroom.  Make sure we always allocate
full 256 bytes.  This, unfortunately, means we can't fit the headroom
on an u8 any more.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net.h
drivers/net/ethernet/netronome/nfp/nfp_net_common.c