From: Leon Romanovsky <leon@kernel.org>
To: Junxian Huang <huangjunxian6@hisilicon.com>
Cc: jgg@nvidia.com, linux-rdma@vger.kernel.org, linuxarm@huawei.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH for-rc 3/3] RDMA/hns: Add check and adjust for function resource values
Date: Wed, 12 Jul 2023 15:53:36 +0300 [thread overview]
Message-ID: <20230712125336.GE41919@unreal> (raw)
In-Reply-To: <20230712060033.15961-4-huangjunxian6@hisilicon.com>
On Wed, Jul 12, 2023 at 02:00:33PM +0800, Junxian Huang wrote:
> Currently, RoCE driver gets function resource values from firmware
> without validity check. As these resources are mostly related to memory,
> an invalid value may lead to serious consequence such as kernel panic.
>
> This patch adds check for these resource values and adjusts the invalid
> ones.
>
> Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
> ---
> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 116 ++++++++++++++++++++-
> drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 37 +++++++
> 2 files changed, 149 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> index c4b92d8bd98a..dae0e6959fa0 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> @@ -1650,6 +1650,98 @@ static int hns_roce_config_global_param(struct hns_roce_dev *hr_dev)
> return hns_roce_cmq_send(hr_dev, &desc, 1);
> }
<...>
> +static inline bool check_res_is_supported(struct hns_roce_dev *hr_dev,
> + struct hns_roce_bt_num *bt_num_entry)
> +{
<...>
> +static inline void adjust_eqc_bt_num(struct hns_roce_caps *caps,
> + u16 *invalid_flag)
> +{
No inline functions in *.c files.
Thanks
prev parent reply other threads:[~2023-07-12 12:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 6:00 [PATCH for-rc 0/3] RDMA/hns: Improvements for function resource configuration Junxian Huang
2023-07-12 6:00 ` [PATCH for-rc 1/3] RDMA/hns: support get xrcd num from firmware Junxian Huang
2023-07-12 6:00 ` [PATCH for-rc 2/3] RDMA/hns: Remove VF extend configuration Junxian Huang
2023-07-12 6:00 ` [PATCH for-rc 3/3] RDMA/hns: Add check and adjust for function resource values Junxian Huang
2023-07-12 12:53 ` Leon Romanovsky [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=20230712125336.GE41919@unreal \
--to=leon@kernel.org \
--cc=huangjunxian6@hisilicon.com \
--cc=jgg@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linuxarm@huawei.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