public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
Cc: 'Doug Ledford' <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH rdma-next] RDMA/cxgb4: Remove unnecessary conversion from __be32 to cpu format
Date: Tue, 24 Oct 2017 21:59:56 +0300	[thread overview]
Message-ID: <20171024185956.GL16127@mtr-leonro.local> (raw)
In-Reply-To: <067301d34cf7$d0872ff0$71958fd0$@opengridcomputing.com>

[-- Attachment #1: Type: text/plain, Size: 2531 bytes --]

On Tue, Oct 24, 2017 at 01:42:16PM -0500, Steve Wise wrote:
> >
> > The scqe.stag is actually declared in u32 format and don't need
> > conversion from __be32 to cpu format.
> >
> > Remove the be32_to_cpu() and avoid the following sparse error.
> >   drivers/infiniband/hw/cxgb4/cq.c:754:52: warning: cast to restricted __be32
> >
> > Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
> > Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> > ---
> >  drivers/infiniband/hw/cxgb4/t4.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/infiniband/hw/cxgb4/t4.h
> b/drivers/infiniband/hw/cxgb4/t4.h
> > index 2b44fa850bbb..a16f3596f5a8 100644
> > --- a/drivers/infiniband/hw/cxgb4/t4.h
> > +++ b/drivers/infiniband/hw/cxgb4/t4.h
> > @@ -234,7 +234,7 @@ struct t4_cqe {
> >
> >  /* used for SQ completion processing */
> >  #define CQE_WRID_SQ_IDX(x)	((x)->u.scqe.cidx)
> > -#define CQE_WRID_FR_STAG(x)     (be32_to_cpu((x)->u.scqe.stag))
> > +#define CQE_WRID_FR_STAG(x)     ((x)->u.scqe.stag)
>
> This is incorrect.  The stag is filled in by HW which is BE.  The declaration of
> scqe.stag needs to be __be32.

So why do you declare stag as u32?

drivers/infiniband/hw/cxgb4/cq.c:
676 static int c4iw_poll_cq_one(struct c4iw_cq *chp, struct ib_wc *wc)
...
679         struct t4_cqe uninitialized_var(cqe), *rd_cqe;
...
753                                 c4iw_invalidate_mr(qhp->rhp,
754                                                    CQE_WRID_FR_STAG(&cqe));

....
drivers/infiniband/hw/cxgb4/t4.h:
162 /*
163  * CQE defs
164  */
165 struct t4_cqe {
166         __be32 header;
167         __be32 len;
168         union {
169                 struct {
170                         __be32 stag;
171                         __be32 msn;
172                 } rcqe;
173                 struct {
174                         u32 stag;
175                         u16 nada2;
176                         u16 cidx;
177                 } scqe;
178                 struct {
179                         __be32 wrid_hi;
180                         __be32 wrid_low;
181                 } gen;
182                 u64 drain_cookie;
183         } u;
184         __be64 reserved;
185         __be64 bits_type_ts;
186 };

Thanks

>
>
> --
> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-10-24 18:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24 18:28 [PATCH rdma-next] RDMA/cxgb4: Remove unnecessary conversion from __be32 to cpu format Leon Romanovsky
     [not found] ` <20171024182848.7945-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-10-24 18:42   ` Steve Wise
2017-10-24 18:59     ` Leon Romanovsky [this message]
     [not found]       ` <20171024185956.GL16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-25 14:46         ` Steve Wise
2017-10-26  5:00           ` Tom Talpey

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=20171024185956.GL16127@mtr-leonro.local \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@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