[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250911123120.GG30363@horms.kernel.org>
Date: Thu, 11 Sep 2025 13:31:20 +0100
From: Simon Horman <horms@...nel.org>
To: Fan Gong <gongfan1@...wei.com>
Cc: Zhu Yikai <zhuyikai1@...artners.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Andrew Lunn <andrew+netdev@...n.ch>, linux-doc@...r.kernel.org,
Jonathan Corbet <corbet@....net>,
Bjorn Helgaas <helgaas@...nel.org>, luosifu <luosifu@...wei.com>,
Xin Guo <guoxin09@...wei.com>,
Shen Chenyang <shenchenyang1@...ilicon.com>,
Zhou Shuai <zhoushuai28@...wei.com>, Wu Like <wulike1@...wei.com>,
Shi Jing <shijing34@...wei.com>,
Luo Yang <luoyang82@...artners.com>,
Meny Yossefi <meny.yossefi@...wei.com>,
Gur Stavi <gur.stavi@...wei.com>, Lee Trager <lee@...ger.us>,
Michael Ellerman <mpe@...erman.id.au>,
Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
Suman Ghosh <sumang@...vell.com>,
Przemek Kitszel <przemyslaw.kitszel@...el.com>,
Joe Damato <jdamato@...tly.com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: Re: [PATCH net-next v05 03/14] hinic3: HW common function
initialization
On Tue, Sep 09, 2025 at 03:33:28PM +0800, Fan Gong wrote:
> Add initialization for data structures and functions(cmdq ceq mbox ceq)
> that interact with hardware.
>
> Co-developed-by: Zhu Yikai <zhuyikai1@...artners.com>
> Signed-off-by: Zhu Yikai <zhuyikai1@...artners.com>
> Signed-off-by: Fan Gong <gongfan1@...wei.com>
The nits below notwithstanding, this looks good to me.
Reviewed-by: Simon Horman <horms@...nel.org>
...
> diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_hw_comm.c b/drivers/net/ethernet/huawei/hinic3/hinic3_hw_comm.c
...
> @@ -61,3 +62,176 @@ int hinic3_func_reset(struct hinic3_hwdev *hwdev, u16 func_id, u64 reset_flag)
>
> return 0;
> }
> +
> +static int hinic3_comm_features_nego(struct hinic3_hwdev *hwdev, u8 opcode,
> + u64 *s_feature, u16 size)
> +{
> + struct comm_cmd_feature_nego feature_nego = {};
> + struct mgmt_msg_params msg_params = {};
> + int err;
> +
> + feature_nego.func_id = hinic3_global_func_id(hwdev);
> + feature_nego.opcode = opcode;
> + if (opcode == MGMT_MSG_CMD_OP_SET)
> + memcpy(feature_nego.s_feature, s_feature, (size * sizeof(u64)));
nit: This could use array_size()
> +
> + mgmt_msg_params_init_default(&msg_params, &feature_nego,
> + sizeof(feature_nego));
> +
> + err = hinic3_send_mbox_to_mgmt(hwdev, MGMT_MOD_COMM,
> + COMM_CMD_FEATURE_NEGO, &msg_params);
> + if (err || feature_nego.head.status) {
> + dev_err(hwdev->dev, "Failed to negotiate feature, err: %d, status: 0x%x\n",
> + err, feature_nego.head.status);
> + return -EINVAL;
> + }
> +
> + if (opcode == MGMT_MSG_CMD_OP_GET)
> + memcpy(s_feature, feature_nego.s_feature, (size * sizeof(u64)));
Ditto.
> +
> + return 0;
> +}
...
Powered by blists - more mailing lists