xref: /linux/fs/smb/server/transport_rdma.h (revision 03f76ddff5b04a808ae16c06418460151e2fdd4b)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  *   Copyright (C) 2017, Microsoft Corporation.
4  *   Copyright (C) 2018, LG Electronics.
5  */
6 
7 #ifndef __KSMBD_TRANSPORT_RDMA_H__
8 #define __KSMBD_TRANSPORT_RDMA_H__
9 
10 #define SMBD_DEFAULT_IOSIZE (8 * 1024 * 1024)
11 #define SMBD_MIN_IOSIZE (512 * 1024)
12 #define SMBD_MAX_IOSIZE (16 * 1024 * 1024)
13 
14 #ifdef CONFIG_SMB_SERVER_SMBDIRECT
15 int ksmbd_rdma_init(void);
16 void ksmbd_rdma_stop_listening(void);
17 void ksmbd_rdma_destroy(void);
18 bool ksmbd_rdma_capable_netdev(struct net_device *netdev);
19 void init_smbd_max_io_size(unsigned int sz);
20 unsigned int get_smbd_max_read_write_size(struct ksmbd_transport *kt);
21 #else
22 static inline int ksmbd_rdma_init(void) { return 0; }
23 static inline void ksmbd_rdma_stop_listening(void) { }
24 static inline void ksmbd_rdma_destroy(void) { }
25 static inline bool ksmbd_rdma_capable_netdev(struct net_device *netdev) { return false; }
26 static inline void init_smbd_max_io_size(unsigned int sz) { }
27 static inline unsigned int get_smbd_max_read_write_size(struct ksmbd_transport *kt) { return 0; }
28 #endif
29 
30 #endif /* __KSMBD_TRANSPORT_RDMA_H__ */
31