net: enetc: recycle buffers for frames with RX errors
When receiving a frame with errors, currently we do nothing with it (we don't construct an skb or an xdp_buff), we just exit the NAPI poll loop. Let's put the buffer back into the RX ring (similar to XDP_DROP). Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6b04830d5e
commit
672f9a2198
1 changed files with 2 additions and 0 deletions
|
|
@ -822,12 +822,14 @@ static bool enetc_check_bd_errors_and_consume(struct enetc_bdr *rx_ring,
|
|||
if (likely(!(bd_status & ENETC_RXBD_LSTATUS(ENETC_RXBD_ERR_MASK))))
|
||||
return false;
|
||||
|
||||
enetc_put_rx_buff(rx_ring, &rx_ring->rx_swbd[*i]);
|
||||
enetc_rxbd_next(rx_ring, rxbd, i);
|
||||
|
||||
while (!(bd_status & ENETC_RXBD_LSTATUS_F)) {
|
||||
dma_rmb();
|
||||
bd_status = le32_to_cpu((*rxbd)->r.lstatus);
|
||||
|
||||
enetc_put_rx_buff(rx_ring, &rx_ring->rx_swbd[*i]);
|
||||
enetc_rxbd_next(rx_ring, rxbd, i);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue