]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: enetc: fix incorrect mailbox message status returned to VFs
authorWei Fang <wei.fang@nxp.com>
Wed, 20 May 2026 06:44:13 +0000 (14:44 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 May 2026 15:48:58 +0000 (08:48 -0700)
commit8c84c5ec4aaff6ad7aac49935e050fed6b360a28
tree32f98ff89d7176302a3f2a8c088e4276c011e430
parentbdd39576bf50a50bdafe3da968fd271bc674a48f
net: enetc: fix incorrect mailbox message status returned to VFs

There are two cases where VFs receive an incorrect success status from
the PF mailbox message handler, misleading them into believing their
requests have been fulfilled:

In enetc_msg_handle_rxmsg(), *status is pre-initialized to
ENETC_MSG_CMD_STATUS_OK. When an unsupported command type is received,
the default case only logs an error without updating *status, so it
remains as ENETC_MSG_CMD_STATUS_OK.

In enetc_msg_pf_set_vf_primary_mac_addr(), when the PF has already
assigned a MAC address for the VF (ENETC_VF_FLAG_PF_SET_MAC is set),
the function rejects the request but returns ENETC_MSG_CMD_STATUS_OK
instead of ENETC_MSG_CMD_STATUS_FAIL.

Therefore, correct the status value for the two cases mentioned above.

Fixes: beb74ac878c8 ("enetc: Add vf to pf messaging support")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
Link: https://patch.msgid.link/20260520064421.91569-2-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/enetc/enetc_pf.c