diff options
| author | Tim Harvey <[email protected]> | 2025-09-29 12:21:49 -0700 |
|---|---|---|
| committer | Jerome Forissier <[email protected]> | 2025-09-30 13:08:38 +0200 |
| commit | b2217c935e3f30d15821b1c5183ab4dd4c9d9dd2 (patch) | |
| tree | 20a5cf6382b26ab2b5a5e64cb716f02f975468f8 /net | |
| parent | 61a6f5ab99197c8b1233de0ac9861bcae3d9df05 (diff) | |
net: lwip: ensure alignment of packet buffers
Network packet buffers should be aligned to PKTALIGN. Add a compiler
attribute to ensure this.
Signed-off-by: Tim Harvey <[email protected]>
[jf: use __aligned(x) from <linux/compiler_attributes.h>]
Signed-off-by: Jerome Forissier <[email protected]>
Diffstat (limited to 'net')
| -rw-r--r-- | net/lwip/net-lwip.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c index 1a70cedfb58..8741f65fe12 100644 --- a/net/lwip/net-lwip.c +++ b/net/lwip/net-lwip.c @@ -7,6 +7,7 @@ #include <dm/device.h> #include <dm/uclass.h> #include <hexdump.h> +#include <linux/compiler_attributes.h> #include <linux/kernel.h> #include <lwip/ip4_addr.h> #include <lwip/dns.h> @@ -30,7 +31,8 @@ void (*push_packet)(void *, int len) = 0; int net_try_count; static int net_restarted; int net_restart_wrap; -static uchar net_pkt_buf[(PKTBUFSRX) * PKTSIZE_ALIGN + PKTALIGN]; +static uchar net_pkt_buf[(PKTBUFSRX) * PKTSIZE_ALIGN + PKTALIGN] + __aligned(PKTALIGN); uchar *net_rx_packets[PKTBUFSRX]; uchar *net_rx_packet; const u8 net_bcast_ethaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; |
