[PATCH 2/2] ib_srpt: Make srpt_srq_size module parameter use S_IRUGO|S_IWUSR
From: Nicholas Bellinger n...@linux-iscsi.org This patch converts the srpt_srq_size module parameter to R/W access so that it's accessable when built as CONFIG_INFINIBAND_SRPT=y. This parameter is only referenced within srpt_add_one() directly to set srpt_device-srq_size. Reported-by: Bart Van Assche bvanass...@acm.org Cc: Bart Van Assche bvanass...@acm.org Cc: Roland Dreier rol...@purestorage.com Signed-off-by: Nicholas Bellinger n...@linux-iscsi.org --- drivers/infiniband/ulp/srpt/ib_srpt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 94e6aff..43a17e3 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -84,7 +84,7 @@ MODULE_PARM_DESC(srp_max_req_size, Maximum size of SRP request messages in bytes.); static int srpt_srq_size = DEFAULT_SRPT_SRQ_SIZE; -module_param(srpt_srq_size, int, 0444); +module_param(srpt_srq_size, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(srpt_srq_size, Shared receive queue (SRQ) size.); -- 1.7.2.5 -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] ib_srpt: Make srpt_srq_size module parameter use S_IRUGO|S_IWUSR
On Sun, Nov 6, 2011 at 12:15 PM, Nicholas A. Bellinger n...@linux-iscsi.org wrote: This patch converts the srpt_srq_size module parameter to R/W access so that it's accessable when built as CONFIG_INFINIBAND_SRPT=y. This parameter is only referenced within srpt_add_one() directly to set srpt_device-srq_size. Reported-by: Bart Van Assche bvanass...@acm.org Cc: Bart Van Assche bvanass...@acm.org Cc: Roland Dreier rol...@purestorage.com Signed-off-by: Nicholas Bellinger n...@linux-iscsi.org --- drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 94e6aff..43a17e3 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -84,7 +84,7 @@ MODULE_PARM_DESC(srp_max_req_size, Maximum size of SRP request messages in bytes.); static int srpt_srq_size = DEFAULT_SRPT_SRQ_SIZE; -module_param(srpt_srq_size, int, 0444); +module_param(srpt_srq_size, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(srpt_srq_size, Shared receive queue (SRQ) size.); This patch makes it possible to set srpt_srq_size to values that are so low that communication becomes impossible. Attempts to set srpt_srq_size below MIN_SRPT_SRQ_SIZE should either be blocked or the modification shown should be added to the above patch: -sdev-srq_size = min(srpt_srq_size, sdev-dev_attr.max_srq_wr); +sdev-srq_size = min(max(srpt_srq_size, MIN_SRPT_SRQ_SIZE), sdev-dev_attr.max_srq_wr); Bart. -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] ib_srpt: Make srpt_srq_size module parameter use S_IRUGO|S_IWUSR
On Sun, 2011-11-06 at 12:40 +0100, Bart Van Assche wrote: On Sun, Nov 6, 2011 at 12:15 PM, Nicholas A. Bellinger n...@linux-iscsi.org wrote: This patch converts the srpt_srq_size module parameter to R/W access so that it's accessable when built as CONFIG_INFINIBAND_SRPT=y. This parameter is only referenced within srpt_add_one() directly to set srpt_device-srq_size. Reported-by: Bart Van Assche bvanass...@acm.org Cc: Bart Van Assche bvanass...@acm.org Cc: Roland Dreier rol...@purestorage.com Signed-off-by: Nicholas Bellinger n...@linux-iscsi.org --- drivers/infiniband/ulp/srpt/ib_srpt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 94e6aff..43a17e3 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -84,7 +84,7 @@ MODULE_PARM_DESC(srp_max_req_size, Maximum size of SRP request messages in bytes.); static int srpt_srq_size = DEFAULT_SRPT_SRQ_SIZE; -module_param(srpt_srq_size, int, 0444); +module_param(srpt_srq_size, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(srpt_srq_size, Shared receive queue (SRQ) size.); This patch makes it possible to set srpt_srq_size to values that are so low that communication becomes impossible. Attempts to set srpt_srq_size below MIN_SRPT_SRQ_SIZE should either be blocked or the modification shown should be added to the above patch: -sdev-srq_size = min(srpt_srq_size, sdev-dev_attr.max_srq_wr); +sdev-srq_size = min(max(srpt_srq_size, MIN_SRPT_SRQ_SIZE), sdev-dev_attr.max_srq_wr); Fixed. Thanks, --nab -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html