altera_tse: Correct rx packet length
Subsystems (3)
PATCH 1/1 altera_tse: Correct rx packet length
From: Vlastimil Setka <[email protected]>
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.
--- drivers/net/ethernet/altera/altera_tse_main.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/altera/altera_tse_main.c +6 -0
@@ -391,6 +391,12 @@ static int tse_rx(struct altera_tse_private *priv, int limit)"RCV pktstatus %08X pktlength %08X\n" , pktstatus, pktlength); +/* DMA trasfer from TSE starts with 2 aditional bytes for +* IP payload alignment. Status returned by get_rx_status() +* contains DMA transfer length. Packet is 2 bytes shorter. +*/ + pktlength -=2 ; + count++; next_entry = (++priv->rx_cons) % priv->rx_ring_size;
Signature · 1 line
1.8.1.2
From: Vlastimil Setka <[email protected]>
Date: Wed, 29 Apr 2015 00:17:11 +0200
Quoted 8 lines
From: Vlastimil Setka <[email protected]>
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 <[email protected]>
Applied, thank you.