public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
To: "maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org"
	<maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
	<dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: "israelr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org"
	<israelr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCHv2 1/1] IB/srp: fix invalid indirect_sg_entries parameter value
Date: Wed, 4 Jan 2017 15:09:38 +0000	[thread overview]
Message-ID: <1483542561.3048.13.camel@sandisk.com> (raw)
In-Reply-To: <1483538377-19379-2-git-send-email-maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

On Wed, 2017-01-04 at 15:59 +0200, Max Gurtovoy wrote:
> From: Israel Rukshin <israelr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> After setting indirect_sg_entries module_param to huge value (e.g 500,000),
> srp_alloc_req_data() fails to allocate indirect descriptors for the request
> ring (kmalloc fails). This commit enforces the maximum value of indirect_sg_entries
> to be SG_MAX_SEGMENTS as signified in module param description.
> 
> Signed-off-by: Israel Rukshin <israelr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Max Gurtovoy <maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/ulp/srp/ib_srp.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
> index 0f67cf9..79bf484 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.c
> +++ b/drivers/infiniband/ulp/srp/ib_srp.c
> @@ -3699,6 +3699,12 @@ static int __init srp_init_module(void)
>  		indirect_sg_entries = cmd_sg_entries;
>  	}
>  
> +	if (indirect_sg_entries > SG_MAX_SEGMENTS) {
> +		pr_warn("Clamping indirect_sg_entries to %u\n",
> +			SG_MAX_SEGMENTS);
> +		indirect_sg_entries = SG_MAX_SEGMENTS;
> +	}
> +
>  	srp_remove_wq = create_workqueue("srp_remove");
>  	if (!srp_remove_wq) {
>  		ret = -ENOMEM;

Thanks!

Reviewed-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-01-04 15:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04 13:59 [PATCHv2 0/1] fix invalid indirect_sg_entries parameter value Max Gurtovoy
     [not found] ` <1483538377-19379-1-git-send-email-maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-01-04 13:59   ` [PATCHv2 1/1] IB/srp: " Max Gurtovoy
     [not found]     ` <1483538377-19379-2-git-send-email-maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-01-04 14:33       ` Laurence Oberman
2017-01-04 15:09       ` Bart Van Assche [this message]
     [not found]         ` <1483542561.3048.13.camel-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2017-01-24 16:32           ` Doug Ledford
     [not found]             ` <1485275572.43764.27.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-01-24 16:50               ` Max Gurtovoy

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=1483542561.3048.13.camel@sandisk.com \
    --to=bart.vanassche-xdaiopvojttbdgjk7y7tuq@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=israelr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /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