Commit 1b746ce8 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by David S. Miller

net: stmmac: don't overwrite discard_frame status

If we have error bits set, the discard_frame status will get overwritten
by checksum bit checks, which might set the status back to good one.
Fix by checking the COE status only if the frame is good.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 07b39753
...@@ -231,9 +231,10 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x, ...@@ -231,9 +231,10 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x,
* It doesn't match with the information reported into the databook. * It doesn't match with the information reported into the databook.
* At any rate, we need to understand if the CSUM hw computation is ok * At any rate, we need to understand if the CSUM hw computation is ok
* and report this info to the upper layers. */ * and report this info to the upper layers. */
ret = enh_desc_coe_rdes0(!!(rdes0 & RDES0_IPC_CSUM_ERROR), if (likely(ret == good_frame))
!!(rdes0 & RDES0_FRAME_TYPE), ret = enh_desc_coe_rdes0(!!(rdes0 & RDES0_IPC_CSUM_ERROR),
!!(rdes0 & ERDES0_RX_MAC_ADDR)); !!(rdes0 & RDES0_FRAME_TYPE),
!!(rdes0 & ERDES0_RX_MAC_ADDR));
if (unlikely(rdes0 & RDES0_DRIBBLING)) if (unlikely(rdes0 & RDES0_DRIBBLING))
x->dribbling_bit++; x->dribbling_bit++;
......
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