Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

altera_tse: Correct rx packet length

Altera TSE MAC rx DMA transfer starts with the 2 additional bytes for IP
payload alignment. This patch fixes tse_rx() function loop which reads DMA
rx status and extracts packet length from it. Status signalises a whole DMA
transfer length, which is 2 bytes longer than the packet itself.

Signed-off-by: Vlastimil Setka <setka@vsis.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Vlastimil Setka and committed by
David S. Miller
48734994 42eab005

+6
+6
drivers/net/ethernet/altera/altera_tse_main.c
··· 391 391 "RCV pktstatus %08X pktlength %08X\n", 392 392 pktstatus, pktlength); 393 393 394 + /* DMA trasfer from TSE starts with 2 aditional bytes for 395 + * IP payload alignment. Status returned by get_rx_status() 396 + * contains DMA transfer length. Packet is 2 bytes shorter. 397 + */ 398 + pktlength -= 2; 399 + 394 400 count++; 395 401 next_entry = (++priv->rx_cons) % priv->rx_ring_size; 396 402