30
30
#include "cifsproto.h"
31
31
#include "cifs_debug.h"
32
32
#include "cifsfs.h"
33
+ #ifdef CONFIG_CIFS_SMB_DIRECT
34
+ #include "smbdirect.h"
35
+ #endif
33
36
34
37
void
35
38
cifs_dump_mem (char * label , void * data , int length )
@@ -376,6 +379,54 @@ static const struct file_operations cifs_stats_proc_fops = {
376
379
};
377
380
#endif /* STATS */
378
381
382
+ #ifdef CONFIG_CIFS_SMB_DIRECT
383
+ #define PROC_FILE_DEFINE (name ) \
384
+ static ssize_t name##_write(struct file *file, const char __user *buffer, \
385
+ size_t count, loff_t *ppos) \
386
+ { \
387
+ int rc; \
388
+ rc = kstrtoint_from_user(buffer, count, 10, & name); \
389
+ if (rc) \
390
+ return rc; \
391
+ return count; \
392
+ } \
393
+ static int name##_proc_show(struct seq_file *m, void *v) \
394
+ { \
395
+ seq_printf(m, "%d\n", name ); \
396
+ return 0; \
397
+ } \
398
+ static int name##_open(struct inode *inode, struct file *file) \
399
+ { \
400
+ return single_open(file, name##_proc_show, NULL); \
401
+ } \
402
+ \
403
+ static const struct file_operations cifs_##name##_proc_fops = { \
404
+ .open = name##_open, \
405
+ .read = seq_read, \
406
+ .llseek = seq_lseek, \
407
+ .release = single_release, \
408
+ .write = name##_write, \
409
+ }
410
+
411
+ extern int rdma_readwrite_threshold ;
412
+ extern int smbd_max_frmr_depth ;
413
+ extern int smbd_keep_alive_interval ;
414
+ extern int smbd_max_receive_size ;
415
+ extern int smbd_max_fragmented_recv_size ;
416
+ extern int smbd_max_send_size ;
417
+ extern int smbd_send_credit_target ;
418
+ extern int smbd_receive_credit_max ;
419
+
420
+ PROC_FILE_DEFINE (rdma_readwrite_threshold );
421
+ PROC_FILE_DEFINE (smbd_max_frmr_depth );
422
+ PROC_FILE_DEFINE (smbd_keep_alive_interval );
423
+ PROC_FILE_DEFINE (smbd_max_receive_size );
424
+ PROC_FILE_DEFINE (smbd_max_fragmented_recv_size );
425
+ PROC_FILE_DEFINE (smbd_max_send_size );
426
+ PROC_FILE_DEFINE (smbd_send_credit_target );
427
+ PROC_FILE_DEFINE (smbd_receive_credit_max );
428
+ #endif
429
+
379
430
static struct proc_dir_entry * proc_fs_cifs ;
380
431
static const struct file_operations cifsFYI_proc_fops ;
381
432
static const struct file_operations cifs_lookup_cache_proc_fops ;
@@ -403,6 +454,24 @@ cifs_proc_init(void)
403
454
& cifs_security_flags_proc_fops );
404
455
proc_create ("LookupCacheEnabled" , 0 , proc_fs_cifs ,
405
456
& cifs_lookup_cache_proc_fops );
457
+ #ifdef CONFIG_CIFS_SMB_DIRECT
458
+ proc_create ("rdma_readwrite_threshold" , 0 , proc_fs_cifs ,
459
+ & cifs_rdma_readwrite_threshold_proc_fops );
460
+ proc_create ("smbd_max_frmr_depth" , 0 , proc_fs_cifs ,
461
+ & cifs_smbd_max_frmr_depth_proc_fops );
462
+ proc_create ("smbd_keep_alive_interval" , 0 , proc_fs_cifs ,
463
+ & cifs_smbd_keep_alive_interval_proc_fops );
464
+ proc_create ("smbd_max_receive_size" , 0 , proc_fs_cifs ,
465
+ & cifs_smbd_max_receive_size_proc_fops );
466
+ proc_create ("smbd_max_fragmented_recv_size" , 0 , proc_fs_cifs ,
467
+ & cifs_smbd_max_fragmented_recv_size_proc_fops );
468
+ proc_create ("smbd_max_send_size" , 0 , proc_fs_cifs ,
469
+ & cifs_smbd_max_send_size_proc_fops );
470
+ proc_create ("smbd_send_credit_target" , 0 , proc_fs_cifs ,
471
+ & cifs_smbd_send_credit_target_proc_fops );
472
+ proc_create ("smbd_receive_credit_max" , 0 , proc_fs_cifs ,
473
+ & cifs_smbd_receive_credit_max_proc_fops );
474
+ #endif
406
475
}
407
476
408
477
void
@@ -420,6 +489,16 @@ cifs_proc_clean(void)
420
489
remove_proc_entry ("SecurityFlags" , proc_fs_cifs );
421
490
remove_proc_entry ("LinuxExtensionsEnabled" , proc_fs_cifs );
422
491
remove_proc_entry ("LookupCacheEnabled" , proc_fs_cifs );
492
+ #ifdef CONFIG_CIFS_SMB_DIRECT
493
+ remove_proc_entry ("rdma_readwrite_threshold" , proc_fs_cifs );
494
+ remove_proc_entry ("smbd_max_frmr_depth" , proc_fs_cifs );
495
+ remove_proc_entry ("smbd_keep_alive_interval" , proc_fs_cifs );
496
+ remove_proc_entry ("smbd_max_receive_size" , proc_fs_cifs );
497
+ remove_proc_entry ("smbd_max_fragmented_recv_size" , proc_fs_cifs );
498
+ remove_proc_entry ("smbd_max_send_size" , proc_fs_cifs );
499
+ remove_proc_entry ("smbd_send_credit_target" , proc_fs_cifs );
500
+ remove_proc_entry ("smbd_receive_credit_max" , proc_fs_cifs );
501
+ #endif
423
502
remove_proc_entry ("fs/cifs" , NULL );
424
503
}
425
504
0 commit comments