* [PATCH net v2 0/2] net: hinic: Don't fail probe when firmware lacks rx-vlan-filter
@ 2026-11-24 3:09 Jinjie Ruan
2026-11-24 3:09 ` [PATCH net v2 1/2] " Jinjie Ruan
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jinjie Ruan @ 2026-11-24 3:09 UTC (permalink / raw)
To: cai.huoqing, andrew+netdev, davem, edumazet, kuba, pabeni, netdev
Cc: ruanjinjie
Fix two hinic bugs, don't fail probe when firmware lacks rx-vlan-filter,
and zero-initialise the VLAN filter request.
Changes in v2:
- Zero-initialise the VLAN filter request.
- Fix sashiko issues.
- v1: https://lore.kernel.org/all/20261116021858.273519-1-ruanjinjie@huawei.com/
Link: https://sashiko.dev/#/patchset/20261116021858.273519-1-ruanjinjie%40huawei.com
Jinjie Ruan (2):
net: hinic: Don't fail probe when firmware lacks rx-vlan-filter
net: hinic: Zero-initialise the VLAN filter request
.../net/ethernet/huawei/hinic/hinic_main.c | 5 +++-
.../net/ethernet/huawei/hinic/hinic_port.c | 30 +++++++++++--------
2 files changed, 22 insertions(+), 13 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net v2 1/2] net: hinic: Don't fail probe when firmware lacks rx-vlan-filter
2026-11-24 3:09 [PATCH net v2 0/2] net: hinic: Don't fail probe when firmware lacks rx-vlan-filter Jinjie Ruan
@ 2026-11-24 3:09 ` Jinjie Ruan
2026-11-24 3:09 ` [PATCH net v2 2/2] net: hinic: Zero-initialise the VLAN filter request Jinjie Ruan
2026-12-01 14:20 ` [PATCH net v2 0/2] net: hinic: Don't fail probe when firmware lacks rx-vlan-filter patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: Jinjie Ruan @ 2026-11-24 3:09 UTC (permalink / raw)
To: cai.huoqing, andrew+netdev, davem, edumazet, kuba, pabeni, netdev
Cc: ruanjinjie
nic_dev_init() calls set_features() with force_change set, so it
unconditionally sends HINIC_PORT_CMD_SET_VLAN_FILTER because
NETIF_F_HW_VLAN_CTAG_FILTER is advertised. Firmware that predates
rx-vlan-filter support answers with HINIC_MGMT_CMD_UNSUPPORTED (0xff).
set_features() treats that as fatal: it folds it into err and returns
-EIO, so nic_dev_init() bails out and the only visible symptom is
hinic 0000:29:00.0: Failed to initialize NIC device
hinic 0000:29:00.0: probe with driver hinic failed with error -5
although nothing is actually broken. The bit is not in hw_features
either, so ethtool cannot turn it off.
Keep the feature advertised and let the probe succeed.
Also make hinic_set_vlan_fliter() trust the reply status only once the
command has been delivered and a full reply has come back. On a send
error or a timeout nothing is written to buf_out, so the status read back
is stale stack contents, and a stray 0xff would now be mistaken for
"firmware does not support this" instead of failing the probe.
Fixes: 2acf960e3be6 ("net: hinic: Add support for configuration of rx-vlan-filter by ethtool")
Cc: stable@vger.kernel.org
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
.../net/ethernet/huawei/hinic/hinic_main.c | 5 +++-
.../net/ethernet/huawei/hinic/hinic_port.c | 28 +++++++++++--------
2 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c
index 34ed5ea9e46e..3c5d5c7de307 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_main.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c
@@ -1098,9 +1098,12 @@ static int set_features(struct hinic_dev *nic_dev,
ret = hinic_set_vlan_fliter(nic_dev,
!!(features &
NETIF_F_HW_VLAN_CTAG_FILTER));
- if (ret) {
+ if (ret && ret != HINIC_MGMT_CMD_UNSUPPORTED) {
err = ret;
failed_features |= NETIF_F_HW_VLAN_CTAG_FILTER;
+ } else if (ret) {
+ dev_info(&nic_dev->hwdev->hwif->pdev->dev,
+ "Firmware does not support rx-vlan-filter, feature left enabled\n");
}
}
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_port.c b/drivers/net/ethernet/huawei/hinic/hinic_port.c
index 7bb6eb2a8917..ad271d7aa52b 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_port.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_port.c
@@ -462,19 +462,25 @@ int hinic_set_vlan_fliter(struct hinic_dev *nic_dev, u32 en)
err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_VLAN_FILTER,
&vlan_filter, sizeof(vlan_filter),
&vlan_filter, &out_size);
- if (vlan_filter.status == HINIC_MGMT_CMD_UNSUPPORTED) {
- err = HINIC_MGMT_CMD_UNSUPPORTED;
- } else if ((err == HINIC_MBOX_VF_CMD_ERROR) &&
- HINIC_IS_VF(hwif)) {
- err = HINIC_MGMT_CMD_UNSUPPORTED;
- } else if (err || !out_size || vlan_filter.status) {
- dev_err(&pdev->dev,
- "Failed to set vlan filter, err: %d, status: 0x%x, out size: 0x%x\n",
- err, vlan_filter.status, out_size);
- err = -EINVAL;
+ if (err == HINIC_MBOX_VF_CMD_ERROR && HINIC_IS_VF(hwif))
+ return HINIC_MGMT_CMD_UNSUPPORTED;
+
+ if (err || !out_size) {
+ dev_err(&pdev->dev, "Failed to set vlan filter, err: %d, out size: 0x%x\n",
+ err, out_size);
+ return -EINVAL;
}
- return err;
+ if (vlan_filter.status == HINIC_MGMT_CMD_UNSUPPORTED)
+ return HINIC_MGMT_CMD_UNSUPPORTED;
+
+ if (vlan_filter.status) {
+ dev_err(&pdev->dev, "Failed to set vlan filter, status: 0x%x\n",
+ vlan_filter.status);
+ return -EINVAL;
+ }
+
+ return 0;
}
int hinic_set_max_qnum(struct hinic_dev *nic_dev, u8 num_rqs)
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net v2 2/2] net: hinic: Zero-initialise the VLAN filter request
2026-11-24 3:09 [PATCH net v2 0/2] net: hinic: Don't fail probe when firmware lacks rx-vlan-filter Jinjie Ruan
2026-11-24 3:09 ` [PATCH net v2 1/2] " Jinjie Ruan
@ 2026-11-24 3:09 ` Jinjie Ruan
2026-12-01 14:17 ` Paolo Abeni
2026-12-01 14:20 ` [PATCH net v2 0/2] net: hinic: Don't fail probe when firmware lacks rx-vlan-filter patchwork-bot+netdevbpf
2 siblings, 1 reply; 5+ messages in thread
From: Jinjie Ruan @ 2026-11-24 3:09 UTC (permalink / raw)
To: cai.huoqing, andrew+netdev, davem, edumazet, kuba, pabeni, netdev
Cc: ruanjinjie
struct hinic_vlan_filter is filled in only in part: func_idx and enable
are set, while status, version and both reserved arrays keep whatever the
stack held. The whole structure is passed to the device as buf_in, so
those bytes are sent to firmware.
Initialise it to zero. Requesting a VLAN filter change is rare, so the
cost is irrelevant, and it keeps reserved fields from carrying garbage
across the management channel.
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
drivers/net/ethernet/huawei/hinic/hinic_port.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_port.c b/drivers/net/ethernet/huawei/hinic/hinic_port.c
index ad271d7aa52b..dda545aba1c7 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_port.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_port.c
@@ -452,7 +452,7 @@ int hinic_set_vlan_fliter(struct hinic_dev *nic_dev, u32 en)
struct hinic_hwdev *hwdev = nic_dev->hwdev;
struct hinic_hwif *hwif = hwdev->hwif;
struct pci_dev *pdev = hwif->pdev;
- struct hinic_vlan_filter vlan_filter;
+ struct hinic_vlan_filter vlan_filter = {0};
u16 out_size = sizeof(vlan_filter);
int err;
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net v2 2/2] net: hinic: Zero-initialise the VLAN filter request
2026-11-24 3:09 ` [PATCH net v2 2/2] net: hinic: Zero-initialise the VLAN filter request Jinjie Ruan
@ 2026-12-01 14:17 ` Paolo Abeni
0 siblings, 0 replies; 5+ messages in thread
From: Paolo Abeni @ 2026-12-01 14:17 UTC (permalink / raw)
To: Jinjie Ruan, cai.huoqing, andrew+netdev, davem, edumazet, kuba,
netdev
On 11/24/26 04:09, Jinjie Ruan wrote:
> struct hinic_vlan_filter is filled in only in part: func_idx and enable
> are set, while status, version and both reserved arrays keep whatever the
> stack held. The whole structure is passed to the device as buf_in, so
> those bytes are sent to firmware.
>
> Initialise it to zero. Requesting a VLAN filter change is rare, so the
> cost is irrelevant, and it keeps reserved fields from carrying garbage
> across the management channel.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
This one is really net-next material. Applying the same series half
to net and half to net-next foul our tools quite a bit.
Please resubmit this one for net-next.
/P
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net v2 0/2] net: hinic: Don't fail probe when firmware lacks rx-vlan-filter
2026-11-24 3:09 [PATCH net v2 0/2] net: hinic: Don't fail probe when firmware lacks rx-vlan-filter Jinjie Ruan
2026-11-24 3:09 ` [PATCH net v2 1/2] " Jinjie Ruan
2026-11-24 3:09 ` [PATCH net v2 2/2] net: hinic: Zero-initialise the VLAN filter request Jinjie Ruan
@ 2026-12-01 14:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-12-01 14:20 UTC (permalink / raw)
To: Jinjie Ruan
Cc: cai.huoqing, andrew+netdev, davem, edumazet, kuba, pabeni, netdev
Hello:
This series was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Tue, 24 Nov 2026 11:09:44 +0800 you wrote:
> Fix two hinic bugs, don't fail probe when firmware lacks rx-vlan-filter,
> and zero-initialise the VLAN filter request.
>
> Changes in v2:
> - Zero-initialise the VLAN filter request.
> - Fix sashiko issues.
> - v1: https://lore.kernel.org/all/20261116021858.273519-1-ruanjinjie@huawei.com/
>
> [...]
Here is the summary with links:
- [net,v2,1/2] net: hinic: Don't fail probe when firmware lacks rx-vlan-filter
https://git.kernel.org/netdev/net/c/c712df600d05
- [net,v2,2/2] net: hinic: Zero-initialise the VLAN filter request
(no matching commit)
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-12-01 14:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 3:09 [PATCH net v2 0/2] net: hinic: Don't fail probe when firmware lacks rx-vlan-filter Jinjie Ruan
2026-11-24 3:09 ` [PATCH net v2 1/2] " Jinjie Ruan
2026-11-24 3:09 ` [PATCH net v2 2/2] net: hinic: Zero-initialise the VLAN filter request Jinjie Ruan
2026-12-01 14:17 ` Paolo Abeni
2026-12-01 14:20 ` [PATCH net v2 0/2] net: hinic: Don't fail probe when firmware lacks rx-vlan-filter patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox