Skip to content

Commit 2553ba2

Browse files
gal-pressmanjgunthorpe
authored andcommitted
RDMA: Mark if destroy address handle is in a sleepable context
Introduce a 'flags' field to destroy address handle callback and add a flag that marks whether the callback is executed in an atomic context or not. This will allow drivers to wait for completion instead of polling for it when it is allowed. Signed-off-by: Gal Pressman <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent b090c4e commit 2553ba2

36 files changed

+75
-60
lines changed

drivers/infiniband/core/agent.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ void agent_send_response(const struct ib_mad_hdr *mad_hdr, const struct ib_grh *
137137
err2:
138138
ib_free_send_mad(send_buf);
139139
err1:
140-
rdma_destroy_ah(ah);
140+
rdma_destroy_ah(ah, RDMA_DESTROY_AH_SLEEPABLE);
141141
}
142142

143143
static void agent_send_handler(struct ib_mad_agent *mad_agent,
144144
struct ib_mad_send_wc *mad_send_wc)
145145
{
146-
rdma_destroy_ah(mad_send_wc->send_buf->ah);
146+
rdma_destroy_ah(mad_send_wc->send_buf->ah, RDMA_DESTROY_AH_SLEEPABLE);
147147
ib_free_send_mad(mad_send_wc->send_buf);
148148
}
149149

