RDMA/srp: add module parameter 'has_max_it_iu_size'
Subsystems (2)
PATCH 1/1 RDMA/srp: add module parameter 'has_max_it_iu_size'
From: Honggang Li <[email protected]>
commit 882981f4a411 ("RDMA/srp: Add support for immediate data") commit 547ed331bbe8 ("RDMA/srp: Add parse function for maximum initiator to target IU size")
The use_imm_data kernel module parameter was introduced in kernel v5.0 (882981f4a411). The max_it_iu_size will be introduced in kernel v5.5 (547ed331bbe8).
We need the 'max_it_iu_size' for old SRPT, which does not support immediate data.
The ib_srp module will emit a warning message of unknown parameter, if we blindly append the 'max_it_iu_size' at the very end of login string for kernel before 547ed331bbe8.
With this flag, srp_daemon will know the 'max_it_iu_size' login option is available or not, by checking the file [1].
[1] /sys/module/ib_srp/parameters/has_max_it_iu_size
--- drivers/infiniband/ulp/srp/ib_srp.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/infiniband/ulp/srp/ib_srp.c +5 -0
@@ -74,6 +74,7 @@ static bool allow_ext_sg;static bool prefer_fr = true;static bool register_always = true;static bool never_register; +static bool has_max_it_iu_size = true;static int topspin_workarounds =1 ;module_param (srp_sg_tablesize, uint,0444 );
@@ -103,6 +104,10 @@ module_param(register_always, bool, 0444);MODULE_PARM_DESC (register_always,"Use memory registration even for contiguous memory regions" ); +module_param (has_max_it_iu_size, bool,0444 ); +MODULE_PARM_DESC (has_max_it_iu_size, +"Indicate the module supports max_it_iu_size login parameter" ); +module_param (never_register, bool,0444 );MODULE_PARM_DESC (never_register,"Never register memory" );
Signature · 1 line
2.21.0
Bart Van Assche
maintainerdrivers/infiniband/ulp/srp/ib_srp.c module_param(register_always, bool, 0444); · line 109
Quoted 3 lines · Honggang LI
drivers/infiniband/ulp/srp/ib_srp.c +3
-0+module_param (has_max_it_iu_size, bool,0444 ); +MODULE_PARM_DESC (has_max_it_iu_size, +"Indicate the module supports max_it_iu_size login parameter" );
Since the approach of this patch requires to add one new kernel parameter every time a new login parameter is added, I don't think this approach is future-proof. Has it been considered to export a list of all supported login parameters to user space?
Thanks,
Bart.
Quoted 9 lines · Bart Van Assche
drivers/infiniband/ulp/srp/ib_srp.c module_param(register_always, bool, 0444); · line 109
Quoted 3 lines · Honggang LI
drivers/infiniband/ulp/srp/ib_srp.c +3
-0+module_param (has_max_it_iu_size, bool,0444 ); +MODULE_PARM_DESC (has_max_it_iu_size, +"Indicate the module supports max_it_iu_size login parameter" );Since the approach of this patch requires to add one new kernel parameter every time a new login parameter is added, I don't think this approach is future-proof. Has it been considered to export a list of all supported login parameters to user space?
ok, I will drop this patch and usespace v2 srp_daemon patch.
thanks