Skip to content

Commit ca23cb0

Browse files
svenauhagendavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 06ec313 commit ca23cb0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/marvell/mvneta.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@
324324
ETH_HLEN + ETH_FCS_LEN, \
325325
cache_line_size())
326326

327-
#define MVNETA_SKB_HEADROOM max(XDP_PACKET_HEADROOM, NET_SKB_PAD)
327+
/* Driver assumes that the last 3 bits are 0 */
328+
#define MVNETA_SKB_HEADROOM (max(XDP_PACKET_HEADROOM, NET_SKB_PAD) & ~0x7)
328329
#define MVNETA_SKB_PAD (SKB_DATA_ALIGN(sizeof(struct skb_shared_info) + \
329330
MVNETA_SKB_HEADROOM))
330331
#define MVNETA_SKB_SIZE(len) (SKB_DATA_ALIGN(len) + MVNETA_SKB_PAD)

0 commit comments

Comments
 (0)