Skip to content
Snippets Groups Projects
Commit 2d8f25ed authored by Mario Six's avatar Mario Six Committed by Joe Hershberger
Browse files

net: Always align tx packets


Make sure that TX packets are always cache-aligned.

Signed-off-by: default avatarMario Six <mario.six@gdsys.cc>
Acked-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
parent acaee306
No related branches found
No related tags found
No related merge requests found
...@@ -182,7 +182,8 @@ void arp_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) ...@@ -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)) (net_read_ip(&arp->ar_spa).s_addr & net_netmask.s_addr))
udelay(5000); udelay(5000);
#endif #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; return;
case ARPOP_REPLY: /* arp reply */ case ARPOP_REPLY: /* arp reply */
......
...@@ -107,7 +107,8 @@ void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) ...@@ -107,7 +107,8 @@ void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len)
icmph->type = ICMP_ECHO_REPLY; icmph->type = ICMP_ECHO_REPLY;
icmph->checksum = 0; icmph->checksum = 0;
icmph->checksum = compute_ip_checksum(icmph, len - IP_HDR_SIZE); 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; return;
/* default: /* default:
return;*/ return;*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment