Commit 1cc5a735 authored by Giuseppe CAVALLARO's avatar Giuseppe CAVALLARO Committed by David S. Miller

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: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 72ba009b
...@@ -67,6 +67,7 @@ struct stmmac_extra_stats { ...@@ -67,6 +67,7 @@ struct stmmac_extra_stats {
unsigned long ipc_csum_error; unsigned long ipc_csum_error;
unsigned long rx_collision; unsigned long rx_collision;
unsigned long rx_crc; unsigned long rx_crc;
unsigned long dribbling_bit;
unsigned long rx_length; unsigned long rx_length;
unsigned long rx_mii; unsigned long rx_mii;
unsigned long rx_multicast; unsigned long rx_multicast;
......
...@@ -201,7 +201,7 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x, ...@@ -201,7 +201,7 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x,
if (unlikely(p->des01.erx.dribbling)) { if (unlikely(p->des01.erx.dribbling)) {
CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n"); CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n");
ret = discard_frame; x->dribbling_bit++;
} }
if (unlikely(p->des01.erx.sa_filter_fail)) { if (unlikely(p->des01.erx.sa_filter_fail)) {
CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n"); CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n");
......
...@@ -104,7 +104,7 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x, ...@@ -104,7 +104,7 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x,
ret = discard_frame; ret = discard_frame;
} }
if (unlikely(p->des01.rx.dribbling)) if (unlikely(p->des01.rx.dribbling))
ret = discard_frame; x->dribbling_bit++;
if (unlikely(p->des01.rx.length_error)) { if (unlikely(p->des01.rx.length_error)) {
x->rx_length++; x->rx_length++;
......
...@@ -47,23 +47,25 @@ struct stmmac_stats { ...@@ -47,23 +47,25 @@ struct stmmac_stats {
offsetof(struct stmmac_priv, xstats.m)} offsetof(struct stmmac_priv, xstats.m)}
static const struct stmmac_stats stmmac_gstrings_stats[] = { static const struct stmmac_stats stmmac_gstrings_stats[] = {
/* Transmit errors */
STMMAC_STAT(tx_underflow), STMMAC_STAT(tx_underflow),
STMMAC_STAT(tx_carrier), STMMAC_STAT(tx_carrier),
STMMAC_STAT(tx_losscarrier), STMMAC_STAT(tx_losscarrier),
STMMAC_STAT(vlan_tag), STMMAC_STAT(vlan_tag),
STMMAC_STAT(tx_deferred), STMMAC_STAT(tx_deferred),
STMMAC_STAT(tx_vlan), STMMAC_STAT(tx_vlan),
STMMAC_STAT(rx_vlan),
STMMAC_STAT(tx_jabber), STMMAC_STAT(tx_jabber),
STMMAC_STAT(tx_frame_flushed), STMMAC_STAT(tx_frame_flushed),
STMMAC_STAT(tx_payload_error), STMMAC_STAT(tx_payload_error),
STMMAC_STAT(tx_ip_header_error), STMMAC_STAT(tx_ip_header_error),
/* Receive errors */
STMMAC_STAT(rx_desc), STMMAC_STAT(rx_desc),
STMMAC_STAT(sa_filter_fail), STMMAC_STAT(sa_filter_fail),
STMMAC_STAT(overflow_error), STMMAC_STAT(overflow_error),
STMMAC_STAT(ipc_csum_error), STMMAC_STAT(ipc_csum_error),
STMMAC_STAT(rx_collision), STMMAC_STAT(rx_collision),
STMMAC_STAT(rx_crc), STMMAC_STAT(rx_crc),
STMMAC_STAT(dribbling_bit),
STMMAC_STAT(rx_length), STMMAC_STAT(rx_length),
STMMAC_STAT(rx_mii), STMMAC_STAT(rx_mii),
STMMAC_STAT(rx_multicast), STMMAC_STAT(rx_multicast),
...@@ -73,6 +75,8 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = { ...@@ -73,6 +75,8 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = {
STMMAC_STAT(sa_rx_filter_fail), STMMAC_STAT(sa_rx_filter_fail),
STMMAC_STAT(rx_missed_cntr), STMMAC_STAT(rx_missed_cntr),
STMMAC_STAT(rx_overflow_cntr), STMMAC_STAT(rx_overflow_cntr),
STMMAC_STAT(rx_vlan),
/* Tx/Rx IRQ errors */
STMMAC_STAT(tx_undeflow_irq), STMMAC_STAT(tx_undeflow_irq),
STMMAC_STAT(tx_process_stopped_irq), STMMAC_STAT(tx_process_stopped_irq),
STMMAC_STAT(tx_jabber_irq), STMMAC_STAT(tx_jabber_irq),
...@@ -82,6 +86,7 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = { ...@@ -82,6 +86,7 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = {
STMMAC_STAT(rx_watchdog_irq), STMMAC_STAT(rx_watchdog_irq),
STMMAC_STAT(tx_early_irq), STMMAC_STAT(tx_early_irq),
STMMAC_STAT(fatal_bus_error_irq), STMMAC_STAT(fatal_bus_error_irq),
/* Extra info */
STMMAC_STAT(threshold), STMMAC_STAT(threshold),
STMMAC_STAT(tx_pkt_n), STMMAC_STAT(tx_pkt_n),
STMMAC_STAT(rx_pkt_n), STMMAC_STAT(rx_pkt_n),
......
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