summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
diff options
context:
space:
mode:
authorJie Deng <Jie.Deng1@synopsys.com>2017-04-12 13:10:06 +0800
committerDavid S. Miller <davem@davemloft.net>2017-04-13 13:46:38 -0400
commitd4d49bc145e830fdcfdcfba9ef4b7db5d0b1f8a7 (patch)
treefa3d2ca27451ad47a20d8e8d425e7ac23b570c5b /drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
parent7ed14d973f7c6742f4827fbbf6730cbe20888b8b (diff)
downloadlinux-d4d49bc145e830fdcfdcfba9ef4b7db5d0b1f8a7.tar.bz2
net: dwc-xlgmac: add the initial ethtool support
It is necessary to provide ethtool support for displaying and modifying parameters of dwc-xlgmac. Signed-off-by: Jie Deng <jiedeng@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/synopsys/dwc-xlgmac-net.c')
-rw-r--r--drivers/net/ethernet/synopsys/dwc-xlgmac-net.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-net.c b/drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
index 6acf86ced61d..3b91257683bc 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
@@ -290,19 +290,34 @@ static irqreturn_t xlgmac_isr(int irq, void *data)
/* Disable Tx and Rx interrupts */
xlgmac_disable_rx_tx_ints(pdata);
+ pdata->stats.napi_poll_isr++;
/* Turn on polling */
__napi_schedule_irqoff(&pdata->napi);
}
}
+ if (XLGMAC_GET_REG_BITS(dma_ch_isr, DMA_CH_SR_TPS_POS,
+ DMA_CH_SR_TPS_LEN))
+ pdata->stats.tx_process_stopped++;
+
+ if (XLGMAC_GET_REG_BITS(dma_ch_isr, DMA_CH_SR_RPS_POS,
+ DMA_CH_SR_RPS_LEN))
+ pdata->stats.rx_process_stopped++;
+
+ if (XLGMAC_GET_REG_BITS(dma_ch_isr, DMA_CH_SR_TBU_POS,
+ DMA_CH_SR_TBU_LEN))
+ pdata->stats.tx_buffer_unavailable++;
+
if (XLGMAC_GET_REG_BITS(dma_ch_isr, DMA_CH_SR_RBU_POS,
DMA_CH_SR_RBU_LEN))
pdata->stats.rx_buffer_unavailable++;
/* Restart the device on a Fatal Bus Error */
if (XLGMAC_GET_REG_BITS(dma_ch_isr, DMA_CH_SR_FBE_POS,
- DMA_CH_SR_FBE_LEN))
+ DMA_CH_SR_FBE_LEN)) {
+ pdata->stats.fatal_bus_error++;
schedule_work(&pdata->restart_work);
+ }
/* Clear all interrupt signals */
writel(dma_ch_isr, XLGMAC_DMA_REG(channel, DMA_CH_SR));
@@ -357,6 +372,7 @@ static void xlgmac_tx_timer(unsigned long data)
else
xlgmac_disable_rx_tx_ints(pdata);
+ pdata->stats.napi_poll_txtimer++;
/* Turn on polling */
__napi_schedule(napi);
}
@@ -1225,9 +1241,11 @@ read_again:
if (XLGMAC_GET_REG_BITS(pkt_info->attributes,
RX_PACKET_ATTRIBUTES_VLAN_CTAG_POS,
- RX_PACKET_ATTRIBUTES_VLAN_CTAG_LEN))
+ RX_PACKET_ATTRIBUTES_VLAN_CTAG_LEN)) {
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
pkt_info->vlan_ctag);
+ pdata->stats.rx_vlan_packets++;
+ }
if (XLGMAC_GET_REG_BITS(pkt_info->attributes,
RX_PACKET_ATTRIBUTES_RSS_HASH_POS,