File tree Expand file tree Collapse file tree 4 files changed +18
-2
lines changed Expand file tree Collapse file tree 4 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,8 @@ struct ksmbd_startup_request {
104
104
*/
105
105
__u32 sub_auth [3 ]; /* Subauth value for Security ID */
106
106
__u32 smb2_max_credits ; /* MAX credits */
107
- __u32 reserved [128 ]; /* Reserved room */
107
+ __u32 smbd_max_io_size ; /* smbd read write size */
108
+ __u32 reserved [127 ]; /* Reserved room */
108
109
__u32 ifc_list_sz ; /* interfaces list size */
109
110
__s8 ____payload [];
110
111
};
Original file line number Diff line number Diff line change 26
26
#include "mgmt/ksmbd_ida.h"
27
27
#include "connection.h"
28
28
#include "transport_tcp.h"
29
+ #include "transport_rdma.h"
29
30
30
31
#define IPC_WAIT_TIMEOUT (2 * HZ)
31
32
@@ -303,6 +304,8 @@ static int ipc_server_config_on_startup(struct ksmbd_startup_request *req)
303
304
init_smb2_max_trans_size (req -> smb2_max_trans );
304
305
if (req -> smb2_max_credits )
305
306
init_smb2_max_credits (req -> smb2_max_credits );
307
+ if (req -> smbd_max_io_size )
308
+ init_smbd_max_io_size (req -> smbd_max_io_size );
306
309
307
310
ret = ksmbd_set_netbios_name (req -> netbios_name );
308
311
ret |= ksmbd_set_server_string (req -> server_string );
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ static int smb_direct_max_fragmented_recv_size = 1024 * 1024;
80
80
/* The maximum single-message size which can be received */
81
81
static int smb_direct_max_receive_size = 8192 ;
82
82
83
- static int smb_direct_max_read_write_size = 8 * 1024 * 1024 ;
83
+ static int smb_direct_max_read_write_size = SMBD_DEFAULT_IOSIZE ;
84
84
85
85
static LIST_HEAD (smb_direct_device_list );
86
86
static DEFINE_RWLOCK (smb_direct_device_lock );
@@ -214,6 +214,12 @@ struct smb_direct_rdma_rw_msg {
214
214
struct scatterlist sg_list [];
215
215
};
216
216
217
+ void init_smbd_max_io_size (unsigned int sz )
218
+ {
219
+ sz = clamp_val (sz , SMBD_MIN_IOSIZE , SMBD_MAX_IOSIZE );
220
+ smb_direct_max_read_write_size = sz ;
221
+ }
222
+
217
223
static inline int get_buf_page_count (void * buf , int size )
218
224
{
219
225
return DIV_ROUND_UP ((uintptr_t )buf + size , PAGE_SIZE ) -
Original file line number Diff line number Diff line change 7
7
#ifndef __KSMBD_TRANSPORT_RDMA_H__
8
8
#define __KSMBD_TRANSPORT_RDMA_H__
9
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
+
10
14
/* SMB DIRECT negotiation request packet [MS-SMBD] 2.2.1 */
11
15
struct smb_direct_negotiate_req {
12
16
__le16 min_version ;
@@ -52,10 +56,12 @@ struct smb_direct_data_transfer {
52
56
int ksmbd_rdma_init (void );
53
57
void ksmbd_rdma_destroy (void );
54
58
bool ksmbd_rdma_capable_netdev (struct net_device * netdev );
59
+ void init_smbd_max_io_size (unsigned int sz );
55
60
#else
56
61
static inline int ksmbd_rdma_init (void ) { return 0 ; }
57
62
static inline int ksmbd_rdma_destroy (void ) { return 0 ; }
58
63
static inline bool ksmbd_rdma_capable_netdev (struct net_device * netdev ) { return false; }
64
+ static inline void init_smbd_max_io_size (unsigned int sz ) { }
59
65
#endif
60
66
61
67
#endif /* __KSMBD_TRANSPORT_RDMA_H__ */
You can’t perform that action at this time.
0 commit comments