summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2022-09-16 12:12:58 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-09-16 14:06:10 +0200
commit7f80775e27ee889e34eef6acaf67073a29fcd668 (patch)
tree6f63a2b744d2a3a63f7762a2479074691d798738
parent6a48a8b3c9e994cd6008d5825879b296784944cc (diff)
downloadbarebox-7f80775e27ee889e34eef6acaf67073a29fcd668.tar.gz
barebox-7f80775e27ee889e34eef6acaf67073a29fcd668.tar.xz
net: Use dma_alloc to allocate net packet
network packets are often DMAed by the network drivers, so allocate them with dma_alloc() rather than assuming that an arbitrarily chosen alignment is sufficient This fixes network transfers on a Rockchip RK3568 board which occasionally sent out packets with corrupt data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--include/net.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net.h b/include/net.h
index b50b6e76c8..310bf5169d 100644
--- a/include/net.h
+++ b/include/net.h
@@ -19,6 +19,7 @@
#include <stdlib.h>
#include <clock.h>
#include <led.h>
+#include <dma.h>
#include <slice.h>
#include <xfuncs.h>
#include <linux/phy.h>
@@ -470,7 +471,7 @@ struct net_connection {
static inline char *net_alloc_packet(void)
{
- return xmemalign(32, PKTSIZE);
+ return dma_alloc(PKTSIZE);
}
struct net_connection *net_udp_new(IPaddr_t dest, uint16_t dport,