[openwrt/openwrt] realtek: RTL93xx: do not drop packets in software
LEDE Commits
lede-commits at lists.infradead.org
Sun Sep 7 02:36:07 PDT 2025
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e3ccd1a287f59ffe0617efe44edd88dfa212f3d0
commit e3ccd1a287f59ffe0617efe44edd88dfa212f3d0
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Fri Sep 5 02:33:56 2025 -0400
realtek: RTL93xx: do not drop packets in software
Now that the counter registers work fine there is no need to
free buffers in software. Hardware will automatically block
input processing when software processing is too slow.
Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19960
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
.../files-6.12/drivers/net/ethernet/rtl838x_eth.c | 34 ----------------------
1 file changed, 34 deletions(-)
diff --git a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
index 8b30ebcd85..1ed3718cb3 100644
--- a/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
@@ -331,39 +331,6 @@ static bool rtl931x_decode_tag(struct p_hdr *h, struct dsa_tag *t)
return t->l2_offloaded;
}
-/* Discard the RX ring-buffers, called as part of the net-ISR
- * when the buffer runs over
- */
-static void rtl838x_rb_cleanup(struct rtl838x_eth_priv *priv, int status)
-{
- for (int r = 0; r < priv->rxrings; r++) {
- struct ring_b *ring = priv->membase;
- struct p_hdr *h;
- u32 *last;
-
- pr_debug("In %s working on r: %d\n", __func__, r);
- last = (u32 *)KSEG1ADDR(sw_r32(priv->r->dma_if_rx_cur + r * 4));
- do {
- if ((ring->rx_r[r][ring->c_rx[r]] & 0x1))
- break;
- pr_debug("Got something: %d\n", ring->c_rx[r]);
- h = &ring->rx_header[r][ring->c_rx[r]];
- memset(h, 0, sizeof(struct p_hdr));
- h->buf = (u8 *)KSEG1ADDR(ring->rx_space +
- r * priv->rxringlen * RING_BUFFER +
- ring->c_rx[r] * RING_BUFFER);
- h->size = RING_BUFFER;
- /* make sure the header is visible to the ASIC */
- mb();
-
- ring->rx_r[r][ring->c_rx[r]] = KSEG1ADDR(h) | 0x1 | (ring->c_rx[r] == (priv->rxringlen - 1) ?
- WRAP :
- 0x1);
- ring->c_rx[r] = (ring->c_rx[r] + 1) % priv->rxringlen;
- } while (&ring->rx_r[r][ring->c_rx[r]] != last);
- }
-}
-
struct fdb_update_work {
struct work_struct work;
struct net_device *ndev;
@@ -497,7 +464,6 @@ static irqreturn_t rtl93xx_net_irq(int irq, void *dev_id)
pr_debug("RX buffer overrun: status %x, mask: %x\n",
status_rx_r, sw_r32(priv->r->dma_if_intr_rx_runout_msk));
sw_w32(status_rx_r, priv->r->dma_if_intr_rx_runout_sts);
- rtl838x_rb_cleanup(priv, status_rx_r);
}
return IRQ_HANDLED;
More information about the lede-commits
mailing list