diff options
author | Sven Auhagen <sven.auhagen@voleatech.de> | 2020-05-23 12:14:08 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-25 17:50:01 -0700 |
commit | ca23cb0bc50faae0d48786b2f9f702dbb528b925 (patch) | |
tree | 09e551b1bee227ef9525122ceafedd9d3d060085 /drivers | |
parent | 06ec313eea4f7dcda209b7136618b802c5b30ef8 (diff) |
mvneta: MVNETA_SKB_HEADROOM set last 3 bits to zero
For XDP the MVNETA_SKB_HEADROOM is used as an offset for
the received data.
The MVNETA manual states that the last 3 bits assumed to be 0.
This is currently the case but lets make it explicit in the definition
to prevent future problems.
Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/marvell/mvneta.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 37947949345c..15e42a7f8a86 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -324,7 +324,8 @@ ETH_HLEN + ETH_FCS_LEN, \ cache_line_size()) -#define MVNETA_SKB_HEADROOM max(XDP_PACKET_HEADROOM, NET_SKB_PAD) +/* Driver assumes that the last 3 bits are 0 */ +#define MVNETA_SKB_HEADROOM (max(XDP_PACKET_HEADROOM, NET_SKB_PAD) & ~0x7) #define MVNETA_SKB_PAD (SKB_DATA_ALIGN(sizeof(struct skb_shared_info) + \ MVNETA_SKB_HEADROOM)) #define MVNETA_SKB_SIZE(len) (SKB_DATA_ALIGN(len) + MVNETA_SKB_PAD) |