From: Jason Gunthorpe <jgg@ziepe.ca>
To: Shiraz Saleem <shiraz.saleem@intel.com>
Cc: dledford@redhat.com, linux-rdma@vger.kernel.org, "Sindhu,
Devale" <sindhu.devale@intel.com>,
Jarod Wilson <jarod@redhat.com>
Subject: Re: [PATCH v1 rdma-next] i40iw: Report correct firmware version
Date: Wed, 18 Mar 2020 10:56:19 -0300 [thread overview]
Message-ID: <20200318135619.GA31930@ziepe.ca> (raw)
In-Reply-To: <20200313214406.2159-1-shiraz.saleem@intel.com>
On Fri, Mar 13, 2020 at 04:44:06PM -0500, Shiraz Saleem wrote:
> From: "Sindhu, Devale" <sindhu.devale@intel.com>
>
> The driver uses a hard-coded value for FW version and
> reports an inconsistent FW version between ibv_devinfo
> and /sys/class/infiniband/i40iw/fw_ver.
> Retrieve the FW version via a Control QP (CQP) operation
> and report it consistently across sysfs and query device.
>
> Fixes: d37498417947 ("i40iw: add files for iwarp interface")
> Reported-by: Jarod Wilson <jarod@redhat.com>
> Signed-off-by: Sindhu, Devale <sindhu.devale@intel.com>
> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
> ---
> v0-->v1:
> -Remove implicit casts
> -Use static inline function for computing FW version instead of macros
> ---
> drivers/infiniband/hw/i40iw/i40iw.h | 22 ++++++-
> drivers/infiniband/hw/i40iw/i40iw_ctrl.c | 99 ++++++++++++++++++++++++++++++
> drivers/infiniband/hw/i40iw/i40iw_d.h | 26 +++++++-
> drivers/infiniband/hw/i40iw/i40iw_main.c | 6 ++
> drivers/infiniband/hw/i40iw/i40iw_p.h | 1 +
> drivers/infiniband/hw/i40iw/i40iw_status.h | 3 +-
> drivers/infiniband/hw/i40iw/i40iw_type.h | 12 ++++
> drivers/infiniband/hw/i40iw/i40iw_verbs.c | 10 +--
> 8 files changed, 170 insertions(+), 9 deletions(-)
Applied to for-next
> diff --git a/drivers/infiniband/hw/i40iw/i40iw_d.h b/drivers/infiniband/hw/i40iw/i40iw_d.h
> index 6ddaeec..e8367d6 100644
> --- a/drivers/infiniband/hw/i40iw/i40iw_d.h
> +++ b/drivers/infiniband/hw/i40iw/i40iw_d.h
> @@ -403,7 +403,7 @@
> #define I40IW_CQP_OP_MANAGE_ARP 0x0f
> #define I40IW_CQP_OP_MANAGE_VF_PBLE_BP 0x10
> #define I40IW_CQP_OP_MANAGE_PUSH_PAGES 0x11
> -#define I40IW_CQP_OP_MANAGE_PE_TEAM 0x12
> +#define I40IW_CQP_OP_QUERY_RDMA_FEATURES 0x12
> #define I40IW_CQP_OP_UPLOAD_CONTEXT 0x13
> #define I40IW_CQP_OP_ALLOCATE_LOC_MAC_IP_TABLE_ENTRY 0x14
> #define I40IW_CQP_OP_MANAGE_HMC_PM_FUNC_TABLE 0x15
> @@ -431,6 +431,24 @@
> #define I40IW_CQP_OP_SHMC_PAGES_ALLOCATED 0x2b
> #define I40IW_CQP_OP_SET_HMC_RESOURCE_PROFILE 0x2d
>
> +#define I40IW_FEATURE_BUF_SIZE (8 * I40IW_MAX_FEATURES)
> +
> +#define I40IW_FW_VER_MINOR_SHIFT 0
> +#define I40IW_FW_VER_MINOR_MASK \
> + (0xffffULL << I40IW_FW_VER_MINOR_SHIFT)
> +
> +#define I40IW_FW_VER_MAJOR_SHIFT 16
> +#define I40IW_FW_VER_MAJOR_MASK \
> + (0xffffULL << I40IW_FW_VER_MAJOR_SHIFT)
> +
> +#define I40IW_FEATURE_INFO_SHIFT 0
> +#define I40IW_FEATURE_INFO_MASK \
> + (0xffffULL << I40IW_FEATURE_INFO_SHIFT)
> +
> +#define I40IW_FEATURE_CNT_SHIFT 32
> +#define I40IW_FEATURE_CNT_MASK \
> + (0xffffULL << I40IW_FEATURE_CNT_SHIFT)
Please see the discussion about these kinds of macros on the EFA
thread - please don't use this scheme in the new
driver. The standard GENMASK/FIELD_PREP/etc should be used
Thanks,
Jason
prev parent reply other threads:[~2020-03-18 13:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-13 21:44 [PATCH v1 rdma-next] i40iw: Report correct firmware version Shiraz Saleem
2020-03-18 13:56 ` 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=20200318135619.GA31930@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=dledford@redhat.com \
--cc=jarod@redhat.com \
--cc=linux-rdma@vger.kernel.org \
--cc=shiraz.saleem@intel.com \
--cc=sindhu.devale@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).