All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* net: macb: can macb use __napi_schedule_irqoff() instead of __napi_schedule()
@ 2021-01-11 19:45 ` Paul Thomas
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Thomas @ 2021-01-11 19:45 UTC (permalink / raw)
  To: Nicolas Ferre, Claudiu Beznea, David S. Miller, Jakub Kicinski,
	Russell King, Palmer Dabbelt, Paul Walmsley, netdev, linux-kernel,
	linux-riscv

Hello, recently I was doing a lot of tracing/profiling to understand
an issue we were having. Anyway, during this I ran across
__napi_schedule_irqoff() where the comment in dev.c says "Variant of
__napi_schedule() assuming hard irqs are masked".

It looks like the queue_writel(queue, IDR, bp->rx_intr_mask); call
just before the __napi_schedule() call in macb_main.c is doing this
hard irq masking? So could it change to be like this?

--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -1616,7 +1623,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)

                        if (napi_schedule_prep(&queue->napi)) {
                                netdev_vdbg(bp->dev, "scheduling RX softirq\n");
-                               __napi_schedule(&queue->napi);
+                               __napi_schedule_irqoff(&queue->napi);
                        }
                }

-Paul

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* net: macb: can macb use __napi_schedule_irqoff() instead of __napi_schedule()
@ 2021-01-11 19:45 ` Paul Thomas
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Thomas @ 2021-01-11 19:45 UTC (permalink / raw)
  To: Nicolas Ferre, Claudiu Beznea, David S. Miller, Jakub Kicinski,
	Russell King, Palmer Dabbelt, Paul Walmsley, netdev, linux-kernel,
	linux-riscv

Hello, recently I was doing a lot of tracing/profiling to understand
an issue we were having. Anyway, during this I ran across
__napi_schedule_irqoff() where the comment in dev.c says "Variant of
__napi_schedule() assuming hard irqs are masked".

It looks like the queue_writel(queue, IDR, bp->rx_intr_mask); call
just before the __napi_schedule() call in macb_main.c is doing this
hard irq masking? So could it change to be like this?

--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -1616,7 +1623,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)

                        if (napi_schedule_prep(&queue->napi)) {
                                netdev_vdbg(bp->dev, "scheduling RX softirq\n");
-                               __napi_schedule(&queue->napi);
+                               __napi_schedule_irqoff(&queue->napi);
                        }
                }

-Paul

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

* Re: net: macb: can macb use __napi_schedule_irqoff() instead of __napi_schedule()
  2021-01-11 19:45 ` Paul Thomas
@ 2021-01-11 21:35   ` Heiner Kallweit
  -1 siblings, 0 replies; 6+ messages in thread
From: Heiner Kallweit @ 2021-01-11 21:35 UTC (permalink / raw)
  To: Paul Thomas, Nicolas Ferre, Claudiu Beznea, David S. Miller,
	Jakub Kicinski, Russell King, Palmer Dabbelt, Paul Walmsley,
	netdev, linux-kernel, linux-riscv

On 11.01.2021 20:45, Paul Thomas wrote:
> Hello, recently I was doing a lot of tracing/profiling to understand
> an issue we were having. Anyway, during this I ran across
> __napi_schedule_irqoff() where the comment in dev.c says "Variant of
> __napi_schedule() assuming hard irqs are masked".
> 
> It looks like the queue_writel(queue, IDR, bp->rx_intr_mask); call
> just before the __napi_schedule() call in macb_main.c is doing this
> hard irq masking? So could it change to be like this?
> 
It's unsafe under forced irq threading. There has been a number of
discussions about this topic in the past.

> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -1616,7 +1623,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
> 
>                         if (napi_schedule_prep(&queue->napi)) {
>                                 netdev_vdbg(bp->dev, "scheduling RX softirq\n");
> -                               __napi_schedule(&queue->napi);
> +                               __napi_schedule_irqoff(&queue->napi);
>                         }
>                 }
> 
> -Paul
> 


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: net: macb: can macb use __napi_schedule_irqoff() instead of __napi_schedule()
@ 2021-01-11 21:35   ` Heiner Kallweit
  0 siblings, 0 replies; 6+ messages in thread
From: Heiner Kallweit @ 2021-01-11 21:35 UTC (permalink / raw)
  To: Paul Thomas, Nicolas Ferre, Claudiu Beznea, David S. Miller,
	Jakub Kicinski, Russell King, Palmer Dabbelt, Paul Walmsley,
	netdev, linux-kernel, linux-riscv

On 11.01.2021 20:45, Paul Thomas wrote:
> Hello, recently I was doing a lot of tracing/profiling to understand
> an issue we were having. Anyway, during this I ran across
> __napi_schedule_irqoff() where the comment in dev.c says "Variant of
> __napi_schedule() assuming hard irqs are masked".
> 
> It looks like the queue_writel(queue, IDR, bp->rx_intr_mask); call
> just before the __napi_schedule() call in macb_main.c is doing this
> hard irq masking? So could it change to be like this?
> 
It's unsafe under forced irq threading. There has been a number of
discussions about this topic in the past.

> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -1616,7 +1623,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
> 
>                         if (napi_schedule_prep(&queue->napi)) {
>                                 netdev_vdbg(bp->dev, "scheduling RX softirq\n");
> -                               __napi_schedule(&queue->napi);
> +                               __napi_schedule_irqoff(&queue->napi);
>                         }
>                 }
> 
> -Paul
> 


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

* Re: net: macb: can macb use __napi_schedule_irqoff() instead of __napi_schedule()
  2021-01-11 21:35   ` Heiner Kallweit
@ 2021-01-11 22:09     ` Paul Thomas
  -1 siblings, 0 replies; 6+ messages in thread
From: Paul Thomas @ 2021-01-11 22:09 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: netdev, Russell King, Nicolas Ferre, Palmer Dabbelt,
	Paul Walmsley, Jakub Kicinski, linux-riscv, Claudiu Beznea,
	David S. Miller, linux-kernel

On Mon, Jan 11, 2021 at 4:35 PM Heiner Kallweit <hkallweit1@gmail.com> wrote:
>
> On 11.01.2021 20:45, Paul Thomas wrote:
> > Hello, recently I was doing a lot of tracing/profiling to understand
> > an issue we were having. Anyway, during this I ran across
> > __napi_schedule_irqoff() where the comment in dev.c says "Variant of
> > __napi_schedule() assuming hard irqs are masked".
> >
> > It looks like the queue_writel(queue, IDR, bp->rx_intr_mask); call
> > just before the __napi_schedule() call in macb_main.c is doing this
> > hard irq masking? So could it change to be like this?
> >
> It's unsafe under forced irq threading. There has been a number of
> discussions about this topic in the past.
OK thanks, and our use case is forced irq threading under PREEMPT_RT

-Paul

> > --- a/drivers/net/ethernet/cadence/macb_main.c
> > +++ b/drivers/net/ethernet/cadence/macb_main.c
> > @@ -1616,7 +1623,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
> >
> >                         if (napi_schedule_prep(&queue->napi)) {
> >                                 netdev_vdbg(bp->dev, "scheduling RX softirq\n");
> > -                               __napi_schedule(&queue->napi);
> > +                               __napi_schedule_irqoff(&queue->napi);
> >                         }
> >                 }
> >
> > -Paul
> >
>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: net: macb: can macb use __napi_schedule_irqoff() instead of __napi_schedule()
@ 2021-01-11 22:09     ` Paul Thomas
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Thomas @ 2021-01-11 22:09 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Nicolas Ferre, Claudiu Beznea, David S. Miller, Jakub Kicinski,
	Russell King, Palmer Dabbelt, Paul Walmsley, netdev, linux-kernel,
	linux-riscv

On Mon, Jan 11, 2021 at 4:35 PM Heiner Kallweit <hkallweit1@gmail.com> wrote:
>
> On 11.01.2021 20:45, Paul Thomas wrote:
> > Hello, recently I was doing a lot of tracing/profiling to understand
> > an issue we were having. Anyway, during this I ran across
> > __napi_schedule_irqoff() where the comment in dev.c says "Variant of
> > __napi_schedule() assuming hard irqs are masked".
> >
> > It looks like the queue_writel(queue, IDR, bp->rx_intr_mask); call
> > just before the __napi_schedule() call in macb_main.c is doing this
> > hard irq masking? So could it change to be like this?
> >
> It's unsafe under forced irq threading. There has been a number of
> discussions about this topic in the past.
OK thanks, and our use case is forced irq threading under PREEMPT_RT

-Paul

> > --- a/drivers/net/ethernet/cadence/macb_main.c
> > +++ b/drivers/net/ethernet/cadence/macb_main.c
> > @@ -1616,7 +1623,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
> >
> >                         if (napi_schedule_prep(&queue->napi)) {
> >                                 netdev_vdbg(bp->dev, "scheduling RX softirq\n");
> > -                               __napi_schedule(&queue->napi);
> > +                               __napi_schedule_irqoff(&queue->napi);
> >                         }
> >                 }
> >
> > -Paul
> >
>

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

end of thread, other threads:[~2021-01-11 22:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 19:45 net: macb: can macb use __napi_schedule_irqoff() instead of __napi_schedule() Paul Thomas
2021-01-11 19:45 ` Paul Thomas
2021-01-11 21:35 ` Heiner Kallweit
2021-01-11 21:35   ` Heiner Kallweit
2021-01-11 22:09   ` Paul Thomas
2021-01-11 22:09     ` Paul Thomas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.