xref: /linux/fs/smb/server/transport_rdma.h (revision 8ab992f815d6736b5c7a6f5fd7bfe7bc106bb3dc)
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 bool ksmbd_rdma_capable_netdev(struct net_device *netdev);
18 void init_smbd_max_io_size(unsigned int sz);
19 unsigned int get_smbd_max_read_write_size(struct ksmbd_transport *kt);
20 #else
ksmbd_rdma_init(void)21 static inline int ksmbd_rdma_init(void) { return 0; }
ksmbd_rdma_stop_listening(void)22 static inline void ksmbd_rdma_stop_listening(void) { }
ksmbd_rdma_capable_netdev(struct net_device * netdev)23 static inline bool ksmbd_rdma_capable_netdev(struct net_device *netdev) { return false; }
init_smbd_max_io_size(unsigned int sz)24 static inline void init_smbd_max_io_size(unsigned int sz) { }
get_smbd_max_read_write_size(struct ksmbd_transport * kt)25 static inline unsigned int get_smbd_max_read_write_size(struct ksmbd_transport *kt) { return 0; }
26 #endif
27 
28 #include <linux/smbdirect.h>
29 
30 #endif /* __KSMBD_TRANSPORT_RDMA_H__ */
31