Skip to content

Commit

Permalink
net: stmmac: xgmac: Correctly return that RX descriptor is not last one
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jose Abreu authored and David S. Miller committed Aug 17, 2019
1 parent ec22200 commit c887e02
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c887e02

Please sign in to comment.