Skip to contentSkip to conversation

Fixes for v5.17

PATCH Applied Leon Romanovsky 2 participants 5 messages Apr 4, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Fixes for v5.17

From: Leon Romanovsky <[email protected]>

Changelog:
v1:
* Fixed rebase error in patch #1
v0: https://lore.kernel.org/all/[email protected]

Aharon Landau (2):
RDMA/mlx5: Don't remove cache MRs when a delay is needed RDMA/mlx5: Add a missing update of cache->last_add

Mark Zhang (1):
IB/cm: Cancel mad on the DREQ event when the state is MRA_REP_RCVD

 drivers/infiniband/core/cm.c    | 3 +--
 drivers/infiniband/hw/mlx5/mr.c | 5 ++++-
 2 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.35.1
#1 lore raw

PATCH 1/3 RDMA/mlx5: Don't remove cache MRs when a delay is needed

From: Aharon Landau <[email protected]>

Don't remove MRs from the cache if need to delay the removal.

Fixes b9358bdbc713 ("RDMA/mlx5: Fix locking in MR cache work queue")
---
 drivers/infiniband/hw/mlx5/mr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/mr.c +3 -1
index 956f8e875daa..45b0680377ec 100644
@@ -574,8 +574,10 @@ static void __cache_work_func(struct mlx5_cache_ent *ent)
 		spin_lock_irq(&ent->lock);
 		if (ent->disabled)
 			goto out;
-		if (need_delay)
+		if (need_delay) {
 			queue_delayed_work(cache->wq, &ent->dwork, 300 * HZ);
+			goto out;
+		}
 		remove_cache_mr_locked(ent);
 		queue_adjust_cache_locked(ent);
 	}
Signature · 1 line
2.35.1
#2 lore raw

PATCH 2/3 RDMA/mlx5: Add a missing update of cache->last_add

In reply to Leon Romanovsky

From: Aharon Landau <[email protected]>

Update cache->last_add when returning an MR to the cache so that the cache work won't remove it.

Fixes b9358bdbc713 ("RDMA/mlx5: Fix locking in MR cache work queue")
---
 drivers/infiniband/hw/mlx5/mr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/hw/mlx5/mr.c +1 -0
index 45b0680377ec..32ef67e9a6a7 100644
@@ -627,6 +627,7 @@ static void mlx5_mr_cache_free(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr)
 {
 	struct mlx5_cache_ent *ent = mr->cache_ent;
 
+	WRITE_ONCE(dev->cache.last_add, jiffies);
 	spin_lock_irq(&ent->lock);
 	list_add_tail(&mr->list, &ent->head);
 	ent->available_mrs++;
Signature · 1 line
2.35.1
#3 lore raw

PATCH 3/3 IB/cm: Cancel mad on the DREQ event when the state is MRA_REP_RCVD

In reply to Leon Romanovsky

From: Mark Zhang <[email protected]>

On the passive side when the disconnectReq event comes, if the current state is MRA_REP_RCVD, it needs to cancel the MAD before enter the DREQ_RCVD and TIMEWAIT state, otherwise the destroy_id may block until this mad will reach timeout.

Fixes a977049dacde ("[PATCH] IB: Add the kernel CM implementation")
---
 drivers/infiniband/core/cm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/infiniband/core/cm.c +1 -2
index 35f0d5e7533d..1c107d6d03b9 100644
@@ -2824,6 +2824,7 @@ static int cm_dreq_handler(struct cm_work *work)
 	switch (cm_id_priv->id.state) {
 	case IB_CM_REP_SENT:
 	case IB_CM_DREQ_SENT:
+	case IB_CM_MRA_REP_RCVD:
 		ib_cancel_mad(cm_id_priv->msg);
 		break;
 	case IB_CM_ESTABLISHED:
@@ -2831,8 +2832,6 @@ static int cm_dreq_handler(struct cm_work *work)
 		    cm_id_priv->id.lap_state == IB_CM_MRA_LAP_RCVD)
 			ib_cancel_mad(cm_id_priv->msg);
 		break;
-	case IB_CM_MRA_REP_RCVD:
-		break;
 	case IB_CM_TIMEWAIT:
 		atomic_long_inc(&work->port->counters[CM_RECV_DUPLICATES]
 						     [CM_DREQ_COUNTER]);
Signature · 1 line
2.35.1
maintainer Applied
#4 lore raw
In reply to Leon Romanovsky
Quoted 7 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Changelog:
v1:
* Fixed rebase error in patch #1
v0: https://lore.kernel.org/all/[email protected]

Quoted 6 lines

Aharon Landau (2):
RDMA/mlx5: Don't remove cache MRs when a delay is needed RDMA/mlx5: Add a missing update of cache->last_add

Mark Zhang (1):
IB/cm: Cancel mad on the DREQ event when the state is MRA_REP_RCVD

Applied to for-rc, thanks

Jason