drivers/infiniband/core/cm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static int cm_alloc_msg(struct cm_id_private *cm_id_priv,
355355
GFP_ATOMIC,
356356
IB_MGMT_BASE_VERSION);
357357
if (IS_ERR(m)) {
358-
rdma_destroy_ah(ah);
358+
rdma_destroy_ah(ah, 0);
359359
ret = PTR_ERR(m);
360360
goto out;
361361
}
@@ -400,7 +400,7 @@ static int cm_create_response_msg_ah(struct cm_port *port,
400400
static void cm_free_msg(struct ib_mad_send_buf *msg)
401401
{
402402
if (msg->ah)
403-
rdma_destroy_ah(msg->ah);
403+
rdma_destroy_ah(msg->ah, 0);
404404
if (msg->context[0])
405405
cm_deref_id(msg->context[0]);
406406
ib_free_send_mad(msg);

drivers/infiniband/core/mad_rmpp.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static void destroy_rmpp_recv(struct mad_rmpp_recv *rmpp_recv)
8181
{
8282
deref_rmpp_recv(rmpp_recv);
8383
wait_for_completion(&rmpp_recv->comp);
84-
rdma_destroy_ah(rmpp_recv->ah);
84+
rdma_destroy_ah(rmpp_recv->ah, RDMA_DESTROY_AH_SLEEPABLE);
8585
kfree(rmpp_recv);
8686
}
8787

@@ -171,7 +171,7 @@ static struct ib_mad_send_buf *alloc_response_msg(struct ib_mad_agent *agent,
171171
hdr_len, 0, GFP_KERNEL,
172172
IB_MGMT_BASE_VERSION);
173173
if (IS_ERR(msg))
174-
rdma_destroy_ah(ah);
174+
rdma_destroy_ah(ah, RDMA_DESTROY_AH_SLEEPABLE);
175175
else {
176176
msg->ah = ah;
177177
msg->context[0] = ah;
@@ -201,15 +201,16 @@ static void ack_ds_ack(struct ib_mad_agent_private *agent,
201201

202202
ret = ib_post_send_mad(msg, NULL);
203203
if (ret) {
204-
rdma_destroy_ah(msg->ah);
204+
rdma_destroy_ah(msg->ah, RDMA_DESTROY_AH_SLEEPABLE);
205205
ib_free_send_mad(msg);
206206
}
207207
}
208208

209209
void ib_rmpp_send_handler(struct ib_mad_send_wc *mad_send_wc)
210210
{
211211
if (mad_send_wc->send_buf->context[0] == mad_send_wc->send_buf->ah)
212-
rdma_destroy_ah(mad_send_wc->send_buf->ah);
212+
rdma_destroy_ah(mad_send_wc->send_buf->ah,
213+
RDMA_DESTROY_AH_SLEEPABLE);
213214
ib_free_send_mad(mad_send_wc->send_buf);
214215
}
215216

@@ -237,7 +238,7 @@ static void nack_recv(struct ib_mad_agent_private *agent,
237238

238239
ret = ib_post_send_mad(msg, NULL);
239240
if (ret) {
240-
rdma_destroy_ah(msg->ah);
241+
rdma_destroy_ah(msg->ah, RDMA_DESTROY_AH_SLEEPABLE);
241242
ib_free_send_mad(msg);
242243
}
243244
}

drivers/infiniband/core/sa_query.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ static void free_sm_ah(struct kref *kref)
11471147
{
11481148
struct ib_sa_sm_ah *sm_ah = container_of(kref, struct ib_sa_sm_ah, ref);
11491149

1150-
rdma_destroy_ah(sm_ah->ah);
1150+
rdma_destroy_ah(sm_ah->ah, 0);
11511151
kfree(sm_ah);
11521152
}
11531153

drivers/infiniband/core/user_mad.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static void send_handler(struct ib_mad_agent *agent,
205205
struct ib_umad_packet *packet = send_wc->send_buf->context[0];
206206

207207
dequeue_send(file, packet);
208-
rdma_destroy_ah(packet->msg->ah);
208+
rdma_destroy_ah(packet->msg->ah, RDMA_DESTROY_AH_SLEEPABLE);
209209
ib_free_send_mad(packet->msg);
210210

211211
if (send_wc->status == IB_WC_RESP_TIMEOUT_ERR) {
@@ -621,7 +621,7 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf,
621621
err_msg:
622622
ib_free_send_mad(packet->msg);
623623
err_ah:
624-
rdma_destroy_ah(ah);
624+
rdma_destroy_ah(ah, RDMA_DESTROY_AH_SLEEPABLE);
625625
err_up:
626626
mutex_unlock(&file->mutex);
627627
err:

drivers/infiniband/core/uverbs_cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2486,7 +2486,7 @@ static int ib_uverbs_create_ah(struct uverbs_attr_bundle *attrs)
24862486
return uobj_alloc_commit(uobj);
24872487

24882488
err_copy:
2489-
rdma_destroy_ah(ah);
2489+
rdma_destroy_ah(ah, RDMA_DESTROY_AH_SLEEPABLE);
24902490

24912491
err_put:
24922492
uobj_put_obj_read(pd);

drivers/infiniband/core/uverbs_std_types.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
static int uverbs_free_ah(struct ib_uobject *uobject,
4343
enum rdma_remove_reason why)
4444
{
45-
return rdma_destroy_ah((struct ib_ah *)uobject->object);
45+
return rdma_destroy_ah((struct ib_ah *)uobject->object,
46+
RDMA_DESTROY_AH_SLEEPABLE);
4647
}
4748

4849
static int uverbs_free_flow(struct ib_uobject *uobject,

drivers/infiniband/core/verbs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,14 +925,16 @@ int rdma_query_ah(struct ib_ah *ah, struct rdma_ah_attr *ah_attr)
925925
}
926926
EXPORT_SYMBOL(rdma_query_ah);
927927

928-
int rdma_destroy_ah(struct ib_ah *ah)
928+
int rdma_destroy_ah(struct ib_ah *ah, u32 flags)
929929
{
930930
const struct ib_gid_attr *sgid_attr = ah->sgid_attr;
931931
struct ib_pd *pd;
932932
int ret;
933933

934+
might_sleep_if(flags & RDMA_DESTROY_AH_SLEEPABLE);
935+
934936
pd = ah->pd;
935-
ret = ah->device->ops.destroy_ah(ah);
937+
ret = ah->device->ops.destroy_ah(ah, flags);
936938
if (!ret) {
937939
atomic_dec(&pd->usecnt);
938940
if (sgid_attr)

drivers/infiniband/hw/bnxt_re/ib_verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ struct ib_pd *bnxt_re_alloc_pd(struct ib_device *ibdev,
647647
}
648648

649649
/* Address Handles */
650-
int bnxt_re_destroy_ah(struct ib_ah *ib_ah)
650+
int bnxt_re_destroy_ah(struct ib_ah *ib_ah, u32 flags)
651651
{
652652
struct bnxt_re_ah *ah = container_of(ib_ah, struct bnxt_re_ah, ib_ah);
653653
struct bnxt_re_dev *rdev = ah->rdev;

drivers/infiniband/hw/bnxt_re/ib_verbs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ struct ib_ah *bnxt_re_create_ah(struct ib_pd *pd,
173173
struct ib_udata *udata);
174174
int bnxt_re_modify_ah(struct ib_ah *ah, struct rdma_ah_attr *ah_attr);
175175
int bnxt_re_query_ah(struct ib_ah *ah, struct rdma_ah_attr *ah_attr);
176-
int bnxt_re_destroy_ah(struct ib_ah *ah);
176+
int bnxt_re_destroy_ah(struct ib_ah *ah, u32 flags);
177177
struct ib_srq *bnxt_re_create_srq(struct ib_pd *pd,
178178
struct ib_srq_init_attr *srq_init_attr,
179179
struct ib_udata *udata);

drivers/infiniband/hw/hns/hns_roce_ah.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int hns_roce_query_ah(struct ib_ah *ibah, struct rdma_ah_attr *ah_attr)
111111
return 0;
112112
}
113113

114-
int hns_roce_destroy_ah(struct ib_ah *ah)
114+
int hns_roce_destroy_ah(struct ib_ah *ah, u32 flags)
115115
{
116116
kfree(to_hr_ah(ah));
117117

drivers/infiniband/hw/hns/hns_roce_device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ struct ib_ah *hns_roce_create_ah(struct ib_pd *pd,
10591059
u32 flags,
10601060
struct ib_udata *udata);
10611061
int hns_roce_query_ah(struct ib_ah *ibah, struct rdma_ah_attr *ah_attr);
1062-
int hns_roce_destroy_ah(struct ib_ah *ah);
1062+
int hns_roce_destroy_ah(struct ib_ah *ah, u32 flags);
10631063

10641064
struct ib_pd *hns_roce_alloc_pd(struct ib_device *ib_dev,
10651065
struct ib_ucontext *context,

drivers/infiniband/hw/mlx4/ah.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ int mlx4_ib_query_ah(struct ib_ah *ibah, struct rdma_ah_attr *ah_attr)
250250
return 0;
251251
}
252252

253-
int mlx4_ib_destroy_ah(struct ib_ah *ah)
253+
int mlx4_ib_destroy_ah(struct ib_ah *ah, u32 flags)
254254
{
255255
kfree(to_mah(ah));
256256
return 0;

drivers/infiniband/hw/mlx4/mad.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static void update_sm_ah(struct mlx4_ib_dev *dev, u8 port_num, u16 lid, u8 sl)
208208

209209
spin_lock_irqsave(&dev->sm_lock, flags);
210210
if (dev->sm_ah[port_num - 1])
211-
rdma_destroy_ah(dev->sm_ah[port_num - 1]);
211+
rdma_destroy_ah(dev->sm_ah[port_num - 1], 0);
212212
dev->sm_ah[port_num - 1] = new_ah;
213213
spin_unlock_irqrestore(&dev->sm_lock, flags);
214214
}
@@ -584,7 +584,7 @@ int mlx4_ib_send_to_slave(struct mlx4_ib_dev *dev, int slave, u8 port,
584584

585585
tun_mad = (struct mlx4_rcv_tunnel_mad *) (tun_qp->tx_ring[tun_tx_ix].buf.addr);
586586
if (tun_qp->tx_ring[tun_tx_ix].ah)
587-
rdma_destroy_ah(tun_qp->tx_ring[tun_tx_ix].ah);
587+
rdma_destroy_ah(tun_qp->tx_ring[tun_tx_ix].ah, 0);
588588
tun_qp->tx_ring[tun_tx_ix].ah = ah;
589589
ib_dma_sync_single_for_cpu(&dev->ib_dev,
590590
tun_qp->tx_ring[tun_tx_ix].buf.map,
@@ -657,7 +657,7 @@ int mlx4_ib_send_to_slave(struct mlx4_ib_dev *dev, int slave, u8 port,
657657
spin_unlock(&tun_qp->tx_lock);
658658
tun_qp->tx_ring[tun_tx_ix].ah = NULL;
659659
end:
660-
rdma_destroy_ah(ah);
660+
rdma_destroy_ah(ah, 0);
661661
return ret;
662662
}
663663

@@ -1024,7 +1024,7 @@ static void send_handler(struct ib_mad_agent *agent,
10241024
struct ib_mad_send_wc *mad_send_wc)
10251025
{
10261026
if (mad_send_wc->send_buf->context[0])
1027-
rdma_destroy_ah(mad_send_wc->send_buf->context[0]);
1027+
rdma_destroy_ah(mad_send_wc->send_buf->context[0], 0);
10281028
ib_free_send_mad(mad_send_wc->send_buf);
10291029
}
10301030

@@ -1079,7 +1079,7 @@ void mlx4_ib_mad_cleanup(struct mlx4_ib_dev *dev)
10791079
}
10801080

10811081
if (dev->sm_ah[p])
1082-
rdma_destroy_ah(dev->sm_ah[p]);
1082+
rdma_destroy_ah(dev->sm_ah[p], 0);
10831083
}
10841084
}
10851085

@@ -1411,7 +1411,7 @@ int mlx4_ib_send_to_wire(struct mlx4_ib_dev *dev, int slave, u8 port,
14111411

14121412
sqp_mad = (struct mlx4_mad_snd_buf *) (sqp->tx_ring[wire_tx_ix].buf.addr);
14131413
if (sqp->tx_ring[wire_tx_ix].ah)
1414-
rdma_destroy_ah(sqp->tx_ring[wire_tx_ix].ah);
1414+
rdma_destroy_ah(sqp->tx_ring[wire_tx_ix].ah, 0);
14151415
sqp->tx_ring[wire_tx_ix].ah = ah;
14161416
ib_dma_sync_single_for_cpu(&dev->ib_dev,
14171417
sqp->tx_ring[wire_tx_ix].buf.map,
@@ -1450,7 +1450,7 @@ int mlx4_ib_send_to_wire(struct mlx4_ib_dev *dev, int slave, u8 port,
14501450
spin_unlock(&sqp->tx_lock);
14511451
sqp->tx_ring[wire_tx_ix].ah = NULL;
14521452
out:
1453-
mlx4_ib_destroy_ah(ah);
1453+
mlx4_ib_destroy_ah(ah, 0);
14541454
return ret;
14551455
}
14561456

@@ -1716,7 +1716,7 @@ static void mlx4_ib_free_pv_qp_bufs(struct mlx4_ib_demux_pv_ctx *ctx,
17161716
tx_buf_size, DMA_TO_DEVICE);
17171717
kfree(tun_qp->tx_ring[i].buf.addr);
17181718
if (tun_qp->tx_ring[i].ah)
1719-
rdma_destroy_ah(tun_qp->tx_ring[i].ah);
1719+
rdma_destroy_ah(tun_qp->tx_ring[i].ah, 0);
17201720
}
17211721
kfree(tun_qp->tx_ring);
17221722
kfree(tun_qp->ring);
@@ -1749,7 +1749,7 @@ static void mlx4_ib_tunnel_comp_worker(struct work_struct *work)
17491749
"wrid=0x%llx, status=0x%x\n",
17501750
wc.wr_id, wc.status);
17511751
rdma_destroy_ah(tun_qp->tx_ring[wc.wr_id &
1752-
(MLX4_NUM_TUNNEL_BUFS - 1)].ah);
1752+
(MLX4_NUM_TUNNEL_BUFS - 1)].ah, 0);
17531753
tun_qp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah
17541754
= NULL;
17551755
spin_lock(&tun_qp->tx_lock);
@@ -1766,7 +1766,7 @@ static void mlx4_ib_tunnel_comp_worker(struct work_struct *work)
17661766
ctx->slave, wc.status, wc.wr_id);
17671767
if (!MLX4_TUN_IS_RECV(wc.wr_id)) {
17681768
rdma_destroy_ah(tun_qp->tx_ring[wc.wr_id &
1769-
(MLX4_NUM_TUNNEL_BUFS - 1)].ah);
1769+
(MLX4_NUM_TUNNEL_BUFS - 1)].ah, 0);
17701770
tun_qp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah
17711771
= NULL;
17721772
spin_lock(&tun_qp->tx_lock);
@@ -1903,7 +1903,7 @@ static void mlx4_ib_sqp_comp_worker(struct work_struct *work)
19031903
switch (wc.opcode) {
19041904
case IB_WC_SEND:
19051905
rdma_destroy_ah(sqp->tx_ring[wc.wr_id &
1906-
(MLX4_NUM_TUNNEL_BUFS - 1)].ah);
1906+
(MLX4_NUM_TUNNEL_BUFS - 1)].ah, 0);
19071907
sqp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah
19081908
= NULL;
19091909
spin_lock(&sqp->tx_lock);
@@ -1932,7 +1932,7 @@ static void mlx4_ib_sqp_comp_worker(struct work_struct *work)
19321932
ctx->slave, wc.status, wc.wr_id);
19331933
if (!MLX4_TUN_IS_RECV(wc.wr_id)) {
19341934
rdma_destroy_ah(sqp->tx_ring[wc.wr_id &
1935-
(MLX4_NUM_TUNNEL_BUFS - 1)].ah);
1935+
(MLX4_NUM_TUNNEL_BUFS - 1)].ah, 0);
19361936
sqp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah
19371937
= NULL;
19381938
spin_lock(&sqp->tx_lock);

