public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH rdma-next v3-v5] Add OPA extended LID support
Date: Sat, 12 Aug 2017 09:29:41 +0300	[thread overview]
Message-ID: <20170812062941.GL24282@mtr-leonro.local> (raw)
In-Reply-To: <1502476546-9367-1-git-send-email-don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

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

On Fri, Aug 11, 2017 at 02:35:46PM -0400, Don Hiatt wrote:
> This patch series primarily increases sizes of variables that hold
> lid values from 16 to 32 bits. Additionally, it adds a check in
> the IB mad stack to verify a properly formatted MAD when OPA
> extended LIDs are used.
>
> Signed-off-by: Don Hiatt <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
>

<...>

>
> -/* Return slid in 16bit CPU encoding */
> -static inline u16 ib_slid_cpu16(u32 slid)
> +/**
> + * ib_lid_cpu16 - Return lid in 16bit CPU encoding.
> + *     In the current implementation the only way to get
> + *     get the 32bit lid is from other sources for OPA.
> + *     For IB, lids will always be 16bits so cast the
> + *     value accordingly.
> + *
> + * @lid: A 32bit LID
> + */
> +static inline u16 ib_lid_cpu16(u32 lid)
>  {
> -	return (u16)slid;
> +	WARN_ON_ONCE(lid && 0xFFFF0000);

It will print warning for first lid > 0
The proper lines should be "lid & 0xFFFF0000" (one ampersand).

> +	return (u16)lid;
>  }
>
> -/* Return slid in 16bit BE encoding */
> -static inline u16 ib_slid_be16(u32 slid)
> +/**
> + * ib_lid_be16 - Return lid in 16bit BE encoding.
> + *
> + * @lid: A 32bit LID
> + */
> +static inline u16 ib_lid_be16(u32 lid)

This function returns be16 and not u16.

>  {
> -	return cpu_to_be16((u16)slid);
> +	WARN_ON_ONCE(lid && 0xFFFF0000);

The same as above.

> +	return cpu_to_be16((u16)lid);
>  }
>  #endif /* IB_VERBS_H */
> --
> 1.8.3.1
>
> --
> 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 --]

  parent reply	other threads:[~2017-08-12  6:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-11 18:35 [PATCH rdma-next v3-v5] Add OPA extended LID support Don Hiatt
     [not found] ` <1502476546-9367-1-git-send-email-don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-12  6:29   ` Leon Romanovsky [this message]
     [not found]     ` <20170812062941.GL24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-08-14  7:37       ` Leon Romanovsky
     [not found]         ` <20170814073706.GD24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-08-14 16:18           ` Don Hiatt
  -- strict thread matches above, loose matches on Subject: below --
2017-08-11 17:46 [PATCH] rdma-next v3-v5: " Don Hiatt
     [not found] ` <1502473595-8143-1-git-send-email-don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-11 18:20   ` Leon Romanovsky
     [not found]     ` <20170811182007.GJ24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-08-11 18:36       ` Don Hiatt
     [not found]         ` <b9d6d2cd-e62d-371d-2c69-69f48533fb99-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-12  6:26           ` Leon Romanovsky

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=20170812062941.GL24282@mtr-leonro.local \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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