stmmac: do not discard frame on dribbling bit assert
authorGiuseppe CAVALLARO <peppe.cavallaro@st.com>
Wed, 15 Feb 2012 00:10:37 +0000 (00:10 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Feb 2012 19:52:10 +0000 (14:52 -0500)
If this bit is set and the CRC error is reset, then the packet is valid.
Only report this as stat info.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/common.h
drivers/net/ethernet/stmicro/stmmac/enh_desc.c
drivers/net/ethernet/stmicro/stmmac/norm_desc.c
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

index d0b814ef0675396d56a1c5771f87ebe37689c09e..0319d640f72839cd47ad331718bc2ed2c6972539 100644 (file)
@@ -67,6 +67,7 @@ struct stmmac_extra_stats {
        unsigned long ipc_csum_error;
        unsigned long rx_collision;
        unsigned long rx_crc;
+       unsigned long dribbling_bit;
        unsigned long rx_length;
        unsigned long rx_mii;
        unsigned long rx_multicast;
index d87976364ec5a6a7a3bb1c4017917134abd1e74d..ad1b627f8ec2fe83607b6ef489f668825be645df 100644 (file)
@@ -201,7 +201,7 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x,
 
        if (unlikely(p->des01.erx.dribbling)) {
                CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n");
-               ret = discard_frame;
+               x->dribbling_bit++;
        }
        if (unlikely(p->des01.erx.sa_filter_fail)) {
                CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n");
index fda5d2b31d3ac5b139e9f5f2caf3b0c7d09123bb..25953bb45a736acdd517859b98c52850715765b8 100644 (file)
@@ -104,7 +104,7 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x,
                ret = discard_frame;
        }
        if (unlikely(p->des01.rx.dribbling))
-               ret = discard_frame;
+               x->dribbling_bit++;
 
        if (unlikely(p->des01.rx.length_error)) {
                x->rx_length++;
index 9573303a706b6ce882fac870ac50a4954dc2bad6..f98e1511660fe7c2136d345d7efa0bb12e05dec2 100644 (file)
@@ -47,23 +47,25 @@ struct stmmac_stats {
        offsetof(struct stmmac_priv, xstats.m)}
 
 static const struct stmmac_stats stmmac_gstrings_stats[] = {
+       /* Transmit errors */
        STMMAC_STAT(tx_underflow),
        STMMAC_STAT(tx_carrier),
        STMMAC_STAT(tx_losscarrier),
        STMMAC_STAT(vlan_tag),
        STMMAC_STAT(tx_deferred),
        STMMAC_STAT(tx_vlan),
-       STMMAC_STAT(rx_vlan),
        STMMAC_STAT(tx_jabber),
        STMMAC_STAT(tx_frame_flushed),
        STMMAC_STAT(tx_payload_error),
        STMMAC_STAT(tx_ip_header_error),
+       /* Receive errors */
        STMMAC_STAT(rx_desc),
        STMMAC_STAT(sa_filter_fail),
        STMMAC_STAT(overflow_error),
        STMMAC_STAT(ipc_csum_error),
        STMMAC_STAT(rx_collision),
        STMMAC_STAT(rx_crc),
+       STMMAC_STAT(dribbling_bit),
        STMMAC_STAT(rx_length),
        STMMAC_STAT(rx_mii),
        STMMAC_STAT(rx_multicast),
@@ -73,6 +75,8 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = {
        STMMAC_STAT(sa_rx_filter_fail),
        STMMAC_STAT(rx_missed_cntr),
        STMMAC_STAT(rx_overflow_cntr),
+       STMMAC_STAT(rx_vlan),
+       /* Tx/Rx IRQ errors */
        STMMAC_STAT(tx_undeflow_irq),
        STMMAC_STAT(tx_process_stopped_irq),
        STMMAC_STAT(tx_jabber_irq),
@@ -82,6 +86,7 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = {
        STMMAC_STAT(rx_watchdog_irq),
        STMMAC_STAT(tx_early_irq),
        STMMAC_STAT(fatal_bus_error_irq),
+       /* Extra info */
        STMMAC_STAT(threshold),
        STMMAC_STAT(tx_pkt_n),
        STMMAC_STAT(rx_pkt_n),