drivers/infiniband/hw/mlx4/mlx4_ib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ struct ib_ah *mlx4_ib_create_ah_slave(struct ib_pd *pd,
760760
int slave_sgid_index, u8 *s_mac,
761761
u16 vlan_tag);
762762
int mlx4_ib_query_ah(struct ib_ah *ibah, struct rdma_ah_attr *ah_attr);
763-
int mlx4_ib_destroy_ah(struct ib_ah *ah);
763+
int mlx4_ib_destroy_ah(struct ib_ah *ah, u32 flags);
764764

765765
struct ib_srq *mlx4_ib_create_srq(struct ib_pd *pd,
766766
struct ib_srq_init_attr *init_attr,

drivers/infiniband/hw/mlx5/ah.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ int mlx5_ib_query_ah(struct ib_ah *ibah, struct rdma_ah_attr *ah_attr)
131131
return 0;
132132
}
133133

134-
int mlx5_ib_destroy_ah(struct ib_ah *ah)
134+
int mlx5_ib_destroy_ah(struct ib_ah *ah, u32 flags)
135135
{
136136
kfree(to_mah(ah));
137137
return 0;

drivers/infiniband/hw/mlx5/mlx5_ib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ int mlx5_MAD_IFC(struct mlx5_ib_dev *dev, int ignore_mkey, int ignore_bkey,
10441044
struct ib_ah *mlx5_ib_create_ah(struct ib_pd *pd, struct rdma_ah_attr *ah_attr,
10451045
u32 flags, struct ib_udata *udata);
10461046
int mlx5_ib_query_ah(struct ib_ah *ibah, struct rdma_ah_attr *ah_attr);
1047-
int mlx5_ib_destroy_ah(struct ib_ah *ah);
1047+
int mlx5_ib_destroy_ah(struct ib_ah *ah, u32 flags);
10481048
struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd,
10491049
struct ib_srq_init_attr *init_attr,
10501050
struct ib_udata *udata);

drivers/infiniband/hw/mthca/mthca_mad.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static void update_sm_ah(struct mthca_dev *dev,
9595

9696
spin_lock_irqsave(&dev->sm_lock, flags);
9797
if (dev->sm_ah[port_num - 1])
98-
rdma_destroy_ah(dev->sm_ah[port_num - 1]);
98+
rdma_destroy_ah(dev->sm_ah[port_num - 1], 0);
9999
dev->sm_ah[port_num - 1] = new_ah;
100100
spin_unlock_irqrestore(&dev->sm_lock, flags);
101101
}
@@ -347,6 +347,7 @@ void mthca_free_agents(struct mthca_dev *dev)
347347
}
348348

