From: Stefan Metzmacher Date: Thu, 28 Aug 2025 14:59:00 +0000 (+0200) Subject: smb: client: make use of smbdirect_frwr_is_supported() X-Git-Tag: v7.1-rc1~128^2~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f9055aa9c8c16c7a9e185e35257dbee3852d42f;p=thirdparty%2Fkernel%2Flinux.git smb: client: make use of smbdirect_frwr_is_supported() This an exact copy of frwr_is_supported(). Cc: Steve French Cc: Tom Talpey Cc: Long Li Cc: Namjae Jeon Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Signed-off-by: Stefan Metzmacher Acked-by: Namjae Jeon Signed-off-by: Steve French --- diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c index 8fa9621d3f231..ba002060fed0d 100644 --- a/fs/smb/client/smbdirect.c +++ b/fs/smb/client/smbdirect.c @@ -922,20 +922,6 @@ out: return ERR_PTR(rc); } -/* - * Test if FRWR (Fast Registration Work Requests) is supported on the device - * This implementation requires FRWR on RDMA read/write - * return value: true if it is supported - */ -static bool frwr_is_supported(struct ib_device_attr *attrs) -{ - if (!(attrs->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS)) - return false; - if (attrs->max_fast_reg_page_list_len == 0) - return false; - return true; -} - static int smbd_ia_open( struct smbdirect_socket *sc, struct sockaddr *dstaddr, int port) @@ -953,7 +939,7 @@ static int smbd_ia_open( } sc->ib.dev = sc->rdma.cm_id->device; - if (!frwr_is_supported(&sc->ib.dev->attrs)) { + if (!smbdirect_frwr_is_supported(&sc->ib.dev->attrs)) { log_rdma_event(ERR, "Fast Registration Work Requests (FRWR) is not supported\n"); log_rdma_event(ERR, "Device capability flags = %llx max_fast_reg_page_list_len = %u\n", sc->ib.dev->attrs.device_cap_flags,