struct axienet_local *lp = netdev_priv(ndev);
struct axidma_bd *cur_p;
unsigned int status = 0;
+ u32 size = 0;
+ u32 packets = 0;
cur_p = &lp->tx_bd_v[lp->tx_bd_ci];
status = cur_p->status;
cur_p->app4 = 0;
cur_p->status = 0;
- ndev->stats.tx_packets++;
- ndev->stats.tx_bytes += (status &
- XAXIDMA_BD_STS_ACTUAL_LEN_MASK);
+ size += status & XAXIDMA_BD_STS_ACTUAL_LEN_MASK;
+ packets++;
lp->tx_bd_ci = ++lp->tx_bd_ci % TX_BD_NUM;
status = cur_p->status;
}
+ ndev->stats.tx_packets += packets;
+ ndev->stats.tx_bytes += size;
+
netif_wake_queue(ndev);
}
dma_addr_t tail_p;
u32 length;
u32 csumstatus;
+ u32 size = 0;
+ u32 packets = 0;
tail_p = lp->rx_bd_p + sizeof(*lp->rx_bd_v) * lp->rx_bd_ci;
cur_p = &lp->rx_bd_v[lp->rx_bd_ci];
netif_rx(skb);
- ndev->stats.rx_packets++;
- ndev->stats.rx_bytes += length;
+ size += length;
+ packets++;
new_skb = netdev_alloc_skb_ip_align(ndev,
lp->max_frm_size);
cur_p = &lp->rx_bd_v[lp->rx_bd_ci];
}
+
+ ndev->stats.rx_packets += packets;
+ ndev->stats.rx_bytes += size;
+
axienet_dma_out32(lp, XAXIDMA_RX_TDESC_OFFSET, tail_p);
}