net: stmmac: xgmac: Correctly return that RX descriptor is not last one
authorJose Abreu <Jose.Abreu@synopsys.com>
Sat, 17 Aug 2019 18:54:42 +0000 (20:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 17 Aug 2019 19:43:59 +0000 (12:43 -0700)
Return the correct value when RX descriptor is not the last one.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c

index 58b69fa978378a3f9b4c2772c5790510eaff9256..2c1ed8c2a9d3acd0460afab593ba3c85503f6d88 100644 (file)
@@ -26,16 +26,15 @@ static int dwxgmac2_get_rx_status(void *data, struct stmmac_extra_stats *x,
                                  struct dma_desc *p)
 {
        unsigned int rdes3 = le32_to_cpu(p->des3);
-       int ret = good_frame;
 
        if (unlikely(rdes3 & XGMAC_RDES3_OWN))
                return dma_own;
        if (likely(!(rdes3 & XGMAC_RDES3_LD)))
+               return rx_not_ls;
+       if (unlikely((rdes3 & XGMAC_RDES3_ES) && (rdes3 & XGMAC_RDES3_LD)))
                return discard_frame;
-       if (unlikely(rdes3 & XGMAC_RDES3_ES))
-               ret = discard_frame;
 
-       return ret;
+       return good_frame;
 }
 
 static int dwxgmac2_get_tx_len(struct dma_desc *p)