Commit 48734994 authored by Vlastimil Setka's avatar Vlastimil Setka Committed by David S. Miller

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: default avatarVlastimil Setka <setka@vsis.cz>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 42eab005
...@@ -391,6 +391,12 @@ static int tse_rx(struct altera_tse_private *priv, int limit) ...@@ -391,6 +391,12 @@ static int tse_rx(struct altera_tse_private *priv, int limit)
"RCV pktstatus %08X pktlength %08X\n", "RCV pktstatus %08X pktlength %08X\n",
pktstatus, pktlength); 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++; count++;
next_entry = (++priv->rx_cons) % priv->rx_ring_size; next_entry = (++priv->rx_cons) % priv->rx_ring_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment