xprtrdma: Remove support for FMR memory registration
Subsystems (3)
PATCH 1/1 xprtrdma: Remove support for FMR memory registration
FMR is not supported on most recent RDMA devices. It is also less secure than FRWR because an FMR memory registration can expose adjacent bytes to remote reading or writing. As discussed during the RDMA BoF at LPC 2018, it is time to remove support for FMR in the NFS/RDMA client stack.
Note that NFS/RDMA server-side uses either local memory registration or FRWR. FMR is not used.
There are a few Infiniband/RoCE devices in the kernel tree that do not appear to support MEM_MGT_EXTENSIONS (FRWR), and therefore will not support client-side NFS/RDMA after this patch. These are:
- mthca
- qib
- hns (RoCE)
Users of these devices can use NFS/TCP on IPoIB instead.
---
Hi Anna-
I just noticed a few additional FMR-related things in xprt_rdma.h that should be removed in this patch. It replaces the version of this patch in this morning's series. Apologies for the confusion.
net/sunrpc/xprtrdma/Makefile | 3 net/sunrpc/xprtrdma/fmr_ops.c | 337 --------------------------------------- net/sunrpc/xprtrdma/verbs.c | 6 - net/sunrpc/xprtrdma/xprt_rdma.h | 12 - 4 files changed, 2 insertions(+), 356 deletions(-) delete mode 100644 net/sunrpc/xprtrdma/fmr_ops.c
net/sunrpc/xprtrdma/Makefile +1 -2
@@ -1,8 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_SUNRPC_XPRT_RDMA) += rpcrdma.o -rpcrdma-y := transport.o rpc_rdma.o verbs.o \ - fmr_ops.o frwr_ops.o \ +rpcrdma-y := transport.o rpc_rdma.o verbs.o frwr_ops.o \ svc_rdma.o svc_rdma_backchannel.o svc_rdma_transport.o \ svc_rdma_sendto.o svc_rdma_recvfrom.o svc_rdma_rw.o \ module.o
net/sunrpc/xprtrdma/fmr_ops.c deleted +0 -337
337 lines not on this page · raw message
net/sunrpc/xprtrdma/verbs.c +0 -6
@@ -434,12 +434,6 @@break ; }/*FALLTHROUGH*/ -case RPCRDMA_MTHCAFMR : -if (fmr_is_supported (ia)) { - ia->ri_ops = &rpcrdma_fmr_memreg_ops; -break ; - } -/*FALLTHROUGH*/ default :pr_err ("rpcrdma: Device %s does not support memreg mode %d\n" , ia->ri_device->name, xprt_rdma_memreg_strategy);
net/sunrpc/xprtrdma/xprt_rdma.h +1 -11
@@ -262,20 +262,12 @@ struct rpcrdma_frwr { }; }; -struct rpcrdma_fmr { -struct ib_fmr *fm_mr; -u64 *fm_physaddrs; -}; -struct rpcrdma_mr {struct list_head mr_list;struct scatterlist *mr_sg;int mr_nents;enum dma_data_direction mr_dir; -union { -struct rpcrdma_fmr fmr; -struct rpcrdma_frwr frwr; - }; +struct rpcrdma_frwr frwr;struct rpcrdma_xprt *mr_xprt;u32 mr_handle;u32 mr_length;
@@ -490,7 +482,6 @@ struct rpcrdma_memreg_ops {const int ro_send_w_inv_ok; }; -extern const struct rpcrdma_memreg_ops rpcrdma_fmr_memreg_ops;extern const struct rpcrdma_memreg_ops rpcrdma_frwr_memreg_ops;/*
@@ -545,7 +536,6 @@ struct rpcrdma_xprt {void rpcrdma_ia_remove (struct rpcrdma_ia *ia);void rpcrdma_ia_close (struct rpcrdma_ia *);bool frwr_is_supported (struct rpcrdma_ia *); -bool fmr_is_supported (struct rpcrdma_ia *);extern struct workqueue_struct *rpcrdma_receive_wq;