netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	Shay Drory <shayd@nvidia.com>, Parav Pandit <parav@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: [net 10/12] Revert "net/mlx5: Arm only EQs with EQEs"
Date: Wed,  9 Jun 2021 17:21:53 -0700	[thread overview]
Message-ID: <20210610002155.196735-11-saeed@kernel.org> (raw)
In-Reply-To: <20210610002155.196735-1-saeed@kernel.org>

From: Shay Drory <shayd@nvidia.com>

In the scenario described below, an EQ can remain in FIRED state which
can result in missing an interrupt generation.

The scenario:

device                       mlx5_core driver
------                       ----------------
EQ1.eqe generated
EQ1.MSI-X sent
EQ1.state = FIRED
EQ2.eqe generated
                             mlx5_irq()
                               polls - eq1_eqes()
                               arm eq1
                               polls - eq2_eqes()
                               arm eq2
EQ2.MSI-X sent
EQ2.state = FIRED
                              mlx5_irq()
                              polls - eq2_eqes() -- no eqes found
                              driver skips EQ arming;

->EQ2 remains fired, misses generating interrupt.

Hence, always arm the EQ by reverting the cited commit in fixes tag.

Fixes: d894892dda25 ("net/mlx5: Arm only EQs with EQEs")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
index 77c0ca655975..940333410267 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c
@@ -136,7 +136,7 @@ static int mlx5_eq_comp_int(struct notifier_block *nb,
 
 	eqe = next_eqe_sw(eq);
 	if (!eqe)
-		return 0;
+		goto out;
 
 	do {
 		struct mlx5_core_cq *cq;
@@ -161,6 +161,8 @@ static int mlx5_eq_comp_int(struct notifier_block *nb,
 		++eq->cons_index;
 
 	} while ((++num_eqes < MLX5_EQ_POLLING_BUDGET) && (eqe = next_eqe_sw(eq)));
+
+out:
 	eq_update_ci(eq, 1);
 
 	if (cqn != -1)
@@ -248,9 +250,9 @@ static int mlx5_eq_async_int(struct notifier_block *nb,
 		++eq->cons_index;
 
 	} while ((++num_eqes < MLX5_EQ_POLLING_BUDGET) && (eqe = next_eqe_sw(eq)));
-	eq_update_ci(eq, 1);
 
 out:
+	eq_update_ci(eq, 1);
 	mlx5_eq_async_int_unlock(eq_async, recovery, &flags);
 
 	return unlikely(recovery) ? num_eqes : 0;
-- 
2.31.1


  parent reply	other threads:[~2021-06-10  0:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10  0:21 [pull request][net 00/12] mlx5 fixes 2021-06-09 Saeed Mahameed
2021-06-10  0:21 ` [net 01/12] net/mlx5e: Fix an error code in mlx5e_arfs_create_tables() Saeed Mahameed
2021-06-10 20:50   ` patchwork-bot+netdevbpf
2021-06-10  0:21 ` [net 02/12] net/mlx5e: Fix use-after-free of encap entry in neigh update handler Saeed Mahameed
2021-06-10  0:21 ` [net 03/12] net/mlx5e: Remove dependency in IPsec initialization flows Saeed Mahameed
2021-06-10  0:21 ` [net 04/12] net/mlx5e: Fix page reclaim for dead peer hairpin Saeed Mahameed
2021-06-10  0:21 ` [net 05/12] net/mlx5: Consider RoCE cap before init RDMA resources Saeed Mahameed
2021-06-10  0:21 ` [net 06/12] net/mlx5: DR, Don't use SW steering when RoCE is not supported Saeed Mahameed
2021-06-10  0:21 ` [net 07/12] net/mlx5e: Verify dev is present in get devlink port ndo Saeed Mahameed
2021-06-10  0:21 ` [net 08/12] net/mlx5e: Don't update netdev RQs with PTP-RQ Saeed Mahameed
2021-06-10  0:21 ` [net 09/12] net/mlx5e: Fix select queue to consider SKBTX_HW_TSTAMP Saeed Mahameed
2021-06-10  0:21 ` Saeed Mahameed [this message]
2021-06-10  0:21 ` [net 11/12] net/mlx5e: Block offload of outer header csum for UDP tunnels Saeed Mahameed
2021-06-10  0:21 ` [net 12/12] net/mlx5e: Block offload of outer header csum for GRE tunnel Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210610002155.196735-11-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=parav@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=shayd@nvidia.com \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).