diff mbox series

[net] net: broadcom: bcm4908_enet: enable RX after processing packets

Message ID 20210226132038.29849-1-zajec5@gmail.com (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series [net] net: broadcom: bcm4908_enet: enable RX after processing packets | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Rafał Miłecki Feb. 26, 2021, 1:20 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

When receiving a lot of packets hardware may run out of free
descriptiors and stop RX ring. Enable it every time after handling
received packets.

Fixes: 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controller driver")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/net/ethernet/broadcom/bcm4908_enet.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Florian Fainelli Feb. 27, 2021, 4:38 p.m. UTC | #1
On 2/26/2021 5:20 AM, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> When receiving a lot of packets hardware may run out of free
> descriptiors and stop RX ring. Enable it every time after handling
> received packets.
> 
> Fixes: 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controller driver")
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Jakub Kicinski Feb. 28, 2021, 7:54 p.m. UTC | #2
On Sat, 27 Feb 2021 08:38:24 -0800 Florian Fainelli wrote:
> On 2/26/2021 5:20 AM, Rafał Miłecki wrote:
> > From: Rafał Miłecki <rafal@milecki.pl>
> > 
> > When receiving a lot of packets hardware may run out of free
> > descriptiors and stop RX ring. Enable it every time after handling
> > received packets.
> > 
> > Fixes: 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controller driver")
> > Signed-off-by: Rafał Miłecki <rafal@milecki.pl>  
> 
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>

Applied, thanks!

Out of curiosity - is the performance not impacted by this change?
bcm4908_enet_dma_rx_ring_enable() does an RMW, the read could possibly
removed by caching the expected value.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bcm4908_enet.c b/drivers/net/ethernet/broadcom/bcm4908_enet.c
index 0b70e9e0ddad..98cf82dea3e4 100644
--- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
@@ -592,6 +592,9 @@  static int bcm4908_enet_poll(struct napi_struct *napi, int weight)
 		bcm4908_enet_intrs_on(enet);
 	}
 
+	/* Hardware could disable ring if it run out of descriptors */
+	bcm4908_enet_dma_rx_ring_enable(enet, &enet->rx_ring);
+
 	return handled;
 }