Skip to content

Commit 3a57815

Browse files
Max Gurtovoyjgunthorpe
authored andcommitted
RDMA/core: Remove FMR device ops
After removing FMR support from all the RDMA ULPs and providers, there is no need to keep FMR operation for IB devices. Link: https://lore.kernel.org/r/11-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com Signed-off-by: Max Gurtovoy <maxg@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent 22c9cc2 commit 3a57815

4 files changed

Lines changed: 0 additions & 113 deletions

File tree

‎Documentation/infiniband/core_locking.rst‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Sleeping and interrupt context
2222
- post_recv
2323
- poll_cq
2424
- req_notify_cq
25-
- map_phys_fmr
2625

2726
which may not sleep and must be callable from any context.
2827

@@ -36,7 +35,6 @@ Sleeping and interrupt context
3635
- ib_post_send
3736
- ib_post_recv
3837
- ib_req_notify_cq
39-
- ib_map_phys_fmr
4038

4139
are therefore safe to call from any context.
4240

‎drivers/infiniband/core/device.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,7 +2571,6 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops)
25712571
SET_DEVICE_OP(dev_ops, add_gid);
25722572
SET_DEVICE_OP(dev_ops, advise_mr);
25732573
SET_DEVICE_OP(dev_ops, alloc_dm);
2574-
SET_DEVICE_OP(dev_ops, alloc_fmr);
25752574
SET_DEVICE_OP(dev_ops, alloc_hw_stats);
25762575
SET_DEVICE_OP(dev_ops, alloc_mr);
25772576
SET_DEVICE_OP(dev_ops, alloc_mr_integrity);
@@ -2598,7 +2597,6 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops)
25982597
SET_DEVICE_OP(dev_ops, create_wq);
25992598
SET_DEVICE_OP(dev_ops, dealloc_dm);
26002599
SET_DEVICE_OP(dev_ops, dealloc_driver);
2601-
SET_DEVICE_OP(dev_ops, dealloc_fmr);
26022600
SET_DEVICE_OP(dev_ops, dealloc_mw);
26032601
SET_DEVICE_OP(dev_ops, dealloc_pd);
26042602
SET_DEVICE_OP(dev_ops, dealloc_ucontext);
@@ -2642,7 +2640,6 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops)
26422640
SET_DEVICE_OP(dev_ops, iw_rem_ref);
26432641
SET_DEVICE_OP(dev_ops, map_mr_sg);
26442642
SET_DEVICE_OP(dev_ops, map_mr_sg_pi);
2645-
SET_DEVICE_OP(dev_ops, map_phys_fmr);
26462643
SET_DEVICE_OP(dev_ops, mmap);
26472644
SET_DEVICE_OP(dev_ops, mmap_free);
26482645
SET_DEVICE_OP(dev_ops, modify_ah);
@@ -2676,7 +2673,6 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops)
26762673
SET_DEVICE_OP(dev_ops, resize_cq);
26772674
SET_DEVICE_OP(dev_ops, set_vf_guid);
26782675
SET_DEVICE_OP(dev_ops, set_vf_link_state);
2679-
SET_DEVICE_OP(dev_ops, unmap_fmr);
26802676

26812677
SET_OBJ_SIZE(dev_ops, ib_ah);
26822678
SET_OBJ_SIZE(dev_ops, ib_cq);

‎drivers/infiniband/core/verbs.c‎

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,54 +2212,6 @@ struct ib_mr *ib_alloc_mr_integrity(struct ib_pd *pd,
22122212
}
22132213
EXPORT_SYMBOL(ib_alloc_mr_integrity);
22142214

2215-
/* "Fast" memory regions */
2216-
2217-
struct ib_fmr *ib_alloc_fmr(struct ib_pd *pd,
2218-
int mr_access_flags,
2219-
struct ib_fmr_attr *fmr_attr)
2220-
{
2221-
struct ib_fmr *fmr;
2222-
2223-
if (!pd->device->ops.alloc_fmr)
2224-
return ERR_PTR(-EOPNOTSUPP);
2225-
2226-
fmr = pd->device->ops.alloc_fmr(pd, mr_access_flags, fmr_attr);
2227-
if (!IS_ERR(fmr)) {
2228-
fmr->device = pd->device;
2229-
fmr->pd = pd;
2230-
atomic_inc(&pd->usecnt);
2231-
}
2232-
2233-
return fmr;
2234-
}
2235-
EXPORT_SYMBOL(ib_alloc_fmr);
2236-
2237-
int ib_unmap_fmr(struct list_head *fmr_list)
2238-
{
2239-
struct ib_fmr *fmr;
2240-
2241-
if (list_empty(fmr_list))
2242-
return 0;
2243-
2244-
fmr = list_entry(fmr_list->next, struct ib_fmr, list);
2245-
return fmr->device->ops.unmap_fmr(fmr_list);
2246-
}
2247-
EXPORT_SYMBOL(ib_unmap_fmr);
2248-
2249-
int ib_dealloc_fmr(struct ib_fmr *fmr)
2250-
{
2251-
struct ib_pd *pd;
2252-
int ret;
2253-
2254-
pd = fmr->pd;
2255-
ret = fmr->device->ops.dealloc_fmr(fmr);
2256-
if (!ret)
2257-
atomic_dec(&pd->usecnt);
2258-
2259-
return ret;
2260-
}
2261-
EXPORT_SYMBOL(ib_dealloc_fmr);
2262-
22632215
/* Multicast groups */
22642216

