public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: "Dalessandro, Dennis" <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: "dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
	<dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: "Chegondi,
	Harish" <harish.chegondi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"Haralanov,
	Mitko" <mitko.haralanov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"John,
	Jubin" <jubin.john-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org"
	<dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 2/5] IB/hfi1: Fix AHG KDETH Intr shift
Date: Wed, 31 Aug 2016 15:26:35 +0000	[thread overview]
Message-ID: <1472657193.2332.1.camel@intel.com> (raw)
In-Reply-To: <20160831142425.27232.97663.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>

This patch should say:

From: Jubin John <jubin.john@intel.com>

Not sure why it got cut off. Let me know if you want a v2 or if you
just want to tack that on yourself.

-Denny


On Wed, 2016-08-31 at 07:24 -0700, Dennis Dalessandro wrote:
> In the set_txreq_header_ahg(), The KDETH Intr bit is obtained from
> the
> header in the user sdma request using a KDETH_GET shift and mask
> macro.
> This value is then futher right shifted by 16 causing us to lose the
> value i.e it is shifted to zero, leading to the following
> smatch warning:
> drivers/infiniband/hw/hfi1/user_sdma.c:1482 set_txreq_header_ahg()
> warn: mask and shift to zero
> 
> The Intr bit should be left shifted into its correct position in the
> KDETH header before the AHG update.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Reviewed-by: Mitko Haralanov <mitko.haralanov@intel.com>
> Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
> Signed-off-by: Jubin John <jubin.john@intel.com>
> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
> ---
>  drivers/infiniband/hw/hfi1/user_sdma.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c
> b/drivers/infiniband/hw/hfi1/user_sdma.c
> index 0ecf279..1694037 100644
> --- a/drivers/infiniband/hw/hfi1/user_sdma.c
> +++ b/drivers/infiniband/hw/hfi1/user_sdma.c
> @@ -114,6 +114,8 @@ MODULE_PARM_DESC(sdma_comp_size, "Size of User
> SDMA completion ring. Default: 12
>  #define KDETH_HCRC_LOWER_SHIFT    24
>  #define KDETH_HCRC_LOWER_MASK     0xff
>  
> +#define AHG_KDETH_INTR_SHIFT 12
> +
>  #define PBC2LRH(x) ((((x) & 0xfff) << 2) - 4)
>  #define LRH2PBC(x) ((((x) >> 2) + 1) & 0xfff)
>  
> @@ -1480,7 +1482,8 @@ static int set_txreq_header_ahg(struct
> user_sdma_request *req,
>  		/* Clear KDETH.SH on last packet */
>  		if (unlikely(tx->flags & TXREQ_FLAGS_REQ_LAST_PKT))
> {
>  			val |= cpu_to_le16(KDETH_GET(hdr-
> >kdeth.ver_tid_offset,
> -								INTR
> ) >> 16);
> +						     INTR) <<
> +					   AHG_KDETH_INTR_SHIFT);
>  			val &= cpu_to_le16(~(1U << 13));
>  			AHG_HEADER_SET(req->ahg, diff, 7, 16, 14,
> val);
>  		} else {
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" 
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-08-31 15:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 14:24 [PATCH 0/5] IB/hfi1: For 4.8 rc 5 Dennis Dalessandro
     [not found] ` <20160831141841.27232.61621.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-08-31 14:24   ` [PATCH 1/5] IB/hfi1: Fix SGE length for misaligned PIO copy Dennis Dalessandro
2016-08-31 14:24   ` [PATCH 2/5] IB/hfi1: Fix AHG KDETH Intr shift Dennis Dalessandro
     [not found]     ` <20160831142425.27232.97663.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-08-31 15:26       ` Dalessandro, Dennis [this message]
2016-08-31 14:24   ` [PATCH 3/5] IB/hfi1: Add QSFP sanity pre-check Dennis Dalessandro
2016-08-31 14:24   ` [PATCH 4/5] IB/hfi1: Make n_krcvqs be an unsigned long integer Dennis Dalessandro
2016-08-31 14:24   ` [PATCH 5/5] IB/hfi1: Rework debugfs to use SRCU Dennis Dalessandro
2016-09-02 18:33   ` [PATCH 0/5] IB/hfi1: For 4.8 rc 5 Doug Ledford

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=1472657193.2332.1.camel@intel.com \
    --to=dennis.dalessandro-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=harish.chegondi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=jubin.john-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mitko.haralanov-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