Message ID | 20230206100837.451300-5-vladimir.oltean@nxp.com (mailing list archive) |
---|---|
State | RFC |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | NXP ENETC AF_XDP zero-copy sockets | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Clearly marked for net-next |
netdev/fixes_present | success | Fixes tag not required for -next series |
netdev/subject_prefix | success | Link |
netdev/cover_letter | success | Series has a cover letter |
netdev/patch_count | success | Link |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/cc_maintainers | success | CCed 7 of 7 maintainers |
netdev/build_clang | success | Errors and warnings before: 0 this patch: 0 |
netdev/module_param | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/check_selftest | success | No net selftest shell script |
netdev/verify_fixes | success | No Fixes tag |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 44 lines checked |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c index 4a81a23539fb..37d6ad0576e5 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.c +++ b/drivers/net/ethernet/freescale/enetc/enetc.c @@ -1121,12 +1121,14 @@ static void enetc_add_rx_buff_to_skb(struct enetc_bdr *rx_ring, int i, static bool enetc_check_bd_errors_and_consume(struct enetc_bdr *rx_ring, u32 bd_status, - union enetc_rx_bd **rxbd, int *i) + union enetc_rx_bd **rxbd, int *i, + int *buffs_missing) { if (likely(!(bd_status & ENETC_RXBD_LSTATUS(ENETC_RXBD_ERR_MASK)))) return false; enetc_put_rx_buff(rx_ring, &rx_ring->rx_swbd[*i]); + (*buffs_missing)++; enetc_rxbd_next(rx_ring, rxbd, i); while (!(bd_status & ENETC_RXBD_LSTATUS_F)) { @@ -1134,6 +1136,7 @@ static bool enetc_check_bd_errors_and_consume(struct enetc_bdr *rx_ring, bd_status = le32_to_cpu((*rxbd)->r.lstatus); enetc_put_rx_buff(rx_ring, &rx_ring->rx_swbd[*i]); + (*buffs_missing)++; enetc_rxbd_next(rx_ring, rxbd, i); } @@ -1215,8 +1218,9 @@ static int enetc_clean_rx_ring(struct enetc_bdr *rx_ring, dma_rmb(); /* for reading other rxbd fields */ if (enetc_check_bd_errors_and_consume(rx_ring, bd_status, - &rxbd, &i)) - break; + &rxbd, &i, + &buffs_missing)) + continue; skb = enetc_build_skb(rx_ring, bd_status, &rxbd, &i, &buffs_missing, ENETC_RXB_DMA_SIZE); @@ -1549,8 +1553,9 @@ static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring, dma_rmb(); /* for reading other rxbd fields */ if (enetc_check_bd_errors_and_consume(rx_ring, bd_status, - &rxbd, &i)) - break; + &rxbd, &i, + &buffs_missing)) + continue; orig_rxbd = rxbd; orig_buffs_missing = buffs_missing;
If we see frames with RX errors, consume them, mark their buffers for refill, and go through the rest of the ring until the NAPI budget is done. Right now we exit and ask the softirq to be rescheduled. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> --- drivers/net/ethernet/freescale/enetc/enetc.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)