mlx4: Invoke softirqs after napi_reschedule
Subsystems (5)
PATCH 1/1 mlx4: Invoke softirqs after napi_reschedule
mlx4 may schedule napi from a workqueue. Afterwards, softirqs are not run in a deterministic time frame and the following message may be logged:
NOHZ: local_softirq_pending 08
The problem is the same as what was described in commit ec13ee80145c ("virtio_net: invoke softirqs after __napi_schedule") and this patch applies the same fix to mlx4.
--- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/mellanox/mlx4/en_rx.c +2 -0
@@ -513,10 +513,12 @@ void mlx4_en_recover_from_oom(struct mlx4_en_priv *priv)if (!priv->port_up)return ; +local_bh_disable ();for (ring =0 ; ring < priv->rx_ring_num; ring++) {if (mlx4_en_is_ring_empty (priv->rx_ring[ring]))napi_reschedule (&priv->rx_cq[ring]->napi); } +local_bh_enable (); }/* When the rx ring is running in page-per-packet mode, a released frame can go
Signature · 1 line
2.11.0
A message that is not in the archive (sent off-list or not yet received): 20170206171046.3765-1-bpoirier-IBi9RG/[email protected]
Quoted 20 lines · Benjamin Poirier
mlx4 may schedule napi from a workqueue. Afterwards, softirqs are not run in a deterministic time frame and the following message may be logged:
NOHZ:local_softirq_pending08The problem is the same as what was described in commit
ec13ee80145c("virtio_net: invoke softirqs after__napi_schedule") and this patch applies the same fix to mlx4.Cc Eric Dumazet <[email protected]>Signed-off-by Benjamin Poirier <bpoirier-IBi9RG/[email protected]>--- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 ++ 1 file changed, 2 insertions(+)drivers/net/ethernet/mellanox/mlx4/en_rx.c +0
-0@@ -513,10 +513,12 @@ void mlx4_en_recover_from_oom(struct mlx4_en_priv *priv)if (!priv->port_up)
drivers/net/ethernet/mellanox/mlx4/en_rx.c void mlx4_en_recover_from_oom(struct mlx4_en_priv *priv) · line 523
Quoted 10 lines
drivers/net/ethernet/mellanox/mlx4/en_rx.c +2
-0return ; +local_bh_disable ();for (ring =0 ; ring < priv->rx_ring_num; ring++) {if (mlx4_en_is_ring_empty (priv->rx_ring[ring]))napi_reschedule (&priv->rx_cq[ring]->napi); } +local_bh_enable (); }
I would prefer having the local_bh_disable()/enable inside the loop, as done with commit 8cf699ec849f4ca1413cea01289bd7d37dbcc626
This gives more chance to service one queue at a time, avoiding to capture all queues into one cpu.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1486403641.7793.43.camel-XN9IlZ5yJG9HTL0Zs8A6p+yfmBU6pStAUsxypvmhUTTZJqsBc5GL+g@public.gmane.org
PATCH v2 1/1 mlx4: Invoke softirqs after napi_reschedule
mlx4 may schedule napi from a workqueue. Afterwards, softirqs are not run in a deterministic time frame and the following message may be logged:
NOHZ: local_softirq_pending 08
The problem is the same as what was described in commit ec13ee80145c ("virtio_net: invoke softirqs after __napi_schedule") and this patch applies the same fix to mlx4.
--- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx4/en_rx.c +4 -1
@@ -514,8 +514,11 @@ void mlx4_en_recover_from_oom(struct mlx4_en_priv *priv)return ;for (ring =0 ; ring < priv->rx_ring_num; ring++) { -if (mlx4_en_is_ring_empty (priv->rx_ring[ring])) +if (mlx4_en_is_ring_empty (priv->rx_ring[ring])) { +local_bh_disable ();napi_reschedule (&priv->rx_cq[ring]->napi); +local_bh_enable (); + } } }
Signature · 6 lines
2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Benjamin Poirier
mlx4 may schedule napi from a workqueue. Afterwards, softirqs are not run in a deterministic time frame and the following message may be logged:
NOHZ:local_softirq_pending08The problem is the same as what was described in commit
ec13ee80145c("virtio_net: invoke softirqs after__napi_schedule") and this patch applies the same fix to mlx4.
Quoted 6 lines
Fixes 07841f9d94c1 ("net/mlx4_en: Schedule napi when RX buffers allocation fails")Cc Eric Dumazet <[email protected]>Signed-off-by Benjamin Poirier <[email protected]>--- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Thanks
Quoted 22 lines · Benjamin Poirier
mlx4 may schedule napi from a workqueue. Afterwards, softirqs are not run in a deterministic time frame and the following message may be logged:
NOHZ:local_softirq_pending08The problem is the same as what was described in commit
ec13ee80145c("virtio_net: invoke softirqs after__napi_schedule") and this patch applies the same fix to mlx4.Fixes 07841f9d94c1 ("net/mlx4_en: Schedule napi when RX buffers allocation fails")Cc Eric Dumazet <[email protected]>Signed-off-by Benjamin Poirier <[email protected]>--- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/net/ethernet/mellanox/mlx4/en_rx.c +0
-0@@ -514,8 +514,11 @@ void mlx4_en_recover_from_oom(struct mlx4_en_priv *priv)return ;
drivers/net/ethernet/mellanox/mlx4/en_rx.c void mlx4_en_recover_from_oom(struct mlx4_en_priv *priv) · line 524
Quoted 10 lines
drivers/net/ethernet/mellanox/mlx4/en_rx.c +4
-1for (ring =0 ; ring < priv->rx_ring_num; ring++) { -if (mlx4_en_is_ring_empty (priv->rx_ring[ring])) +if (mlx4_en_is_ring_empty (priv->rx_ring[ring])) { +local_bh_disable ();napi_reschedule (&priv->rx_cq[ring]->napi); +local_bh_enable (); + } } }
Thanks!
David Miller
maintainerFrom: Benjamin Poirier <[email protected]>
Date: Mon, 6 Feb 2017 10:14:31 -0800
Quoted 11 lines
mlx4 may schedule napi from a workqueue. Afterwards, softirqs are not run in a deterministic time frame and the following message may be logged:
NOHZ:local_softirq_pending08The problem is the same as what was described in commit
ec13ee80145c("virtio_net: invoke softirqs after__napi_schedule") and this patch applies the same fix to mlx4.Fixes 07841f9d94c1 ("net/mlx4_en: Schedule napi when RX buffers allocation fails")Cc Eric Dumazet <[email protected]>Signed-off-by Benjamin Poirier <[email protected]>
Applied and queued up for -stable, thanks!