All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg-uk2M96/98Pc@public.gmane.org>
To: Dennis Dalessandro
	<dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Mike Marciniszyn
	<mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Sebastian Sanchez
	<sebastian.sanchez-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH for-next 3/6] IB/hfi1: Optimize packet type comparison using 9B and bypass code paths
Date: Thu, 1 Feb 2018 15:40:32 -0700	[thread overview]
Message-ID: <20180201224032.GC17053@ziepe.ca> (raw)
In-Reply-To: <20180201184620.5918.82548.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>

On Thu, Feb 01, 2018 at 10:46:23AM -0800, Dennis Dalessandro wrote:
>  
> +static inline bool opa_bth_is_migration(struct ib_other_headers *ohdr)
> +{
> +	return !!(ohdr->bth[1] & cpu_to_be32(OPA_BTH_MIG_REQ));
> +}
> +
>  extern const enum ib_wc_opcode ib_hfi1_wc_opcode[];
>  
>  extern const u8 hdr_len_by_opcode[];
> diff --git a/include/rdma/ib_hdrs.h b/include/rdma/ib_hdrs.h
> index 6a86d14..2aa19ec 100644
> +++ b/include/rdma/ib_hdrs.h
> @@ -335,4 +335,9 @@ static inline bool ib_bth_is_solicited(struct ib_other_headers *ohdr)
>  {
>  	return !!(ohdr->bth[0] & cpu_to_be32(IB_BTH_SOLICITED));
>  }
> +
> +static inline bool ib_bth_is_migration(struct ib_other_headers *ohdr)
> +{
> +	return !!(ohdr->bth[0] & cpu_to_be32(IB_BTH_MIG_REQ));
> +}
>  #endif                          /* IB_HDRS_H */

No on the !! - the cast to 'bool' causes the compiler to do this
automatically and is clearer. This is why we have 'bool'

I fixed the patch for you, please send another patch to get rid of the
other !! in boolean contexts I saw in this code.

Jason
--
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:[~2018-02-01 22:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01 18:45 [PATCH for-next 0/6] IB/hfi1: Performance improvements for 4.16 Dennis Dalessandro
     [not found] ` <20180201184446.5918.46068.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2018-02-01 18:46   ` [PATCH for-next 1/6] IB/hfi1: Remove dependence on qp->s_hdrwords Dennis Dalessandro
2018-02-01 18:46   ` [PATCH for-next 2/6] IB/hfi1: Compute BTH only for RDMA_WRITE_LAST/SEND_LAST packet Dennis Dalessandro
2018-02-01 18:46   ` [PATCH for-next 3/6] IB/hfi1: Optimize packet type comparison using 9B and bypass code paths Dennis Dalessandro
     [not found]     ` <20180201184620.5918.82548.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2018-02-01 22:40       ` Jason Gunthorpe [this message]
2018-02-01 18:46   ` [PATCH for-next 4/6] IB/hfi1: Look up ibport using a pointer in receive path Dennis Dalessandro
2018-02-01 18:46   ` [PATCH for-next 5/6] IB/hfi1: Remove unnecessary fecn and becn fields Dennis Dalessandro
2018-02-01 18:46   ` [PATCH for-next 6/6] IB/hfi1: Optimize process_receive_ib() Dennis Dalessandro
2018-02-01 22:50   ` [PATCH for-next 0/6] IB/hfi1: Performance improvements for 4.16 Jason Gunthorpe

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=20180201224032.GC17053@ziepe.ca \
    --to=jgg-uk2m96/98pc@public.gmane.org \
    --cc=dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=sebastian.sanchez-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.