From: Simon Horman <horms@kernel.org>
To: Fan Gong <gongfan1@huawei.com>
Cc: Zhu Yikai <zhuyikai1@h-partners.com>,
netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Markus.Elfring@web.de, pavan.chebbi@broadcom.com,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
luosifu <luosifu@huawei.com>, Xin Guo <guoxin09@huawei.com>,
Shen Chenyang <shenchenyang1@hisilicon.com>,
Zhou Shuai <zhoushuai28@huawei.com>, Wu Like <wulike1@huawei.com>,
Shi Jing <shijing34@huawei.com>,
Luo Yang <luoyang82@h-partners.com>,
Meny Yossefi <meny.yossefi@huawei.com>,
Gur Stavi <gur.stavi@huawei.com>
Subject: Re: [PATCH net-next v04 3/5] hinic3: Add NIC configuration ops
Date: Wed, 5 Nov 2025 09:14:05 +0000 [thread overview]
Message-ID: <aQsVXfFlZzIeSf-V@horms.kernel.org> (raw)
In-Reply-To: <79009912df8bed8ce44f6fcaf8cdbb943d6efd82.1761711549.git.zhuyikai1@h-partners.com>
On Wed, Oct 29, 2025 at 02:16:27PM +0800, Fan Gong wrote:
...
> diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_hw_comm.c b/drivers/net/ethernet/huawei/hinic3/hinic3_hw_comm.c
> index 09dae2ef610c..0efb5a843964 100644
> --- a/drivers/net/ethernet/huawei/hinic3/hinic3_hw_comm.c
> +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_hw_comm.c
> @@ -9,6 +9,36 @@
> #include "hinic3_hwif.h"
> #include "hinic3_mbox.h"
>
> +static int hinic3_get_interrupt_cfg(struct hinic3_hwdev *hwdev,
> + struct hinic3_interrupt_info *info)
> +{
> + struct comm_cmd_cfg_msix_ctrl_reg msix_cfg = {};
> + struct mgmt_msg_params msg_params = {};
> + int err;
> +
> + msix_cfg.func_id = hinic3_global_func_id(hwdev);
> + msix_cfg.msix_index = info->msix_index;
> + msix_cfg.opcode = MGMT_MSG_CMD_OP_GET;
> +
> + mgmt_msg_params_init_default(&msg_params, &msix_cfg, sizeof(msix_cfg));
> +
> + err = hinic3_send_mbox_to_mgmt(hwdev, MGMT_MOD_COMM,
> + COMM_CMD_CFG_MSIX_CTRL_REG, &msg_params);
> + if (err || msix_cfg.head.status) {
> + dev_err(hwdev->dev, "Failed to get interrupt config, err: %d, status: 0x%x\n",
> + err, msix_cfg.head.status);
> + return -EFAULT;
> + }
> +
> + info->lli_credit_limit = msix_cfg.lli_credit_cnt;
> + info->lli_timer_cfg = msix_cfg.lli_timer_cnt;
> + info->pending_limit = msix_cfg.pending_cnt;
> + info->coalesc_timer_cfg = msix_cfg.coalesce_timer_cnt;
> + info->resend_timer_cfg = msix_cfg.resend_timer_cnt;
> +
> + return 0;
> +}
> +
> int hinic3_set_interrupt_cfg_direct(struct hinic3_hwdev *hwdev,
> const struct hinic3_interrupt_info *info)
> {
> @@ -40,6 +70,30 @@ int hinic3_set_interrupt_cfg_direct(struct hinic3_hwdev *hwdev,
> return 0;
> }
>
> +int hinic3_set_interrupt_cfg(struct hinic3_hwdev *hwdev,
> + struct hinic3_interrupt_info info)
> +{
> + struct hinic3_interrupt_info temp_info;
> + int err;
> +
> + temp_info.msix_index = info.msix_index;
> +
> + err = hinic3_get_interrupt_cfg(hwdev, &temp_info);
> + if (err)
> + return -EINVAL;
Maybe I am missing something. It seems to me thaat this error value will
propagate up to be the return value of the probe value. And it seems to me
that would be a bit more intuitive, and possibly lead to a better user
experience, if the return value of hinic3_get_interrupt_cfg() was
propagated here. And, in turn, if hinic3_get_interrupt_cfg() propagated the
return value of hinic3_send_mbox_to_mgmt(). These values differ from
-EINVAL.
> +
> + info.lli_credit_limit = temp_info.lli_credit_limit;
> + info.lli_timer_cfg = temp_info.lli_timer_cfg;
> +
> + if (!info.interrupt_coalesc_set) {
> + info.pending_limit = temp_info.pending_limit;
> + info.coalesc_timer_cfg = temp_info.coalesc_timer_cfg;
> + info.resend_timer_cfg = temp_info.resend_timer_cfg;
> + }
> +
> + return hinic3_set_interrupt_cfg_direct(hwdev, &info);
> +}
...
next prev parent reply other threads:[~2025-11-05 9:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 6:16 [PATCH net-next v04 0/5] net: hinic3: PF initialization Fan Gong
2025-10-29 6:16 ` [PATCH net-next v04 1/5] hinic3: Add PF framework Fan Gong
2025-10-29 6:16 ` [PATCH net-next v04 2/5] hinic3: Add PF management interfaces Fan Gong
2025-11-05 8:25 ` Simon Horman
2025-10-29 6:16 ` [PATCH net-next v04 3/5] hinic3: Add NIC configuration ops Fan Gong
2025-11-05 9:14 ` Simon Horman [this message]
2025-10-29 6:16 ` [PATCH net-next v04 4/5] hinic3: Add mac filter ops Fan Gong
2025-10-29 6:16 ` [PATCH net-next v04 5/5] hinic3: Add netdev register interfaces Fan Gong
2025-11-05 9:16 ` Simon Horman
2025-11-04 2:29 ` [PATCH net-next v04 0/5] net: hinic3: PF initialization Jakub Kicinski
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=aQsVXfFlZzIeSf-V@horms.kernel.org \
--to=horms@kernel.org \
--cc=Markus.Elfring@web.de \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gongfan1@huawei.com \
--cc=guoxin09@huawei.com \
--cc=gur.stavi@huawei.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luosifu@huawei.com \
--cc=luoyang82@h-partners.com \
--cc=meny.yossefi@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=shenchenyang1@hisilicon.com \
--cc=shijing34@huawei.com \
--cc=wulike1@huawei.com \
--cc=zhoushuai28@huawei.com \
--cc=zhuyikai1@h-partners.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).