Commit 6af29a96 authored by Daniel Hellstrom's avatar Daniel Hellstrom Committed by David S. Miller

GRETH: RX/TX bytes were never increased

Signed-off-by: default avatarDaniel Hellstrom <daniel@gaisler.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8603e33d
...@@ -428,6 +428,7 @@ greth_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -428,6 +428,7 @@ greth_start_xmit(struct sk_buff *skb, struct net_device *dev)
dma_sync_single_for_device(greth->dev, dma_addr, skb->len, DMA_TO_DEVICE); dma_sync_single_for_device(greth->dev, dma_addr, skb->len, DMA_TO_DEVICE);
status = GRETH_BD_EN | GRETH_BD_IE | (skb->len & GRETH_BD_LEN); status = GRETH_BD_EN | GRETH_BD_IE | (skb->len & GRETH_BD_LEN);
greth->tx_bufs_length[greth->tx_next] = skb->len & GRETH_BD_LEN;
/* Wrap around descriptor ring */ /* Wrap around descriptor ring */
if (greth->tx_next == GRETH_TXBD_NUM_MASK) { if (greth->tx_next == GRETH_TXBD_NUM_MASK) {
...@@ -641,6 +642,7 @@ static void greth_clean_tx(struct net_device *dev) ...@@ -641,6 +642,7 @@ static void greth_clean_tx(struct net_device *dev)
dev->stats.tx_fifo_errors++; dev->stats.tx_fifo_errors++;
} }
dev->stats.tx_packets++; dev->stats.tx_packets++;
dev->stats.tx_bytes += greth->tx_bufs_length[greth->tx_last];
greth->tx_last = NEXT_TX(greth->tx_last); greth->tx_last = NEXT_TX(greth->tx_last);
greth->tx_free++; greth->tx_free++;
} }
...@@ -695,6 +697,7 @@ static void greth_clean_tx_gbit(struct net_device *dev) ...@@ -695,6 +697,7 @@ static void greth_clean_tx_gbit(struct net_device *dev)
greth->tx_skbuff[greth->tx_last] = NULL; greth->tx_skbuff[greth->tx_last] = NULL;
greth_update_tx_stats(dev, stat); greth_update_tx_stats(dev, stat);
dev->stats.tx_bytes += skb->len;
bdp = greth->tx_bd_base + greth->tx_last; bdp = greth->tx_bd_base + greth->tx_last;
...@@ -796,6 +799,7 @@ static int greth_rx(struct net_device *dev, int limit) ...@@ -796,6 +799,7 @@ static int greth_rx(struct net_device *dev, int limit)
memcpy(skb_put(skb, pkt_len), phys_to_virt(dma_addr), pkt_len); memcpy(skb_put(skb, pkt_len), phys_to_virt(dma_addr), pkt_len);
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
dev->stats.rx_bytes += pkt_len;
dev->stats.rx_packets++; dev->stats.rx_packets++;
netif_receive_skb(skb); netif_receive_skb(skb);
} }
...@@ -910,6 +914,7 @@ static int greth_rx_gbit(struct net_device *dev, int limit) ...@@ -910,6 +914,7 @@ static int greth_rx_gbit(struct net_device *dev, int limit)
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
dev->stats.rx_packets++; dev->stats.rx_packets++;
dev->stats.rx_bytes += pkt_len;
netif_receive_skb(skb); netif_receive_skb(skb);
greth->rx_skbuff[greth->rx_cur] = newskb; greth->rx_skbuff[greth->rx_cur] = newskb;
......
...@@ -103,6 +103,7 @@ struct greth_private { ...@@ -103,6 +103,7 @@ struct greth_private {
unsigned char *tx_bufs[GRETH_TXBD_NUM]; unsigned char *tx_bufs[GRETH_TXBD_NUM];
unsigned char *rx_bufs[GRETH_RXBD_NUM]; unsigned char *rx_bufs[GRETH_RXBD_NUM];
u16 tx_bufs_length[GRETH_TXBD_NUM];
u16 tx_next; u16 tx_next;
u16 tx_last; u16 tx_last;
......
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