Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 3/3] nvmet-rdma: add module parameter for SRQ size
Date: Wed, 6 Sep 2017 12:39:34 +0200	[thread overview]
Message-ID: <20170906103934.GC24667@lst.de> (raw)
In-Reply-To: <1504609157-3004-4-git-send-email-maxg@mellanox.com>

On Tue, Sep 05, 2017@01:59:17PM +0300, Max Gurtovoy wrote:
> Adjust SRQ size according to the expected load. Make sure the
> size is >= 256 to avoid lack of resources.
> 
> Signed-off-by: Max Gurtovoy <maxg at mellanox.com>
> ---
>  drivers/nvme/target/rdma.c |   23 ++++++++++++++++++++++-
>  1 files changed, 22 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
> index 1b52080..34868ad 100644
> --- a/drivers/nvme/target/rdma.c
> +++ b/drivers/nvme/target/rdma.c
> @@ -134,6 +134,16 @@ struct nvmet_rdma_device {
>  module_param_named(use_srq, nvmet_rdma_use_srq, bool, 0444);
>  MODULE_PARM_DESC(use_srq, "Use shared receive queue.");
>  
> +static int srq_size_set(const char *val, const struct kernel_param *kp);
> +static const struct kernel_param_ops srq_size_ops = {
> +	.set = srq_size_set,
> +	.get = param_get_int,
> +};
> +
> +static int nvmet_rdma_srq_size = 4095;
> +module_param_cb(srq_size, &srq_size_ops, &nvmet_rdma_srq_size, 0644);
> +MODULE_PARM_DESC(srq_size, "set Shared Receive Queue (SRQ) size, should >= 256 (default: 4095)");
> +
>  static DEFINE_IDA(nvmet_rdma_queue_ida);
>  static LIST_HEAD(nvmet_rdma_queue_list);
>  static DEFINE_MUTEX(nvmet_rdma_queue_mutex);
> @@ -150,6 +160,17 @@ struct nvmet_rdma_device {
>  
>  static struct nvmet_fabrics_ops nvmet_rdma_ops;
>  
> +static int srq_size_set(const char *val, const struct kernel_param *kp)
> +{
> +	int n = 0, ret;
> +
> +	ret = kstrtoint(val, 10, &n);
> +	if (ret != 0 || n < 256)
> +		return -EINVAL;
> +
> +	return param_set_int(val, kp);
> +}

Can you add a new param_set_int_minmax helper to the core module code
instead of having do duplicate this sort of logic in all kinds of drivers?

Otherwise this looks fine to me.

  reply	other threads:[~2017-09-06 10:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05 10:59 [PATCH 0/3] nvmet-rdma: SRQ per completion vector Max Gurtovoy
2017-09-05 10:59 ` [PATCH 1/3] nvmet-rdma: use srq pointer in rdma_cmd Max Gurtovoy
2017-09-06 10:30   ` Christoph Hellwig
2017-09-05 10:59 ` [PATCH 2/3] nvmet-rdma: use SRQ per completion vector Max Gurtovoy
2017-09-06 10:38   ` Christoph Hellwig
2017-09-06 14:57     ` Sagi Grimberg
2017-09-07 12:03       ` Christoph Hellwig
2017-09-06 14:50   ` Sagi Grimberg
2017-09-07 10:47     ` Max Gurtovoy
2017-09-05 10:59 ` [PATCH 3/3] nvmet-rdma: add module parameter for SRQ size Max Gurtovoy
2017-09-06 10:39   ` Christoph Hellwig [this message]
2017-09-06 15:02   ` Sagi Grimberg
2017-09-06 14:40 ` [PATCH 0/3] nvmet-rdma: SRQ per completion vector Sagi Grimberg
2017-11-07 14:40 ` Max Gurtovoy
2017-11-08 10:07   ` Sagi Grimberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170906103934.GC24667@lst.de \
    --to=hch@lst.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox