From: Jason Gunthorpe <jgg@mellanox.com>
To: "Saleem, Shiraz" <shiraz.saleem@intel.com>
Cc: Leon Romanovsky <leon@kernel.org>,
"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
"dledford@redhat.com" <dledford@redhat.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"nhorman@redhat.com" <nhorman@redhat.com>,
"sassmann@redhat.com" <sassmann@redhat.com>,
"poswald@suse.com" <poswald@suse.com>
Subject: Re: [RDMA RFC v6 00/16] Intel RDMA Driver Updates 2020-05-19
Date: Tue, 2 Jun 2020 20:29:03 -0300 [thread overview]
Message-ID: <20200602232903.GD65026@mellanox.com> (raw)
In-Reply-To: <9DD61F30A802C4429A01CA4200E302A7EE04CC42@fmsmsx124.amr.corp.intel.com>
On Tue, Jun 02, 2020 at 10:59:46PM +0000, Saleem, Shiraz wrote:
> > Subject: Re: [RDMA RFC v6 00/16] Intel RDMA Driver Updates 2020-05-19
> >
> > On Fri, May 29, 2020 at 03:21:05PM +0000, Saleem, Shiraz wrote:
> > > > Subject: Re: [RDMA RFC v6 00/16] Intel RDMA Driver Updates
> > > > 2020-05-19
> > > >
> > >
> > > [......]
> > >
> > > >
> > > > I'm looking on it and see static assignments, to by dynamic you will need "to
> > play"
> > > > with hw_shifts/hw_masks later, but you don't. What am I missing?
> > > >
> > > > + for (i = 0; i < IRDMA_MAX_SHIFTS; ++i)
> > > > + dev->hw_shifts[i] = i40iw_shifts[i];
> > > > +
> > > > + for (i = 0; i < IRDMA_MAX_MASKS; ++i)
> > > > + dev->hw_masks[i] = i40iw_masks[i];
> > > >
> > > > >
> > > > > we still need to use the custom macro FLD_LS_64 without FIELD_PREP
> > > > > in this case as FIELD_PREP expects compile time constants.
> > > > > +#define FLD_LS_64(dev, val, field) \
> > > > > + (((u64)(val) << (dev)->hw_shifts[field ## _S]) &
> > > > > +(dev)->hw_masks[field ## _M])
> > > > > And the shifts are still required for these fields which causes a
> > > > > bit of inconsistency
> > > > >
> > >
> > >
> > > The device hw_masks/hw_shifts array store masks/shifts of those
> > > descriptor fields that have same name across HW generations but differ
> > > in some attribute such as field width. Yes they are statically
> > > assigned, initialized with values from i40iw_masks and icrdma_masks,
> > > depending on the HW generation. We can even use GENMASK for the values
> > > in i40iw_masks[] , icrdma_masks[] but FIELD_PREP cant be used on
> > > dev->hw_masks[]
> >
> > So compute the shift and mask when building i40iw_shifts array using the compile
> > time constant?
> >
>
> i40iw_shifts[] and i40iw_mask[] are setup as compile constants
> and used to initialize dev->hw_masks[], dev->hw_shifts[] if the device is gen1.
> I still don't see how FIELD_PREP can be used on a value and
> dev->hw_masks[i].
Well, you can't, you'd still have to use this indirection, the point
was to make the #define macros consistent
Jason
prev parent reply other threads:[~2020-06-02 23:29 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 7:03 [RDMA RFC v6 00/16] Intel RDMA Driver Updates 2020-05-19 Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 01/16] RDMA/irdma: Add driver framework definitions Jeff Kirsher
2020-05-20 7:26 ` Greg KH
2020-05-27 1:57 ` Saleem, Shiraz
2020-05-20 7:04 ` [RDMA RFC v6 02/16] RDMA/irdma: Implement device initialization definitions Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 03/16] RDMA/irdma: Implement HW Admin Queue OPs Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 04/16] RDMA/irdma: Add HMC backing store setup functions Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 05/16] RDMA/irdma: Add privileged UDA queue implementation Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 06/16] RDMA/irdma: Add QoS definitions Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 07/16] RDMA/irdma: Add connection manager Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 08/16] RDMA/irdma: Add PBLE resource manager Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 09/16] RDMA/irdma: Implement device supported verb APIs Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 10/16] RDMA/irdma: Add RoCEv2 UD OP support Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 11/16] RDMA/irdma: Add user/kernel shared libraries Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 12/16] RDMA/irdma: Add miscellaneous utility definitions Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 13/16] RDMA/irdma: Add dynamic tracing for CM Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 14/16] RDMA/irdma: Add ABI definitions Jeff Kirsher
2020-05-20 7:54 ` Gal Pressman
2020-05-20 8:52 ` Greg KH
2020-05-20 9:02 ` Gal Pressman
2020-05-20 12:37 ` Jason Gunthorpe
2020-05-27 1:58 ` Saleem, Shiraz
2020-05-20 7:04 ` [RDMA RFC v6 15/16] RDMA/irdma: Add irdma Kconfig/Makefile and remove i40iw Jeff Kirsher
2020-05-20 7:04 ` [RDMA RFC v6 16/16] RDMA/irdma: Update MAINTAINERS file Jeff Kirsher
2020-05-20 7:49 ` Gal Pressman
2020-05-27 1:58 ` Saleem, Shiraz
2020-05-21 14:12 ` [RDMA RFC v6 00/16] Intel RDMA Driver Updates 2020-05-19 Jason Gunthorpe
2020-05-27 1:58 ` Saleem, Shiraz
2020-05-27 5:08 ` Leon Romanovsky
2020-05-29 15:21 ` Saleem, Shiraz
2020-06-01 14:28 ` Jason Gunthorpe
2020-06-02 22:59 ` Saleem, Shiraz
2020-06-02 23:29 ` Jason Gunthorpe [this message]
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=20200602232903.GD65026@mellanox.com \
--to=jgg@mellanox.com \
--cc=davem@davemloft.net \
--cc=dledford@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=jeffrey.t.kirsher@intel.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=poswald@suse.com \
--cc=sassmann@redhat.com \
--cc=shiraz.saleem@intel.com \
/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).