linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] net: bcmgenet: add support for GRO software interrupt coalescing
@ 2025-05-31 22:48 Zak Kemble
  2025-05-31 22:48 ` [PATCH v1 1/2] net: bcmgenet: use napi_complete_done return value Zak Kemble
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Zak Kemble @ 2025-05-31 22:48 UTC (permalink / raw)
  To: Doug Berger, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-kernel
  Cc: Zak Kemble

Hey, these patches enable support for software IRQ coalescing and GRO
aggregation and applies conservative defaults which can help improve
system and network performance by reducing the number of hardware
interrupts and improving GRO aggregation ratio.

Zak Kemble (2):
  net: bcmgenet: use napi_complete_done return value
  net: bcmgenet: enable GRO software interrupt coalescing by default

 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.39.5


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

* [PATCH v1 1/2] net: bcmgenet: use napi_complete_done return value
  2025-05-31 22:48 [PATCH v1 0/2] net: bcmgenet: add support for GRO software interrupt coalescing Zak Kemble
@ 2025-05-31 22:48 ` Zak Kemble
  2025-05-31 22:48 ` [PATCH v1 2/2] net: bcmgenet: enable GRO software interrupt coalescing by default Zak Kemble
  2025-06-02 19:00 ` [PATCH v1 0/2] net: bcmgenet: add support for GRO software interrupt coalescing Florian Fainelli
  2 siblings, 0 replies; 6+ messages in thread
From: Zak Kemble @ 2025-05-31 22:48 UTC (permalink / raw)
  To: Doug Berger, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-kernel
  Cc: Zak Kemble

Make use of the return value from napi_complete_done(). This allows users to
use the gro_flush_timeout and napi_defer_hard_irqs sysfs attributes for
configuring software interrupt coalescing.

Signed-off-by: Zak Kemble <zakkemble@gmail.com>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index fa0077bc6..cc9bdd244 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2472,10 +2472,8 @@ static int bcmgenet_rx_poll(struct napi_struct *napi, int budget)
 
 	work_done = bcmgenet_desc_rx(ring, budget);
 
