diff mbox series

[linux-next] RDMA/srp: add module parameter 'has_max_it_iu_size'

Message ID 20191025132318.13906-1-honli@redhat.com (mailing list archive)
State Changes Requested
Headers show
Series [linux-next] RDMA/srp: add module parameter 'has_max_it_iu_size' | expand

Commit Message

Honggang LI Oct. 25, 2019, 1:23 p.m. UTC
From: Honggang Li <honli@redhat.com>

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

Signed-off-by: Honggang Li <honli@redhat.com>
---
 drivers/infiniband/ulp/srp/ib_srp.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Bart Van Assche Oct. 26, 2019, 2:10 a.m. UTC | #1
On 2019-10-25 06:23, Honggang LI wrote:
> +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.
Honggang LI Oct. 29, 2019, 6:47 a.m. UTC | #2
On Fri, Oct 25, 2019 at 07:10:44PM -0700, Bart Van Assche wrote:
> On 2019-10-25 06:23, Honggang LI wrote:
> > +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
diff mbox series

Patch

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index b7f7a5f7bd98..96434f743a91 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -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");