From: "ira.weiny" <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org,
bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH V4 for-next 1/4] IB/core: Introduce capabilitymask2 field in ClassPortInfo mad
Date: Tue, 17 May 2016 15:45:16 -0400 [thread overview]
Message-ID: <20160517194515.GA17141@phlsvsds.ph.intel.com> (raw)
In-Reply-To: <1463401694-19247-2-git-send-email-erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
On Mon, May 16, 2016 at 03:28:11PM +0300, Erez Shitrit wrote:
>
<snip>
>
> +/**
> + * ib_get_cpi_resp_time - Returns the resp_time value from
> + * cap_mask2_resp_time in ib_class_port_info.
> + * @cpi: A struct ib_class_port_info mad.
> + */
> +static inline u8 ib_get_cpi_resp_time(struct ib_class_port_info *cpi)
> +{
> + return ((be32_to_cpu(cpi->cap_mask2_resp_time) & 0xF8) >> 3);
return (uint8_t)((be32_to_cpu(cpi->cap_mask2_resp_time) & 0xF8000000) >> 27);
???
> +}
> +
> +/**
> + * ib_set_cpi_resptime - Sets the response time in an
> + * ib_class_port_info mad.
> + * @cpi: A struct ib_class_port_info.
> + * @rtime: The response time to set.
> + */
> +static inline void ib_set_cpi_resp_time(struct ib_class_port_info *cpi,
> + u8 rtime)
> +{
> + u32 tmp;
> + u32 tmp2;
> +
> + tmp = rtime;
> + tmp = tmp << 3;
<< 27 ???
> + tmp2 = (be32_to_cpu(cpi->cap_mask2_resp_time) & ~0xF8);
> + tmp = tmp | tmp2;
> + cpi->cap_mask2_resp_time = cpu_to_be32(tmp);
> +}
> +
> +/**
> + * ib_get_cpi_capmask2 - Returns the capmask2 value from
> + * cap_mask2_resp_time in ib_class_port_info.
> + * @cpi: A struct ib_class_port_info mad.
> + */
> +static inline u32 ib_get_cpi_capmask2(struct ib_class_port_info *cpi)
> +{
> + u8 tmp;
> +
> + tmp = ((be32_to_cpu(cpi->cap_mask2_resp_time) & 0x7) << 5);
> + return (((be32_to_cpu(cpi->cap_mask2_resp_time) & ~0xFF) >> 5) | tmp);
return (be32_to_cpu(cpi->cap_mask2_resp_time) & 0x07FFFFFF);
?
> +}
> +
> +/**
> + * ib_set_cpi_capmask2 - Sets the capmask2 in an
> + * ib_class_port_info mad.
> + * @cpi: A struct ib_class_port_info.
> + * @capmask2: The capmask2 to set.
> + */
> +static inline void ib_set_cpi_capmask2(struct ib_class_port_info *cpi,
> + u32 capmask2)
> +{
> + u32 tmp;
> +
> + tmp = ib_get_cpi_resp_time(cpi);
> + tmp = tmp << 27;
> + cpi->cap_mask2_resp_time = (__force __be32)(tmp | capmask2);
Why is this not
cpi->cap_mask2_resp_time = cpu_to_be32(..);
?
Ira
> +}
> +
> struct ib_mad_notice_attr {
> u8 generic_type;
> u8 prod_type_msb;
> --
> 1.7.11.3
>
--
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:[~2016-05-17 19:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-16 12:28 [PATCH V4 for-next 0/4] Support SendOnlyFullMember join Erez Shitrit
[not found] ` <1463401694-19247-1-git-send-email-erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-05-16 12:28 ` [PATCH V4 for-next 1/4] IB/core: Introduce capabilitymask2 field in ClassPortInfo mad Erez Shitrit
[not found] ` <1463401694-19247-2-git-send-email-erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-05-16 13:00 ` Hal Rosenstock
[not found] ` <508890fe-b1c2-14c4-21a3-2d9afcb00916-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-05-16 13:04 ` Erez Shitrit
[not found] ` <CAAk-MO-q7z=TsJgLhbbj6LeDzEQ8c6q_yFnNTft8hkB_sd4gpw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-16 14:59 ` Erez Shitrit
2016-05-17 19:45 ` ira.weiny [this message]
2016-05-16 12:28 ` [PATCH V4 for-next 2/4] IB/SA Agent: Add support for SA agent get ClassPortInfo Erez Shitrit
2016-05-16 12:28 ` [PATCH V4 for-next 3/4] IB/core: Support new type of join-state for multicast Erez Shitrit
[not found] ` <1463401694-19247-4-git-send-email-erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-05-17 19:50 ` ira.weiny
2016-05-16 12:28 ` [PATCH V4 for-next 4/4] IB/ipoib: Support SendOnlyFullMember MCG for SendOnly join Erez Shitrit
[not found] ` <1463401694-19247-5-git-send-email-erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-05-17 20:10 ` ira.weiny
[not found] ` <20160517201023.GC17141-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2016-05-18 12:28 ` Erez Shitrit
2016-05-16 15:45 ` [PATCH V4 for-next 0/4] Support SendOnlyFullMember join Doug Ledford
[not found] ` <8e7686fa-de3e-1a92-1168-528909eb4019-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-05-16 18:10 ` Erez Shitrit
[not found] ` <CAAk-MO_CXmP+-WKbXpnFV=JaOu6Cspo3bGL0qwMJeoe3NoyTmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-16 19:31 ` Erez Shitrit
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=20160517194515.GA17141@phlsvsds.ph.intel.com \
--to=ira.weiny-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org \
--cc=cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ogerlitz-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;
as well as URLs for NNTP newsgroup(s).