-	if (work_done < budget) {
-		napi_complete_done(napi, work_done);
+	if (work_done < budget && napi_complete_done(napi, work_done))
 		bcmgenet_rx_ring_int_enable(ring);
-	}
 
 	if (ring->dim.use_dim) {
 		dim_update_sample(ring->dim.event_ctr, ring->dim.packets,
-- 
2.39.5


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

* [PATCH v1 2/2] net: bcmgenet: enable GRO software interrupt coalescing by default
  2025-05-31 22:48 [PATCH v1 0/2] net: bcmgenet: add support for GRO software interrupt coalescing Zak Kemble
  2025-05-31 22:48 ` [PATCH v1 1/2] net: bcmgenet: use napi_complete_done return value Zak Kemble
@ 2025-05-31 22:48 ` Zak Kemble
  2025-06-02 19:00 ` [PATCH v1 0/2] net: bcmgenet: add support for GRO software interrupt coalescing Florian Fainelli
  2 siblings, 0 replies; 6+ messages in thread
From: Zak Kemble @ 2025-05-31 22:48 UTC (permalink / raw)
  To: Doug Berger, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-kernel
  Cc: Zak Kemble

Apply conservative defaults.

Signed-off-by: Zak Kemble <zakkemble@gmail.com>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index cc9bdd244..4f40f6afe 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -3986,6 +3986,8 @@ static int bcmgenet_probe(struct platform_device *pdev)
 	dev->hw_features |= dev->features;
 	dev->vlan_features |= dev->features;
 
+	netdev_sw_irq_coalesce_default_on(dev);
+
 	/* Request the WOL interrupt and advertise suspend if available */
 	priv->wol_irq_disabled = true;
 	if (priv->wol_irq > 0) {
-- 
2.39.5


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

* Re: [PATCH v1 0/2] net: bcmgenet: add support for GRO software interrupt coalescing
  2025-05-31 22:48 [PATCH v1 0/2] net: bcmgenet: add support for GRO software interrupt coalescing Zak Kemble
  2025-05-31 22:48 ` [PATCH v1 1/2] net: bcmgenet: use napi_complete_done return value Zak Kemble
  2025-05-31 22:48 ` [PATCH v1 2/2] net: bcmgenet: enable GRO software interrupt coalescing by default Zak Kemble
@ 2025-06-02 19:00 ` Florian Fainelli
  2025-06-09 20:35   ` Florian Fainelli
  2 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2025-06-02 19:00 UTC (permalink / raw)
  To: Zak Kemble, Doug Berger, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

Hi Zak,

On 5/31/25 15:48, Zak Kemble wrote:
> Hey, these patches enable support for software IRQ coalescing and GRO
> aggregation and applies conservative defaults which can help improve
> system and network performance by reducing the number of hardware
> interrupts and improving GRO aggregation ratio.

Without this patch, seeing the following with an iperf3 server running 
at a gigabit link:

00:18:19     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal 
  %guest   %idle
00:18:20     all    0.53    0.00    9.36    0.00    8.56   18.98    0.00 
    0.00   62.57

and with your patches applied:

00:00:56     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal 
  %guest   %idle
00:00:57     all    0.00    0.00    3.29    0.00    1.01    7.34    0.00 
    0.00   88.35

so definitively helping, thanks!

Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>

You will have to repost once net-next opens though:

https://patchwork.hopto.org/net-next.html

Thanks!
-- 
Florian

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

* Re: [PATCH v1 0/2] net: bcmgenet: add support for GRO software interrupt coalescing
  2025-06-02 19:00 ` [PATCH v1 0/2] net: bcmgenet: add support for GRO software interrupt coalescing Florian Fainelli
@ 2025-06-09 20:35   ` Florian Fainelli
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2025-06-09 20:35 UTC (permalink / raw)
  To: Zak Kemble, Doug Berger, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

On 6/2/25 12:00, Florian Fainelli wrote:
> Hi Zak,
> 
> On 5/31/25 15:48, Zak Kemble wrote:
>> Hey, these patches enable support for software IRQ coalescing and GRO
>> aggregation and applies conservative defaults which can help improve
>> system and network performance by reducing the number of hardware
>> interrupts and improving GRO aggregation ratio.
> 
> Without this patch, seeing the following with an iperf3 server running 
> at a gigabit link:
> 
> 00:18:19     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal 
>   %guest   %idle
> 00:18:20     all    0.53    0.00    9.36    0.00    8.56   18.98    0.00 
>     0.00   62.57
> 
> and with your patches applied:
> 
> 00:00:56     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal 
>   %guest   %idle
> 00:00:57     all    0.00    0.00    3.29    0.00    1.01    7.34    0.00 
>     0.00   88.35
> 
> so definitively helping, thanks!
> 
> Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
> 
> You will have to repost once net-next opens though:
> 
> https://patchwork.hopto.org/net-next.html
> 
> Thanks!

Zak, do you mind re-posting now that net-next is open? Thanks!
-- 
Florian

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

* [PATCH v1 1/2] net: bcmgenet: use napi_complete_done return value
  2025-06-09 21:08 Zak Kemble
@ 2025-06-09 21:08 ` Zak Kemble
  0 siblings, 0 replies; 6+ messages in thread
From: Zak Kemble @ 2025-06-09 21:08 UTC (permalink / raw)
  To: Doug Berger, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-kernel
  Cc: Zak Kemble

Make use of the return value from napi_complete_done(). This allows users to
use the gro_flush_timeout and napi_defer_hard_irqs sysfs attributes for
configuring software interrupt coalescing.

Signed-off-by: Zak Kemble <zakkemble@gmail.com>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index fa0077bc6..cc9bdd244 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2472,10 +2472,8 @@ static int bcmgenet_rx_poll(struct napi_struct *napi, int budget)
 
 	work_done = bcmgenet_desc_rx(ring, budget);
 
-	if (work_done < budget) {
-		napi_complete_done(napi, work_done);
+	if (work_done < budget && napi_complete_done(napi, work_done))
 		bcmgenet_rx_ring_int_enable(ring);
-	}
 
 	if (ring->dim.use_dim) {
 		dim_update_sample(ring->dim.event_ctr, ring->dim.packets,
-- 
2.39.5


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

end of thread, other threads:[~2025-06-09 21:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-31 22:48 [PATCH v1 0/2] net: bcmgenet: add support for GRO software interrupt coalescing Zak Kemble
2025-05-31 22:48 ` [PATCH v1 1/2] net: bcmgenet: use napi_complete_done return value Zak Kemble
2025-05-31 22:48 ` [PATCH v1 2/2] net: bcmgenet: enable GRO software interrupt coalescing by default Zak Kemble
2025-06-02 19:00 ` [PATCH v1 0/2] net: bcmgenet: add support for GRO software interrupt coalescing Florian Fainelli
2025-06-09 20:35   ` Florian Fainelli
  -- strict thread matches above, loose matches on Subject: below --
2025-06-09 21:08 Zak Kemble
2025-06-09 21:08 ` [PATCH v1 1/2] net: bcmgenet: use napi_complete_done return value Zak Kemble

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).