Skip to content

Commit 63ae1b5

Browse files
Avinash RepakaSomasundaram Krishnasamy
authored andcommitted
RDS: IB: Add proxy qp to support FRWR through RDS_GET_MR
MR registration requested through RDS_GET_MR socket option will not have any connection details. So, there isn't an appropriate qp to post the registration/invalidation requests. This patch solves that issue by using a proxy qp. Orabug: 25669255 Signed-off-by: Avinash Repaka <[email protected]> Reviewed-by: Wei Lin Guay <[email protected]> Tested-by: Gerald Gibson <[email protected]> Tested-by: Efrain Galaviz <[email protected]> Orabug: 27364391 (cherry picked from commit 950ef83) cherry-pick-repo=linux-uek.git Conflicts: net/rds/ib_cm.c net/rds/ib_rdma.c Signed-off-by: Gerd Rausch <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent bedbcf3 commit 63ae1b5

File tree

4 files changed

+339
-28
lines changed

4 files changed

+339
-28
lines changed

net/rds/ib.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,11 @@ static void rds_ib_dev_free_dev(struct rds_ib_device *rds_ibdev)
213213
rds_ib_destroy_mr_pool(rds_ibdev->mr_8k_pool);
214214
if (rds_ibdev->mr_1m_pool)
215215
rds_ib_destroy_mr_pool(rds_ibdev->mr_1m_pool);
216+
if (rds_ibdev->use_fastreg) {
217+
cancel_work_sync(&rds_ibdev->fastreg_reset_w);
218+
down_write(&rds_ibdev->fastreg_lock);
219+
rds_ib_destroy_fastreg(rds_ibdev);
220+
}
216221
if (rds_ibdev->mr)
217222
ib_dereg_mr(rds_ibdev->mr);
218223
if (rds_ibdev->pd)
@@ -287,6 +292,9 @@ void rds_ib_remove_one(struct ib_device *device, void *client_data)
287292
struct rds_ib_device *rds_ibdev;
288293
int i;
289294

295+
rds_rtd(RDS_RTD_RDMA_IB, "Removing ib_device: %p name: %s num_ports: %u\n",
296+
device, device->name, device->phys_port_cnt);
297+
290298
rds_ibdev = ib_get_client_data(device, &rds_ib_client);
291299
if (!rds_ibdev) {
292300
rds_rtd(RDS_RTD_ACT_BND, "rds_ibdev is NULL, ib_device %p\n",
@@ -1987,6 +1995,9 @@ void rds_ib_add_one(struct ib_device *device)
19871995
struct ib_device_attr *dev_attr;
19881996
bool has_frwr, has_fmr;
19891997

1998+
rds_rtd(RDS_RTD_RDMA_IB, "Adding ib_device: %p name: %s num_ports: %u\n",
1999+
device, device->name, device->phys_port_cnt);
2000+
19902001
/* Only handle IB (no iWARP) devices */
19912002
if (device->node_type != RDMA_NODE_IB_CA)
19922003
return;
@@ -2065,6 +2076,16 @@ void rds_ib_add_one(struct ib_device *device)
20652076
pr_info("RDS/IB: %s will be used for ib_device: %s\n",
20662077
rds_ibdev->use_fastreg ? "FRWR" : "FMR", device->name);
20672078

2079+
if (rds_ibdev->use_fastreg) {
2080+
INIT_WORK(&rds_ibdev->fastreg_reset_w, rds_ib_reset_fastreg);
2081+
init_rwsem(&rds_ibdev->fastreg_lock);
2082+
atomic_set(&rds_ibdev->fastreg_wrs, RDS_IB_DEFAULT_FREG_WR);
2083+
if (rds_ib_setup_fastreg(rds_ibdev)) {
2084+
pr_err("RDS/IB: Failed to setup fastreg resources\n");
2085+
goto put_dev;
2086+
}
2087+
}
2088+
20682089
rds_ibdev->mr_1m_pool =
20692090
rds_ib_create_mr_pool(rds_ibdev, RDS_IB_MR_1M_POOL);
20702091
if (IS_ERR(rds_ibdev->mr_1m_pool)) {

net/rds/ib.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252

5353
#define RDS_IB_CLEAN_CACHE 1
5454

55+
#define RDS_IB_DEFAULT_FREG_PORT_NUM 1
56+
5557
extern struct rw_semaphore rds_ib_devices_lock;
5658
extern struct list_head rds_ib_devices;
5759

@@ -422,7 +424,17 @@ struct rds_ib_device {
422424
struct list_head conn_list;
423425
struct ib_device *dev;
424426
struct ib_pd *pd;
427+
425428
bool use_fastreg;
429+
int fastreg_cq_vector;
430+
struct ib_cq *fastreg_cq;
431+
struct ib_wc fastreg_wc[RDS_WC_MAX];
432+
struct ib_qp *fastreg_qp;
433+
struct tasklet_struct fastreg_tasklet;
434+
atomic_t fastreg_wrs;
435+
struct rw_semaphore fastreg_lock;
436+
struct work_struct fastreg_reset_w;
437+
426438
struct ib_mr *mr;
427439
struct rds_ib_mr_pool *mr_1m_pool;
428440
struct rds_ib_mr_pool *mr_8k_pool;
@@ -586,6 +598,9 @@ void rds_ib_cm_connect_complete(struct rds_connection *conn,
586598
struct rdma_cm_event *event);
587599
void rds_ib_init_frag(unsigned int version);
588600
void rds_ib_conn_destroy_init(struct rds_connection *conn);
601+
void rds_ib_destroy_fastreg(struct rds_ib_device *rds_ibdev);
602+
int rds_ib_setup_fastreg(struct rds_ib_device *rds_ibdev);
603+
void rds_ib_reset_fastreg(struct work_struct *work);
589604

590605
/* ib_rdma.c */
591606
int rds_ib_update_ipaddr(struct rds_ib_device *rds_ibdev, __be32 ipaddr);
@@ -603,6 +618,7 @@ void rds_ib_free_mr(void *trans_private, int invalidate);
603618
void rds_ib_flush_mrs(void);
604619
int rds_ib_fmr_init(void);
605620
void rds_ib_fmr_exit(void);
621+
void rds_ib_fcq_handler(struct rds_ib_device *rds_ibdev, struct ib_wc *wc);
606622
void rds_ib_mr_cqe_handler(struct rds_ib_connection *ic, struct ib_wc *wc);
607623

608624
/* ib_recv.c */

0 commit comments

Comments
 (0)