349349
if (dev->sm_ah[p])
350-
rdma_destroy_ah(dev->sm_ah[p]);
350+
rdma_destroy_ah(dev->sm_ah[p],
351+
RDMA_DESTROY_AH_SLEEPABLE);
351352
}
352353
}

drivers/infiniband/hw/mthca/mthca_provider.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ static struct ib_ah *mthca_ah_create(struct ib_pd *pd,
432432
return &ah->ibah;
433433
}
434434

435-
static int mthca_ah_destroy(struct ib_ah *ah)
435+
static int mthca_ah_destroy(struct ib_ah *ah, u32 flags)
436436
{
437437
mthca_destroy_ah(to_mdev(ah->device), to_mah(ah));
438438
kfree(ah);

drivers/infiniband/hw/ocrdma/ocrdma_ah.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct rdma_ah_attr *attr,
219219
return ERR_PTR(status);
220220
}
221221

222-
int ocrdma_destroy_ah(struct ib_ah *ibah)
222+
int ocrdma_destroy_ah(struct ib_ah *ibah, u32 flags)
223223
{
224224
struct ocrdma_ah *ah = get_ocrdma_ah(ibah);
225225
struct ocrdma_dev *dev = get_ocrdma_dev(ibah->device);

drivers/infiniband/hw/ocrdma/ocrdma_ah.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ enum {
5353

5454
struct ib_ah *ocrdma_create_ah(struct ib_pd *pd, struct rdma_ah_attr *ah_attr,
5555
u32 flags, struct ib_udata *udata);
56-
int ocrdma_destroy_ah(struct ib_ah *ah);
56+
int ocrdma_destroy_ah(struct ib_ah *ah, u32 flags);
5757
int ocrdma_query_ah(struct ib_ah *ah, struct rdma_ah_attr *ah_attr);
5858

5959
int ocrdma_process_mad(struct ib_device *,

drivers/infiniband/hw/qedr/verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2628,7 +2628,7 @@ struct ib_ah *qedr_create_ah(struct ib_pd *ibpd, struct rdma_ah_attr *attr,
26282628
return &ah->ibah;
26292629
}
26302630

2631-
int qedr_destroy_ah(struct ib_ah *ibah)
2631+
int qedr_destroy_ah(struct ib_ah *ibah, u32 flags)
26322632
{
26332633
struct qedr_ah *ah = get_qedr_ah(ibah);
26342634

drivers/infiniband/hw/qedr/verbs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ int qedr_post_srq_recv(struct ib_srq *ibsrq, const struct ib_recv_wr *wr,
7777
const struct ib_recv_wr **bad_recv_wr);
7878
struct ib_ah *qedr_create_ah(struct ib_pd *ibpd, struct rdma_ah_attr *attr,
7979
u32 flags, struct ib_udata *udata);
80-
int qedr_destroy_ah(struct ib_ah *ibah);
80+
int qedr_destroy_ah(struct ib_ah *ibah, u32 flags);
8181

8282
int qedr_dereg_mr(struct ib_mr *);
8383
struct ib_mr *qedr_get_dma_mr(struct ib_pd *, int acc);

drivers/infiniband/hw/qib/qib_mad.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2494,5 +2494,6 @@ void qib_notify_free_mad_agent(struct rvt_dev_info *rdi, int port_idx)
24942494
del_timer_sync(&dd->pport[port_idx].cong_stats.timer);
24952495

24962496
if (dd->pport[port_idx].ibport_data.smi_ah)
2497-
rdma_destroy_ah(&dd->pport[port_idx].ibport_data.smi_ah->ibah);
2497+
rdma_destroy_ah(&dd->pport[port_idx].ibport_data.smi_ah->ibah,
2498+
RDMA_DESTROY_AH_SLEEPABLE);
24982499
}

0 commit comments

Comments
 (0)