From: Mario Six Date: Wed, 28 Mar 2018 12:38:49 +0000 (+0200) Subject: net: Always align tx packets X-Git-Tag: v2018.07-rc2~51^2~18 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2d8f25ed7b3626930b9fc950b20a1ec0be7abbe9;p=u-boot net: Always align tx packets Make sure that TX packets are always cache-aligned. Signed-off-by: Mario Six Acked-by: Joe Hershberger --- diff --git a/net/arp.c b/net/arp.c index 990b771c92..b8a71684cd 100644 --- a/net/arp.c +++ b/net/arp.c @@ -182,7 +182,8 @@ void arp_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) (net_read_ip(&arp->ar_spa).s_addr & net_netmask.s_addr)) udelay(5000); #endif - net_send_packet((uchar *)et, eth_hdr_size + ARP_HDR_SIZE); + memcpy(net_tx_packet, et, eth_hdr_size + ARP_HDR_SIZE); + net_send_packet(net_tx_packet, eth_hdr_size + ARP_HDR_SIZE); return; case ARPOP_REPLY: /* arp reply */ diff --git a/net/ping.c b/net/ping.c index 5464f2f785..3e5461a36a 100644 --- a/net/ping.c +++ b/net/ping.c @@ -107,7 +107,8 @@ void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) icmph->type = ICMP_ECHO_REPLY; icmph->checksum = 0; icmph->checksum = compute_ip_checksum(icmph, len - IP_HDR_SIZE); - net_send_packet((uchar *)et, eth_hdr_size + len); + memcpy(net_tx_packet, et, eth_hdr_size + len); + net_send_packet(net_tx_packet, eth_hdr_size + len); return; /* default: return;*/