ice(4): Support Total Port Shutdown on E830 devices

When 'Permit Total Port Shutdown' feature in BIOS is enabled then Port
Disable bit is set in the Link Default Override Mask TLV PFA module
in the NVM. In this mode, the driver acts as if the link_active_on_if_down
flag is always disabled and disallow any change to that flag.
This feature applies for E830 and E835 NIC series.

Signed-off-by: Pawel Sobczyk <[email protected]>

Tested by:      Mateusz Moga <[email protected]>
MFC after:      2 weeks
Sponsored by:   Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D58149
This commit is contained in:
Sobczyk, Pawel authored and Krzysztof Galazka committed 2026-08-20 18:35:27 +02:00
1 parent 81a67bfebc
commit 0011cd9f88
4 files changed
+22 -5

No files matched your search

+10 -5
View File
@@ -4545,6 +4545,11 @@ ice_sysctl_set_link_active(SYSCTL_HANDLER_ARGS)
if ((ret) || (req->newptr == NULL))
return (ret);
if (ice_test_state(&sc->state, ICE_STATE_TOTAL_PORT_SHUTDOWN)) {
device_printf(sc->dev,
"Setting link_active_on_if_down not supported on this port\n");
return (EPERM);
}
if (mode)
ice_set_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN);
else
@@ -9872,6 +9877,11 @@ ice_set_link_management_mode(struct ice_softc *sc)
if (sc->hw.debug_mask & ICE_DBG_LINK)
ice_print_ldo_tlv(sc, &tlv);
/* Cache the LDO TLV structure in the driver, since it
* won't change during the driver's lifetime.
*/
sc->ldo_tlv = tlv;
/* Set lenient link mode */
if (ice_is_bit_set(sc->feat_cap, ICE_FEATURE_LENIENT_LINK_MODE) &&
(!(tlv.options & ICE_LINK_OVERRIDE_STRICT_MODE)))
@@ -9893,11 +9903,6 @@ ice_set_link_management_mode(struct ice_softc *sc)
ice_is_bit_set(sc->feat_en, ICE_FEATURE_LENIENT_LINK_MODE) &&
(tlv.options & ICE_LINK_OVERRIDE_EN))
ice_set_bit(ICE_FEATURE_LINK_MGMT_VER_1, sc->feat_en);
/* Cache the LDO TLV structure in the driver, since it
* won't change during the driver's lifetime.
*/
sc->ldo_tlv = tlv;
}
/**
+1
View File
@@ -712,6 +712,7 @@ enum ice_state {
ICE_STATE_MULTIPLE_TCS,
ICE_STATE_DO_FW_DEBUG_DUMP,
ICE_STATE_LINK_ACTIVE_ON_DOWN,
ICE_STATE_TOTAL_PORT_SHUTDOWN,
ICE_STATE_FIRST_INIT_LINK,
ICE_STATE_DO_CREATE_MIRR_INTFC,
ICE_STATE_DO_DESTROY_MIRR_INTFC,
+2
View File
@@ -1046,6 +1046,8 @@ ice_state_to_str(enum ice_state state)
return "DO_FW_DEBUG_DUMP";
case ICE_STATE_LINK_ACTIVE_ON_DOWN:
return "LINK_ACTIVE_ON_DOWN";
case ICE_STATE_TOTAL_PORT_SHUTDOWN:
return "TOTAL_PORT_SHUTDOWN";
case ICE_STATE_FIRST_INIT_LINK:
return "FIRST_INIT_LINK";
case ICE_STATE_DO_CREATE_MIRR_INTFC:
+9
View File
@@ -3464,6 +3464,15 @@ ice_init_link(struct ice_softc *sc)
/* Do not access PHY config while PHY FW is busy initializing */
} else {
ice_clear_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING);
if (ice_is_e830(hw)) {
if (!(sc->ldo_tlv.options & ICE_LINK_OVERRIDE_PORT_DIS))
return;
ice_set_state(&sc->state, ICE_STATE_TOTAL_PORT_SHUTDOWN);
ice_clear_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN);
}
ice_init_link_configuration(sc);
ice_update_link_status(sc, true);
}