Fixes for v5.17
Subsystems (2)
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
PATCH 2/3 RDMA/mlx5: Add a missing update of cache->last_add
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.
--- drivers/infiniband/hw/mlx5/mr.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/hw/mlx5/mr.c +1 -0
@@ -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
PATCH 3/3 IB/cm: Cancel mad on the DREQ event when the state is MRA_REP_RCVD
In reply to Leon RomanovskyFrom: 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.
--- drivers/infiniband/core/cm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/infiniband/core/cm.c +1 -2
@@ -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
PATCH 1/3 RDMA/mlx5: Don't remove cache MRs when a delay is needed
In reply to Leon RomanovskyFrom: Aharon Landau <[email protected]>
Don't remove MRs from the cache if need to delay the removal.
--- drivers/infiniband/hw/mlx5/mr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/mr.c +3 -1
@@ -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
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 ofcache->last_addMark Zhang (1):
IB/cm: Cancel mad on the DREQ event when the state isMRA_REP_RCVD
Applied to for-rc, thanks
Jason