From: Greg KH <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
To: Jubin John <jubin.john-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH RESEND 10/11] staging/rdma/hfi1: Eliminate WARN_ON when VL is invalid
Date: Fri, 6 Nov 2015 19:26:14 -0800 [thread overview]
Message-ID: <20151107032614.GB4920@kroah.com> (raw)
In-Reply-To: <1446858426-30509-11-git-send-email-jubin.john-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
On Fri, Nov 06, 2015 at 08:07:05PM -0500, Jubin John wrote:
> From: Ira Weiny <iweiny-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> sdma_select_engine_vl only needs to protect itself from an invalid VL.
> Something higher up the stack should be warning the user when they try
> to use an SL which maps to an invalid VL.
>
> Reviewed-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Reviewed-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Reviewed-by: Kaike Wan <kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Ira Weiny <iweiny-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Jubin John <jubin.john-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
> drivers/staging/rdma/hfi1/sdma.c | 12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rdma/hfi1/sdma.c b/drivers/staging/rdma/hfi1/sdma.c
> index 2a1da21..998bf43 100644
> --- a/drivers/staging/rdma/hfi1/sdma.c
> +++ b/drivers/staging/rdma/hfi1/sdma.c
> @@ -777,8 +777,14 @@ struct sdma_engine *sdma_select_engine_vl(
> struct sdma_map_elem *e;
> struct sdma_engine *rval;
>
> - if (WARN_ON(vl > 8))
> - return NULL;
> + /* NOTE This should only happen if SC->VL changed after the initial
> + * checks on the QP/AH
> + * Default will return engine 0 below
> + */
> + if (unlikely(vl >= num_vls)) {
Can you prove that unlikely() makes a measured difference here? If not,
please remove it. If you can, please provide the proof in the changelog
when you resend it.
thanks,
greg k-h
--
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
next prev parent reply other threads:[~2015-11-07 3:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-07 1:06 [PATCH RESEND 00/11] staging/rdma/hfi1: Miscellaneous Fixes Jubin John
[not found] ` <1446858426-30509-1-git-send-email-jubin.john-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-11-07 1:06 ` [PATCH RESEND 01/11] staging/rdma/hfi1: Convert dd_dev_info() to hfi1_cdbg() in process startup Jubin John
2015-11-07 1:06 ` [PATCH RESEND 02/11] staging/rdma/hfi1: Clear the QSFP reset that is asserted on FLR Jubin John
2015-11-07 1:06 ` [PATCH RESEND 03/11] staging/rdma/hfi1: Enable WFR PCIe extended tags from the driver Jubin John
2015-11-07 1:06 ` [PATCH RESEND 04/11] staging/rdma/hfi1: Always download SBus firmware Jubin John
2015-11-07 1:07 ` [PATCH RESEND 05/11] staging/rdma/hfi1: Disable thermal polling before sensor initialization Jubin John
2015-11-07 1:07 ` [PATCH RESEND 06/11] staging/rdma/hfi1: Select only devices with active links Jubin John
2015-11-07 1:07 ` [PATCH RESEND 07/11] staging/rdma/hfi1: Fix for opaportconfig ledon by not checking for portNum Jubin John
2015-11-07 1:07 ` [PATCH RESEND 08/11] staging/rdma/hfi1: Remove spurious error messages Jubin John
2015-11-07 1:07 ` [PATCH RESEND 09/11] staging/rdma/hfi1: use one-shot LCB write Jubin John
2015-11-07 1:07 ` [PATCH RESEND 10/11] staging/rdma/hfi1: Eliminate WARN_ON when VL is invalid Jubin John
[not found] ` <1446858426-30509-11-git-send-email-jubin.john-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-11-07 3:26 ` Greg KH [this message]
[not found] ` <20151107032614.GB4920-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-11-10 0:04 ` Jubin John
2015-11-07 1:07 ` [PATCH RESEND 11/11] staging/rdma/hfi1: Workaround to prevent corruption during packet delivery Jubin John
2015-11-07 3:25 ` Greg KH
[not found] ` <20151107032531.GA4920-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-11-10 0:01 ` Jubin John
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=20151107032614.GB4920@kroah.com \
--to=gregkh-hqyy1w1ycw8ekmwlsbkhg0b+6bgklq7r@public.gmane.org \
--cc=devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=jubin.john-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@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;
as well as URLs for NNTP newsgroup(s).