diff options
author | Giuseppe CAVALLARO <peppe.cavallaro@st.com> | 2012-02-14 19:10:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-15 14:52:10 -0500 |
commit | 1cc5a735185a963ed9324a65e1f2db02bf52c0d4 (patch) | |
tree | 5e280cb7f6626080ab4ab8e2be01841fbaf6c4f6 /drivers/net/ethernet | |
parent | 72ba009b8a159e995e40d3b4e5d7d265acead983 (diff) |
stmmac: do not discard frame on dribbling bit assert
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>
Diffstat (limited to 'drivers/net/ethernet')
4 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h index d0b814ef0675..0319d640f728 100644 --- a/drivers/net/ethernet/stmicro/stmmac/common.h +++ b/drivers/net/ethernet/stmicro/stmmac/common.h | |||
@@ -67,6 +67,7 @@ struct stmmac_extra_stats { | |||
67 | unsigned long ipc_csum_error; | 67 | unsigned long ipc_csum_error; |
68 | unsigned long rx_collision; | 68 | unsigned long rx_collision; |
69 | unsigned long rx_crc; | 69 | unsigned long rx_crc; |
70 | unsigned long dribbling_bit; | ||
70 | unsigned long rx_length; | 71 | unsigned long rx_length; |
71 | unsigned long rx_mii; | 72 | unsigned long rx_mii; |
72 | unsigned long rx_multicast; | 73 | unsigned long rx_multicast; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c index d87976364ec5..ad1b627f8ec2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c +++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c | |||
@@ -201,7 +201,7 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x, | |||
201 | 201 | ||
202 | if (unlikely(p->des01.erx.dribbling)) { | 202 | if (unlikely(p->des01.erx.dribbling)) { |
203 | CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n"); | 203 | CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n"); |
204 | ret = discard_frame; | 204 | x->dribbling_bit++; |
205 | } | 205 | } |
206 | if (unlikely(p->des01.erx.sa_filter_fail)) { | 206 | if (unlikely(p->des01.erx.sa_filter_fail)) { |
207 | CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n"); | 207 | CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n"); |
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c index fda5d2b31d3a..25953bb45a73 100644 --- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c +++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c | |||
@@ -104,7 +104,7 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x, | |||
104 | ret = discard_frame; | 104 | ret = discard_frame; |
105 | } | 105 | } |
106 | if (unlikely(p->des01.rx.dribbling)) | 106 | if (unlikely(p->des01.rx.dribbling)) |
107 | ret = discard_frame; | 107 | x->dribbling_bit++; |
108 | 108 | ||
109 | if (unlikely(p->des01.rx.length_error)) { | 109 | if (unlikely(p->des01.rx.length_error)) { |
110 | x->rx_length++; | 110 | x->rx_length++; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index 9573303a706b..f98e1511660f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | |||
@@ -47,23 +47,25 @@ struct stmmac_stats { | |||
47 | offsetof(struct stmmac_priv, xstats.m)} | 47 | offsetof(struct stmmac_priv, xstats.m)} |
48 | 48 | ||
49 | static const struct stmmac_stats stmmac_gstrings_stats[] = { | 49 | static const struct stmmac_stats stmmac_gstrings_stats[] = { |
50 | /* Transmit errors */ | ||
50 | STMMAC_STAT(tx_underflow), | 51 | STMMAC_STAT(tx_underflow), |
51 | STMMAC_STAT(tx_carrier), | 52 | STMMAC_STAT(tx_carrier), |
52 | STMMAC_STAT(tx_losscarrier), | 53 | STMMAC_STAT(tx_losscarrier), |
53 | STMMAC_STAT(vlan_tag), | 54 | STMMAC_STAT(vlan_tag), |
54 | STMMAC_STAT(tx_deferred), | 55 | STMMAC_STAT(tx_deferred), |
55 | STMMAC_STAT(tx_vlan), | 56 | STMMAC_STAT(tx_vlan), |
56 | STMMAC_STAT(rx_vlan), | ||
57 | STMMAC_STAT(tx_jabber), | 57 | STMMAC_STAT(tx_jabber), |
58 | STMMAC_STAT(tx_frame_flushed), | 58 | STMMAC_STAT(tx_frame_flushed), |
59 | STMMAC_STAT(tx_payload_error), | 59 | STMMAC_STAT(tx_payload_error), |
60 | STMMAC_STAT(tx_ip_header_error), | 60 | STMMAC_STAT(tx_ip_header_error), |
61 | /* Receive errors */ | ||
61 | STMMAC_STAT(rx_desc), | 62 | STMMAC_STAT(rx_desc), |
62 | STMMAC_STAT(sa_filter_fail), | 63 | STMMAC_STAT(sa_filter_fail), |
63 | STMMAC_STAT(overflow_error), | 64 | STMMAC_STAT(overflow_error), |
64 | STMMAC_STAT(ipc_csum_error), | 65 | STMMAC_STAT(ipc_csum_error), |
65 | STMMAC_STAT(rx_collision), | 66 | STMMAC_STAT(rx_collision), |
66 | STMMAC_STAT(rx_crc), | 67 | STMMAC_STAT(rx_crc), |
68 | STMMAC_STAT(dribbling_bit), | ||
67 | STMMAC_STAT(rx_length), | 69 | STMMAC_STAT(rx_length), |
68 | STMMAC_STAT(rx_mii), | 70 | STMMAC_STAT(rx_mii), |
69 | STMMAC_STAT(rx_multicast), | 71 | STMMAC_STAT(rx_multicast), |
@@ -73,6 +75,8 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = { | |||
73 | STMMAC_STAT(sa_rx_filter_fail), | 75 | STMMAC_STAT(sa_rx_filter_fail), |
74 | STMMAC_STAT(rx_missed_cntr), | 76 | STMMAC_STAT(rx_missed_cntr), |
75 | STMMAC_STAT(rx_overflow_cntr), | 77 | STMMAC_STAT(rx_overflow_cntr), |
78 | STMMAC_STAT(rx_vlan), | ||
79 | /* Tx/Rx IRQ errors */ | ||
76 | STMMAC_STAT(tx_undeflow_irq), | 80 | STMMAC_STAT(tx_undeflow_irq), |
77 | STMMAC_STAT(tx_process_stopped_irq), | 81 | STMMAC_STAT(tx_process_stopped_irq), |
78 | STMMAC_STAT(tx_jabber_irq), | 82 | STMMAC_STAT(tx_jabber_irq), |
@@ -82,6 +86,7 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = { | |||
82 | STMMAC_STAT(rx_watchdog_irq), | 86 | STMMAC_STAT(rx_watchdog_irq), |
83 | STMMAC_STAT(tx_early_irq), | 87 | STMMAC_STAT(tx_early_irq), |
84 | STMMAC_STAT(fatal_bus_error_irq), | 88 | STMMAC_STAT(fatal_bus_error_irq), |
89 | /* Extra info */ | ||
85 | STMMAC_STAT(threshold), | 90 | STMMAC_STAT(threshold), |
86 | STMMAC_STAT(tx_pkt_n), | 91 | STMMAC_STAT(tx_pkt_n), |
87 | STMMAC_STAT(rx_pkt_n), | 92 | STMMAC_STAT(rx_pkt_n), |