public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: "Chandramouli, Dasaratharaman" <dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: "Hefty,
	Sean" <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"Weiny, Ira" <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"Hiatt, Don" <don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH v2 03/11] IB/core: Change ah_attr.dlid from 16 to 32 bits
Date: Thu, 8 Dec 2016 14:01:15 -0800	[thread overview]
Message-ID: <9400a611-e37a-3e1f-2233-5650b4856831@intel.com> (raw)
In-Reply-To: <1828884A29C6694DAF28B7E6B8A82373AB0BCAD7-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>



On 12/8/2016 1:12 PM, Hefty, Sean wrote:
> Example:
>
>> -		if (rmpp_recv->slid == ah_attr.dlid) {
>> +		if (rmpp_recv->slid == (u16)ah_attr.dlid) {
>
>>  struct ib_ah_attr {
>>  	struct ib_global_route	grh;
>> -	u16			dlid;
>> +	u32			dlid;
>
> There are a bunch of places where the lid is simply cast back to a u16.  How is the code supposed to determine if a u16 cast is a safe operation or not?

The idea is that all underlying drivers which use the dlid field from 
the address handle will use then after casting to u16. That way there is 
no change in the driver behavior.

The only exception is the hfi1 driver which will use the full 32 bit 
lid. Patches specific to hfi1 driver are in the works and will be posted 
once this patch series is accepted.

ULPs, and other core data structures like the ones in rpmm_recv have 
been modified to be 32 bits. The u16 cast you see in this patch was 
added to avoid compiler warnings. Patch 07/11 removes the cast when 
rmpp_recv->slid is increased to 32 bits. Like Jason pointed out before, 
i will re-order these patches which will avoid some of these temporary 
casts.
>
> I don’t like the overloading of the term 'lid' to sometimes mean a 16-bit value and other times a 32-bit value, with no way of distinguishing which one we have.  Maybe we need to call out a version (lidv2 = 32-bits) or carry the size.  I don't have a strong idea here.  But when looking at this patch, lid is re-defined to u32, then nearly everywhere cast back to u16, which looks questionable.
The intention was to not cause too many changes to the underlying 
drivers when the lid field was increased. Casting was a simpler approach.

In summary, once all these patches are through, the cast to u16 only be 
in the drivers and not in the core data structures.
>
> - Sean
>
--
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:[~2016-12-08 22:01 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 19:38 [PATCH v2 00/11] IB/core: Add 32 bit LID support Dasaratharaman Chandramouli
     [not found] ` <1479843532-47496-1-git-send-email-dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-22 19:38   ` [PATCH v2 01/11] IB/core: Add rdma_cap_opa_ah to expose opa address handles Dasaratharaman Chandramouli
2016-11-22 19:38   ` [PATCH v2 02/11] IB/core: Change port_attr.sm_lid from 16 to 32 bits Dasaratharaman Chandramouli
     [not found]     ` <1479843532-47496-3-git-send-email-dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-22 20:57       ` Jason Gunthorpe
     [not found]         ` <20161122205717.GA6484-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-22 21:13           ` Chandramouli, Dasaratharaman
     [not found]             ` <cb14f866-0e19-1631-745d-5c9d67aabfe8-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-22 21:24               ` Jason Gunthorpe
     [not found]                 ` <20161122212411.GC6484-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-23  5:43                   ` Chandramouli, Dasaratharaman
2016-11-22 19:38   ` [PATCH v2 03/11] IB/core: Change ah_attr.dlid " Dasaratharaman Chandramouli
     [not found]     ` <1479843532-47496-4-git-send-email-dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-12-08 15:13       ` Leon Romanovsky
     [not found]         ` <20161208151356.GE9722-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2016-12-08 22:02           ` Chandramouli, Dasaratharaman
2016-12-08 21:12       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A82373AB0BCAD7-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-12-08 22:01           ` Chandramouli, Dasaratharaman [this message]
     [not found]             ` <9400a611-e37a-3e1f-2233-5650b4856831-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-12-08 23:19               ` Hefty, Sean
2016-12-08 23:17           ` Jason Gunthorpe
     [not found]             ` <20161208231736.GA18314-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-12-08 23:21               ` Hefty, Sean
2016-11-22 19:38   ` [PATCH v2 04/11] IB/core: Change port_attr.lid size " Dasaratharaman Chandramouli
2016-11-22 19:38   ` [PATCH v2 05/11] IB/core: Change wc.slid " Dasaratharaman Chandramouli
2016-11-22 19:38   ` [PATCH v2 06/11] IB/mad: Ensure DR MADs are correctly specified when using OPA devices Dasaratharaman Chandramouli
     [not found]     ` <1479843532-47496-7-git-send-email-dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-23 14:21       ` Hal Rosenstock
     [not found]         ` <4a729fdc-9386-c0b0-a29e-11cbddf66058-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-11-23 18:29           ` Chandramouli, Dasaratharaman
2016-11-22 19:38   ` [PATCH v2 07/11] IB/mad: Change slid in RMPP recv from 16 to 32 bits Dasaratharaman Chandramouli
2016-11-22 19:38   ` [PATCH v2 08/11] IB/SA: Program extended LID in SM Address handle Dasaratharaman Chandramouli
2016-11-22 19:38   ` [PATCH v2 09/11] IB/IPoIB: Retrieve 32 bit LIDs from path records when running on OPA devices Dasaratharaman Chandramouli
2016-11-22 19:38   ` [PATCH v2 10/11] IB/IPoIB: Modify ipoib_get_net_dev_by_params to lookup gid table Dasaratharaman Chandramouli
     [not found]     ` <1479843532-47496-11-git-send-email-dasaratharaman.chandramouli-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-22 21:20       ` Jason Gunthorpe
     [not found]         ` <20161122212057.GB6484-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-12-08 23:11           ` Chandramouli, Dasaratharaman
2016-11-22 19:38   ` [PATCH v2 11/11] IB/srpt: Increase lid and sm_lid to 32 bits Dasaratharaman Chandramouli

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=9400a611-e37a-3e1f-2233-5650b4856831@intel.com \
    --to=dasaratharaman.chandramouli-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=don.hiatt-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sean.hefty-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