22652217
static bool is_valid_mcast_lid(struct ib_qp *qp, u16 lid)

‎include/rdma/ib_verbs.h‎

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,12 +1475,6 @@ enum ib_mr_rereg_flags {
14751475
IB_MR_REREG_SUPPORTED = ((IB_MR_REREG_ACCESS << 1) - 1)
14761476
};
14771477

1478-
struct ib_fmr_attr {
1479-
int max_pages;
1480-
int max_maps;
1481-
u8 page_shift;
1482-
};
1483-
14841478
struct ib_umem;
14851479

14861480
enum rdma_remove_reason {
@@ -1855,14 +1849,6 @@ struct ib_mw {
18551849
enum ib_mw_type type;
18561850
};
18571851

1858-
struct ib_fmr {
1859-
struct ib_device *device;
1860-
struct ib_pd *pd;
1861-
struct list_head list;
1862-
u32 lkey;
1863-
u32 rkey;
1864-
};
1865-
18661852
/* Supported steering options */
18671853
enum ib_flow_attr_type {
18681854
/* steering according to rule specifications */
@@ -2505,12 +2491,6 @@ struct ib_device_ops {
25052491
struct ib_mw *(*alloc_mw)(struct ib_pd *pd, enum ib_mw_type type,
25062492
struct ib_udata *udata);
25072493
int (*dealloc_mw)(struct ib_mw *mw);
2508-
struct ib_fmr *(*alloc_fmr)(struct ib_pd *pd, int mr_access_flags,
2509-
struct ib_fmr_attr *fmr_attr);
2510-
int (*map_phys_fmr)(struct ib_fmr *fmr, u64 *page_list, int list_len,
2511-
u64 iova);
2512-
int (*unmap_fmr)(struct list_head *fmr_list);
2513-
int (*dealloc_fmr)(struct ib_fmr *fmr);
25142494
int (*attach_mcast)(struct ib_qp *qp, union ib_gid *gid, u16 lid);
25152495
int (*detach_mcast)(struct ib_qp *qp, union ib_gid *gid, u16 lid);
25162496
struct ib_xrcd *(*alloc_xrcd)(struct ib_device *device,
@@ -4319,45 +4299,6 @@ static inline u32 ib_inc_rkey(u32 rkey)
43194299
return ((rkey + 1) & mask) | (rkey & ~mask);
43204300
}
43214301

4322-
/**
4323-
* ib_alloc_fmr - Allocates a unmapped fast memory region.
4324-
* @pd: The protection domain associated with the unmapped region.
4325-
* @mr_access_flags: Specifies the memory access rights.
4326-
* @fmr_attr: Attributes of the unmapped region.
4327-
*
4328-
* A fast memory region must be mapped before it can be used as part of
4329-
* a work request.
4330-
*/
4331-
struct ib_fmr *ib_alloc_fmr(struct ib_pd *pd,
4332-
int mr_access_flags,
4333-
struct ib_fmr_attr *fmr_attr);
4334-
4335-
/**
4336-
* ib_map_phys_fmr - Maps a list of physical pages to a fast memory region.
4337-
* @fmr: The fast memory region to associate with the pages.
4338-
* @page_list: An array of physical pages to map to the fast memory region.
4339-
* @list_len: The number of pages in page_list.
4340-
* @iova: The I/O virtual address to use with the mapped region.
4341-
*/
4342-
static inline int ib_map_phys_fmr(struct ib_fmr *fmr,
4343-
u64 *page_list, int list_len,
4344-
u64 iova)
4345-
{
4346-
return fmr->device->ops.map_phys_fmr(fmr, page_list, list_len, iova);
4347-
}
4348-
4349-
/**
4350-
* ib_unmap_fmr - Removes the mapping from a list of fast memory regions.
4351-
* @fmr_list: A linked list of fast memory regions to unmap.
4352-
*/
4353-
int ib_unmap_fmr(struct list_head *fmr_list);
4354-
4355-
/**
4356-
* ib_dealloc_fmr - Deallocates a fast memory region.
4357-
* @fmr: The fast memory region to deallocate.
4358-
*/
4359-
int ib_dealloc_fmr(struct ib_fmr *fmr);
4360-
43614302
/**
43624303
* ib_attach_mcast - Attaches the specified QP to a multicast group.
43634304
* @qp: QP to attach to the multicast group. The QP must be type

0 commit comments

Comments
 (0)