Subscribing to netport events is not permitted on VFs.

Signed-off-by: Ivan Malov <[email protected]>
Reviewed-by: Andy Moreton <[email protected]>
---
 drivers/common/sfc_efx/base/efx_np.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/common/sfc_efx/base/efx_np.c 
b/drivers/common/sfc_efx/base/efx_np.c
index e05e2cb487..1563fbae37 100644
--- a/drivers/common/sfc_efx/base/efx_np.c
+++ b/drivers/common/sfc_efx/base/efx_np.c
@@ -1005,6 +1005,7 @@ efx_np_set_event_mask(
        __in            efx_np_handle_t nph,
        __in            boolean_t want_linkchange_events)
 {
+       const efx_nic_cfg_t *encp = &enp->en_nic_cfg;
        EFX_MCDI_DECLARE_BUF(payload,
            MC_CMD_SET_NETPORT_EVENTS_MASK_IN_LEN,
            MC_CMD_SET_NETPORT_EVENTS_MASK_OUT_LEN);
@@ -1012,6 +1013,10 @@ efx_np_set_event_mask(
        efx_dword_t dword;
        efx_rc_t rc;
 
+       /* VFs do not allow subscription to link change events. */
+       if (EFX_PCI_FUNCTION_IS_VF(encp))
+               return (0);
+
        req.emr_out_length = MC_CMD_SET_NETPORT_EVENTS_MASK_OUT_LEN;
        req.emr_in_length = MC_CMD_SET_NETPORT_EVENTS_MASK_IN_LEN;
        req.emr_cmd = MC_CMD_SET_NETPORT_EVENTS_MASK;
-- 
2.47.3

Reply via email to