Index: sys/dev/bnxt/bnxt_en/if_bnxt.c =================================================================== --- sys/dev/bnxt/bnxt_en/if_bnxt.c +++ sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -246,7 +246,7 @@ static int bnxt_wol_config(if_ctx_t ctx); static bool bnxt_if_needs_restart(if_ctx_t, enum iflib_restart_event); static int bnxt_i2c_req(if_ctx_t ctx, struct ifi2creq *i2c); -static void bnxt_get_port_module_status(struct bnxt_softc *softc); +static void bnxt_get_port_module_status(struct bnxt_softc *softc, bool is_event); static void bnxt_rdma_aux_device_init(struct bnxt_softc *softc); static void bnxt_rdma_aux_device_uninit(struct bnxt_softc *softc); static void bnxt_queue_fw_reset_work(struct bnxt_softc *bp, unsigned long delay); @@ -2975,7 +2975,7 @@ } } -static void bnxt_get_port_module_status(struct bnxt_softc *softc) +static void bnxt_get_port_module_status(struct bnxt_softc *softc, bool is_event) { struct bnxt_link_info *link_info = &softc->link_info; struct hwrm_port_phy_qcfg_output *resp = &link_info->phy_qcfg_resp; @@ -2986,19 +2986,24 @@ module_status = link_info->module_status; switch (module_status) { - case HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX: - case HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN: - case HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG: - device_printf(softc->dev, "Unqualified SFP+ module detected on port %d\n", - softc->pf.port_id); - if (softc->hwrm_spec_code >= 0x10201) { - device_printf(softc->dev, "Module part number %s\n", - resp->phy_vendor_partnumber); + if (is_event) { + case HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_CURRENTFAULT: + device_printf(softc->dev, "Module disabled due to current fault\n"); + } else { + case HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX: + case HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN: + case HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG: + device_printf(softc->dev, "Unqualified SFP+ module detected on port %d\n", + softc->pf.port_id); + if (softc->hwrm_spec_code >= 0x10201) { + device_printf(softc->dev, "Module part number %s\n", + resp->phy_vendor_partnumber); + } + if (module_status == HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX) + device_printf(softc->dev, "TX is disabled\n"); + if (module_status == HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN) + device_printf(softc->dev, "SFP+ module is shutdown\n"); } - if (module_status == HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX) - device_printf(softc->dev, "TX is disabled\n"); - if (module_status == HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN) - device_printf(softc->dev, "SFP+ module is shutdown\n"); } } @@ -3253,7 +3258,7 @@ } bnxt_do_enable_intr(&softc->def_cp_ring); - bnxt_get_port_module_status(softc); + bnxt_get_port_module_status(softc, false); bnxt_media_status(softc->ctx, &ifmr); bnxt_hwrm_cfa_l2_set_rx_mask(softc, &softc->vnic_info); return; @@ -3701,6 +3706,7 @@ if (bit_test(softc->state_bv, BNXT_STATE_LINK_CHANGE)) { bit_clear(softc->state_bv, BNXT_STATE_LINK_CHANGE); + bnxt_get_port_module_status(softc, true); bnxt_media_status(softc->ctx, &ifmr); } } @@ -4394,7 +4400,7 @@ return (rc); } - bnxt_get_port_module_status(softc); + bnxt_get_port_module_status(softc, false); /*initialize the ethool setting copy with NVM settings */ if (link_info->auto_mode != HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE)