* [PATCH net-next] net: bcmgenet: use napi_complete_done()
@ 2016-04-09 5:06 Eric Dumazet
2016-04-09 5:19 ` Florian Fainelli
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Eric Dumazet @ 2016-04-09 5:06 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Petri Gynther, Florian Fainelli
From: Eric Dumazet <edumazet@google.com>
By using napi_complete_done(), we allow fine tuning
of /sys/class/net/ethX/gro_flush_timeout for higher GRO aggregation
efficiency for a Gbit NIC.
Check commit 24d2e4a50737 ("tg3: use napi_complete_done()") for details.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Petri Gynther <pgynther@google.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index f7b42b9fc979..e823013d3125 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -1735,7 +1735,7 @@ static int bcmgenet_rx_poll(struct napi_struct *napi, int budget)
work_done = bcmgenet_desc_rx(ring, budget);
if (work_done < budget) {
- napi_complete(napi);
+ napi_complete_done(napi, work_done);
ring->int_enable(ring);
}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next] net: bcmgenet: use napi_complete_done()
2016-04-09 5:06 [PATCH net-next] net: bcmgenet: use napi_complete_done() Eric Dumazet
@ 2016-04-09 5:19 ` Florian Fainelli
2016-04-09 5:27 ` Eric Dumazet
2016-04-09 5:30 ` [PATCH net-next] net: bcmgenet: use __napi_schedule_irqoff() Eric Dumazet
2016-04-09 17:23 ` [PATCH net-next] net: bcmgenet: use napi_complete_done() Petri Gynther
2016-04-14 3:37 ` David Miller
2 siblings, 2 replies; 8+ messages in thread
From: Florian Fainelli @ 2016-04-09 5:19 UTC (permalink / raw)
To: Eric Dumazet, David Miller; +Cc: netdev, Petri Gynther, opendmb
On April 8, 2016 10:06:40 PM PDT, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>From: Eric Dumazet <edumazet@google.com>
>
>By using napi_complete_done(), we allow fine tuning
>of /sys/class/net/ethX/gro_flush_timeout for higher GRO aggregation
>efficiency for a Gbit NIC.
>
>Check commit 24d2e4a50737 ("tg3: use napi_complete_done()") for
>details.
>
>Signed-off-by: Eric Dumazet <edumazet@google.com>
>Cc: Petri Gynther <pgynther@google.com>
>Cc: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Along the same line of changes, we could use napi_schedule_irqoff since NAPI is always scheduled from ISR context.
>---
> drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>index f7b42b9fc979..e823013d3125 100644
>--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>@@ -1735,7 +1735,7 @@ static int bcmgenet_rx_poll(struct napi_struct
>*napi, int budget)
> work_done = bcmgenet_desc_rx(ring, budget);
>
> if (work_done < budget) {
>- napi_complete(napi);
>+ napi_complete_done(napi, work_done);
> ring->int_enable(ring);
> }
>
--
Florian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next] net: bcmgenet: use napi_complete_done()
2016-04-09 5:19 ` Florian Fainelli
@ 2016-04-09 5:27 ` Eric Dumazet
2016-04-09 5:30 ` [PATCH net-next] net: bcmgenet: use __napi_schedule_irqoff() Eric Dumazet
1 sibling, 0 replies; 8+ messages in thread
From: Eric Dumazet @ 2016-04-09 5:27 UTC (permalink / raw)
To: Florian Fainelli; +Cc: David Miller, netdev, Petri Gynther, opendmb
On Fri, 2016-04-08 at 22:19 -0700, Florian Fainelli wrote:
> Along the same line of changes, we could use napi_schedule_irqoff since NAPI is always scheduled from ISR context.
Good point, I'll cook the patch ;)
Thanks !
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next] net: bcmgenet: use __napi_schedule_irqoff()
2016-04-09 5:19 ` Florian Fainelli
2016-04-09 5:27 ` Eric Dumazet
@ 2016-04-09 5:30 ` Eric Dumazet
2016-04-09 17:24 ` Petri Gynther
2016-04-14 3:38 ` David Miller
1 sibling, 2 replies; 8+ messages in thread
From: Eric Dumazet @ 2016-04-09 5:30 UTC (permalink / raw)
To: Florian Fainelli; +Cc: David Miller, netdev, Petri Gynther, opendmb
From: Florian Fainelli <f.fainelli@gmail.com>
bcmgenet_isr1() and bcmgenet_isr0() run in hard irq context,
we do not need to block irq again.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index f7b42b9fc979..4367d561a12e 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2493,7 +2493,7 @@ static irqreturn_t bcmgenet_isr1(int irq, void *dev_id)
if (likely(napi_schedule_prep(&rx_ring->napi))) {
rx_ring->int_disable(rx_ring);
- __napi_schedule(&rx_ring->napi);
+ __napi_schedule_irqoff(&rx_ring->napi);
}
}
@@ -2506,7 +2506,7 @@ static irqreturn_t bcmgenet_isr1(int irq, void *dev_id)
if (likely(napi_schedule_prep(&tx_ring->napi))) {
tx_ring->int_disable(tx_ring);
- __napi_schedule(&tx_ring->napi);
+ __napi_schedule_irqoff(&tx_ring->napi);
}
}
@@ -2536,7 +2536,7 @@ static irqreturn_t bcmgenet_isr0(int irq, void *dev_id)
if (likely(napi_schedule_prep(&rx_ring->napi))) {
rx_ring->int_disable(rx_ring);
- __napi_schedule(&rx_ring->napi);
+ __napi_schedule_irqoff(&rx_ring->napi);
}
}
@@ -2545,7 +2545,7 @@ static irqreturn_t bcmgenet_isr0(int irq, void *dev_id)
if (likely(napi_schedule_prep(&tx_ring->napi))) {
tx_ring->int_disable(tx_ring);
- __napi_schedule(&tx_ring->napi);
+ __napi_schedule_irqoff(&tx_ring->napi);
}
}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next] net: bcmgenet: use __napi_schedule_irqoff()
2016-04-09 5:30 ` [PATCH net-next] net: bcmgenet: use __napi_schedule_irqoff() Eric Dumazet
@ 2016-04-09 17:24 ` Petri Gynther
2016-04-14 3:38 ` David Miller
1 sibling, 0 replies; 8+ messages in thread
From: Petri Gynther @ 2016-04-09 17:24 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Florian Fainelli, David Miller, netdev, opendmb
On Fri, Apr 8, 2016 at 10:30 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Florian Fainelli <f.fainelli@gmail.com>
>
> bcmgenet_isr1() and bcmgenet_isr0() run in hard irq context,
> we do not need to block irq again.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Petri Gynther <pgynther@google.com>
> ---
> drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index f7b42b9fc979..4367d561a12e 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> @@ -2493,7 +2493,7 @@ static irqreturn_t bcmgenet_isr1(int irq, void *dev_id)
>
> if (likely(napi_schedule_prep(&rx_ring->napi))) {
> rx_ring->int_disable(rx_ring);
> - __napi_schedule(&rx_ring->napi);
> + __napi_schedule_irqoff(&rx_ring->napi);
> }
> }
>
> @@ -2506,7 +2506,7 @@ static irqreturn_t bcmgenet_isr1(int irq, void *dev_id)
>
> if (likely(napi_schedule_prep(&tx_ring->napi))) {
> tx_ring->int_disable(tx_ring);
> - __napi_schedule(&tx_ring->napi);
> + __napi_schedule_irqoff(&tx_ring->napi);
> }
> }
>
> @@ -2536,7 +2536,7 @@ static irqreturn_t bcmgenet_isr0(int irq, void *dev_id)
>
> if (likely(napi_schedule_prep(&rx_ring->napi))) {
> rx_ring->int_disable(rx_ring);
> - __napi_schedule(&rx_ring->napi);
> + __napi_schedule_irqoff(&rx_ring->napi);
> }
> }
>
> @@ -2545,7 +2545,7 @@ static irqreturn_t bcmgenet_isr0(int irq, void *dev_id)
>
> if (likely(napi_schedule_prep(&tx_ring->napi))) {
> tx_ring->int_disable(tx_ring);
> - __napi_schedule(&tx_ring->napi);
> + __napi_schedule_irqoff(&tx_ring->napi);
> }
> }
>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next] net: bcmgenet: use __napi_schedule_irqoff()
2016-04-09 5:30 ` [PATCH net-next] net: bcmgenet: use __napi_schedule_irqoff() Eric Dumazet
2016-04-09 17:24 ` Petri Gynther
@ 2016-04-14 3:38 ` David Miller
1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2016-04-14 3:38 UTC (permalink / raw)
To: eric.dumazet; +Cc: f.fainelli, netdev, pgynther, opendmb
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 08 Apr 2016 22:30:56 -0700
> From: Florian Fainelli <f.fainelli@gmail.com>
>
> bcmgenet_isr1() and bcmgenet_isr0() run in hard irq context,
> we do not need to block irq again.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next] net: bcmgenet: use napi_complete_done()
2016-04-09 5:06 [PATCH net-next] net: bcmgenet: use napi_complete_done() Eric Dumazet
2016-04-09 5:19 ` Florian Fainelli
@ 2016-04-09 17:23 ` Petri Gynther
2016-04-14 3:37 ` David Miller
2 siblings, 0 replies; 8+ messages in thread
From: Petri Gynther @ 2016-04-09 17:23 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev, Florian Fainelli
On Fri, Apr 8, 2016 at 10:06 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> By using napi_complete_done(), we allow fine tuning
> of /sys/class/net/ethX/gro_flush_timeout for higher GRO aggregation
> efficiency for a Gbit NIC.
>
> Check commit 24d2e4a50737 ("tg3: use napi_complete_done()") for details.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Petri Gynther <pgynther@google.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Petri Gynther <pgynther@google.com>
> ---
> drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index f7b42b9fc979..e823013d3125 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> @@ -1735,7 +1735,7 @@ static int bcmgenet_rx_poll(struct napi_struct *napi, int budget)
> work_done = bcmgenet_desc_rx(ring, budget);
>
> if (work_done < budget) {
> - napi_complete(napi);
> + napi_complete_done(napi, work_done);
> ring->int_enable(ring);
> }
>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next] net: bcmgenet: use napi_complete_done()
2016-04-09 5:06 [PATCH net-next] net: bcmgenet: use napi_complete_done() Eric Dumazet
2016-04-09 5:19 ` Florian Fainelli
2016-04-09 17:23 ` [PATCH net-next] net: bcmgenet: use napi_complete_done() Petri Gynther
@ 2016-04-14 3:37 ` David Miller
2 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2016-04-14 3:37 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, pgynther, f.fainelli
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 08 Apr 2016 22:06:40 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> By using napi_complete_done(), we allow fine tuning
> of /sys/class/net/ethX/gro_flush_timeout for higher GRO aggregation
> efficiency for a Gbit NIC.
>
> Check commit 24d2e4a50737 ("tg3: use napi_complete_done()") for details.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-04-14 3:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-09 5:06 [PATCH net-next] net: bcmgenet: use napi_complete_done() Eric Dumazet
2016-04-09 5:19 ` Florian Fainelli
2016-04-09 5:27 ` Eric Dumazet
2016-04-09 5:30 ` [PATCH net-next] net: bcmgenet: use __napi_schedule_irqoff() Eric Dumazet
2016-04-09 17:24 ` Petri Gynther
2016-04-14 3:38 ` David Miller
2016-04-09 17:23 ` [PATCH net-next] net: bcmgenet: use napi_complete_done() Petri Gynther
2016-04-14 3:37 ` David Miller
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).