linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: fec: only clear interrupt of handling queue in fec_enet_rx_queue()
@ 2021-12-06  9:05 Joakim Zhang
  2021-12-06 13:04 ` Andrew Lunn
  0 siblings, 1 reply; 3+ messages in thread
From: Joakim Zhang @ 2021-12-06  9:05 UTC (permalink / raw)
  To: davem, kuba, nicolas.diaz, rmk+kernel
  Cc: netdev, linux-kernel, linux-imx, andrew

Only clear interrupt of handling queue in fec_enet_rx_queue(), to avoid
missing packets caused by clear interrupt of other queues.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 09df434b2f87..eeefed3043ad 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1506,7 +1506,12 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)
 			break;
 		pkt_received++;
 
-		writel(FEC_ENET_RXF, fep->hwp + FEC_IEVENT);
+		if (queue_id == 0)
+			writel(FEC_ENET_RXF_0, fep->hwp + FEC_IEVENT);
+		else if (queue_id == 1)
+			writel(FEC_ENET_RXF_1, fep->hwp + FEC_IEVENT);
+		else
+			writel(FEC_ENET_RXF_2, fep->hwp + FEC_IEVENT);
 
 		/* Check for errors. */
 		status ^= BD_ENET_RX_LAST;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: fec: only clear interrupt of handling queue in fec_enet_rx_queue()
  2021-12-06  9:05 [PATCH] net: fec: only clear interrupt of handling queue in fec_enet_rx_queue() Joakim Zhang
@ 2021-12-06 13:04 ` Andrew Lunn
  2021-12-06 13:15   ` Joakim Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2021-12-06 13:04 UTC (permalink / raw)
  To: Joakim Zhang
  Cc: davem, kuba, nicolas.diaz, rmk+kernel, netdev, linux-kernel, linux-imx

On Mon, Dec 06, 2021 at 05:05:53PM +0800, Joakim Zhang wrote:
> Only clear interrupt of handling queue in fec_enet_rx_queue(), to avoid
> missing packets caused by clear interrupt of other queues.
> 
> Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> ---
>  drivers/net/ethernet/freescale/fec_main.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index 09df434b2f87..eeefed3043ad 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -1506,7 +1506,12 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)
>  			break;
>  		pkt_received++;
>  
> -		writel(FEC_ENET_RXF, fep->hwp + FEC_IEVENT);
> +		if (queue_id == 0)
> +			writel(FEC_ENET_RXF_0, fep->hwp + FEC_IEVENT);
> +		else if (queue_id == 1)
> +			writel(FEC_ENET_RXF_1, fep->hwp + FEC_IEVENT);
> +		else
> +			writel(FEC_ENET_RXF_2, fep->hwp + FEC_IEVENT);

The change itself seems find.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

But could it be moved out of the loop? If you have a budget of 64,
don't you clear this bit 64 times? Can you just clearing it once on
exit?

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] net: fec: only clear interrupt of handling queue in fec_enet_rx_queue()
  2021-12-06 13:04 ` Andrew Lunn
@ 2021-12-06 13:15   ` Joakim Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Joakim Zhang @ 2021-12-06 13:15 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: davem, kuba, Nicolas Diaz, rmk+kernel, netdev, linux-kernel,
	dl-linux-imx


Hi Andrew,

> -----Original Message-----
> From: Andrew Lunn <andrew@lunn.ch>
> Sent: 2021年12月6日 21:05
> To: Joakim Zhang <qiangqing.zhang@nxp.com>
> Cc: davem@davemloft.net; kuba@kernel.org; Nicolas Diaz
> <nicolas.diaz@nxp.com>; rmk+kernel@arm.linux.org.uk;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org; dl-linux-imx
> <linux-imx@nxp.com>
> Subject: Re: [PATCH] net: fec: only clear interrupt of handling queue in
> fec_enet_rx_queue()
> 
> On Mon, Dec 06, 2021 at 05:05:53PM +0800, Joakim Zhang wrote:
> > Only clear interrupt of handling queue in fec_enet_rx_queue(), to
> > avoid missing packets caused by clear interrupt of other queues.
> >
> > Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> > ---
> >  drivers/net/ethernet/freescale/fec_main.c | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/fec_main.c
> > b/drivers/net/ethernet/freescale/fec_main.c
> > index 09df434b2f87..eeefed3043ad 100644
> > --- a/drivers/net/ethernet/freescale/fec_main.c
> > +++ b/drivers/net/ethernet/freescale/fec_main.c
> > @@ -1506,7 +1506,12 @@ fec_enet_rx_queue(struct net_device *ndev,
> int budget, u16 queue_id)
> >  			break;
> >  		pkt_received++;
> >
> > -		writel(FEC_ENET_RXF, fep->hwp + FEC_IEVENT);
> > +		if (queue_id == 0)
> > +			writel(FEC_ENET_RXF_0, fep->hwp + FEC_IEVENT);
> > +		else if (queue_id == 1)
> > +			writel(FEC_ENET_RXF_1, fep->hwp + FEC_IEVENT);
> > +		else
> > +			writel(FEC_ENET_RXF_2, fep->hwp + FEC_IEVENT);
> 
> The change itself seems find.
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> 
> But could it be moved out of the loop? If you have a budget of 64, don't you
> clear this bit 64 times? Can you just clearing it once on exit?

Apologize first, I have a formal patch but send out the informal one, I will re-send later, sorry for inconvenience.

About you question, yes, we need to clear this bit each time, the blamed patch introduced to avoiding interrupt flooding.

>     Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-06 13:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06  9:05 [PATCH] net: fec: only clear interrupt of handling queue in fec_enet_rx_queue() Joakim Zhang
2021-12-06 13:04 ` Andrew Lunn
2021-12-06 13:15   ` Joakim Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).