summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/altera
diff options
context:
space:
mode:
authorVlastimil Setka <setka@vsis.cz>2015-04-29 00:17:11 +0200
committerDavid S. Miller <davem@davemloft.net>2015-04-29 15:19:34 -0400
commit48734994ac268eb391a66dca4cde7d08a08aba08 (patch)
tree0d121b78c92a711a9144282e23ad7d0f61eca1b2 /drivers/net/ethernet/altera
parent42eab005a5dd5d7ea2b0328aecc4d6cc0c23c9c2 (diff)
downloadop-kernel-dev-48734994ac268eb391a66dca4cde7d08a08aba08.zip
op-kernel-dev-48734994ac268eb391a66dca4cde7d08a08aba08.tar.gz
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>
Diffstat (limited to 'drivers/net/ethernet/altera')
-rw-r--r--drivers/net/ethernet/altera/altera_tse_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index 0533c05..da48e66 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -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;
OpenPOWER on IntegriCloud