From: Simon Horman <horms@kernel.org>
To: Fan Gong <gongfan1@huawei.com>
Cc: Zhu Yikai <zhuyikai1@h-partners.com>,
netdev@vger.kernel.org, linux-kernel@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>,
linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
Bjorn Helgaas <helgaas@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>, Lee Trager <lee@trager.us>,
Michael Ellerman <mpe@ellerman.id.au>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Suman Ghosh <sumang@marvell.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Joe Damato <jdamato@fastly.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: Re: [PATCH net-next v01 1/9] hinic3: Add PF framework
Date: Mon, 27 Oct 2025 10:00:32 +0000 [thread overview]
Message-ID: <aP9CwKkLdgcqHvkc@horms.kernel.org> (raw)
In-Reply-To: <905df406fd870da528361f47c48067802588cfb5.1760502478.git.zhuyikai1@h-partners.com>
On Wed, Oct 15, 2025 at 03:15:27PM +0800, Fan Gong wrote:
> Add support for PF framework based on the VF code.
>
> Co-developed-by: Zhu Yikai <zhuyikai1@h-partners.com>
> Signed-off-by: Zhu Yikai <zhuyikai1@h-partners.com>
> Signed-off-by: Fan Gong <gongfan1@huawei.com>
...
> diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c b/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c
> index 979f47ca77f9..2b93026845ff 100644
> --- a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c
> +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c
> @@ -117,17 +117,49 @@ int hinic3_set_port_mtu(struct net_device *netdev, u16 new_mtu)
> &func_tbl_cfg);
> }
>
> +#define PF_SET_VF_MAC(hwdev, status) \
> + (HINIC3_IS_VF(hwdev) && (status) == HINIC3_PF_SET_VF_ALREADY)
> +
nit: I think the above could be a function rather than a macro.
...
> @@ -157,9 +189,9 @@ int hinic3_set_mac(struct hinic3_hwdev *hwdev, const u8 *mac_addr, u16 vlan_id,
> return -EIO;
> }
>
> - if (mac_info.msg_head.status == MGMT_STATUS_PF_SET_VF_ALREADY) {
> + if (PF_SET_VF_MAC(hwdev, mac_info.msg_head.status)) {
> dev_warn(hwdev->dev, "PF has already set VF mac, Ignore set operation\n");
> - return 0;
> + return HINIC3_PF_SET_VF_ALREADY;
It seems to me that this custom return value can be propagated up
and returned by the probe function. If so, this doesn't seem desirable.
And, overall, I would recommend against the custom calling convention
that custom return values imply.
> }
>
> if (mac_info.msg_head.status == MGMT_STATUS_EXIST) {
...
next prev parent reply other threads:[~2025-10-27 10:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 7:15 [PATCH net-next v01 0/9] net: hinic3: Add a driver for Huawei 3rd gen NIC - PF initialization Fan Gong
2025-10-15 7:15 ` [PATCH net-next v01 1/9] hinic3: Add PF framework Fan Gong
2025-10-15 10:29 ` Pavan Chebbi
2025-10-27 10:00 ` Simon Horman [this message]
2025-10-15 7:15 ` [PATCH net-next v01 2/9] hinic3: Add PF management interfaces Fan Gong
2025-10-15 10:00 ` [PATCH net-next " Markus Elfring
2025-10-15 16:46 ` Simon Horman
2025-10-16 8:55 ` Fan Gong
2025-10-16 10:26 ` [net-next " Markus Elfring
2025-10-16 12:46 ` [PATCH net-next " Fan Gong
2025-10-15 7:15 ` [PATCH net-next v01 3/9] hinic3: Add NIC configuration ops Fan Gong
2025-10-15 7:15 ` [PATCH net-next v01 4/9] hinic3: Add mac filter ops Fan Gong
2025-10-15 7:15 ` [PATCH net-next v01 5/9] hinic3: Add netdev register interfaces Fan Gong
2025-10-15 20:10 ` Jakub Kicinski
2025-10-15 7:15 ` [PATCH net-next v01 6/9] hinic3: Fix netif_queue_set_napi queue_index parameter passing error Fan Gong
2025-10-15 7:15 ` [PATCH net-next v01 7/9] hinic3: Fix code Style(remove empty lines between error handling) Fan Gong
2025-10-15 7:15 ` [PATCH net-next v01 8/9] hinic3: Remove redundant defensive code Fan Gong
2025-10-15 7:15 ` [PATCH net-next v01 9/9] hinic3: Use array_size instead of multiplying Fan Gong
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=aP9CwKkLdgcqHvkc@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=christophe.jaillet@wanadoo.fr \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gongfan1@huawei.com \
--cc=guoxin09@huawei.com \
--cc=gur.stavi@huawei.com \
--cc=helgaas@kernel.org \
--cc=jdamato@fastly.com \
--cc=kuba@kernel.org \
--cc=lee@trager.us \
--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=mpe@ellerman.id.au \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=shenchenyang1@hisilicon.com \
--cc=shijing34@huawei.com \
--cc=sumang@marvell.com \
--cc=vadim.fedorenko@linux.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.