Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109421629
D46951.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
10 KB
Referenced Files
None
Subscribers
None
D46951.diff
View Options
diff --git a/sys/dev/ice/ice_controlq.c b/sys/dev/ice/ice_controlq.c
--- a/sys/dev/ice/ice_controlq.c
+++ b/sys/dev/ice/ice_controlq.c
@@ -879,16 +879,35 @@
struct ice_ctl_q_ring *sq = &cq->sq;
u16 ntc = sq->next_to_clean;
struct ice_aq_desc *desc;
+ u32 head;
desc = ICE_CTL_Q_DESC(*sq, ntc);
- while (rd32(hw, cq->sq.head) != ntc) {
- ice_debug(hw, ICE_DBG_AQ_MSG, "ntc %d head %d.\n", ntc, rd32(hw, cq->sq.head));
+ head = rd32(hw, sq->head);
+ if (head >= sq->count) {
+ ice_debug(hw, ICE_DBG_AQ_MSG,
+ "Read head value (%d) exceeds allowed range.\n",
+ head);
+ return 0;
+ }
+
+ while (head != ntc) {
+ ice_debug(hw, ICE_DBG_AQ_MSG,
+ "ntc %d head %d.\n",
+ ntc, head);
ice_memset(desc, 0, sizeof(*desc), ICE_DMA_MEM);
ntc++;
if (ntc == sq->count)
ntc = 0;
desc = ICE_CTL_Q_DESC(*sq, ntc);
+
+ head = rd32(hw, sq->head);
+ if (head >= sq->count) {
+ ice_debug(hw, ICE_DBG_AQ_MSG,
+ "Read head value (%d) exceeds allowed range.\n",
+ head);
+ return 0;
+ }
}
sq->next_to_clean = ntc;
diff --git a/sys/dev/ice/ice_drv_info.h b/sys/dev/ice/ice_drv_info.h
--- a/sys/dev/ice/ice_drv_info.h
+++ b/sys/dev/ice/ice_drv_info.h
@@ -62,16 +62,16 @@
* @var ice_rc_version
* @brief driver release candidate version number
*/
-const char ice_driver_version[] = "1.42.5-k";
+const char ice_driver_version[] = "1.43.2-k";
const uint8_t ice_major_version = 1;
-const uint8_t ice_minor_version = 42;
-const uint8_t ice_patch_version = 5;
+const uint8_t ice_minor_version = 43;
+const uint8_t ice_patch_version = 2;
const uint8_t ice_rc_version = 0;
#define PVIDV(vendor, devid, name) \
- PVID(vendor, devid, name " - 1.42.5-k")
+ PVID(vendor, devid, name " - 1.43.2-k")
#define PVIDV_OEM(vendor, devid, svid, sdevid, revid, name) \
- PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.42.5-k")
+ PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.43.2-k")
/**
* @var ice_vendor_info_array
diff --git a/sys/dev/ice/ice_lib.h b/sys/dev/ice/ice_lib.h
--- a/sys/dev/ice/ice_lib.h
+++ b/sys/dev/ice/ice_lib.h
@@ -395,6 +395,16 @@
*/
#define ICE_I2C_MAX_RETRIES 10
+/*
+ * The Get Link Status AQ command and other link commands can return
+ * EAGAIN, indicating that the FW Link Management engine is busy.
+ * Define the number of times that the driver should retry sending these
+ * commands and the amount of time it should wait between those retries
+ * (in milliseconds) here.
+ */
+#define ICE_LINK_AQ_MAX_RETRIES 10
+#define ICE_LINK_RETRY_DELAY 17
+
/*
* The Start LLDP Agent AQ command will fail if it's sent too soon after
* the LLDP agent is stopped. The period between the stop and start
@@ -698,6 +708,7 @@
ICE_STATE_FIRST_INIT_LINK,
ICE_STATE_DO_CREATE_MIRR_INTFC,
ICE_STATE_DO_DESTROY_MIRR_INTFC,
+ ICE_STATE_PHY_FW_INIT_PENDING,
/* This entry must be last */
ICE_STATE_LAST,
};
diff --git a/sys/dev/ice/ice_lib.c b/sys/dev/ice/ice_lib.c
--- a/sys/dev/ice/ice_lib.c
+++ b/sys/dev/ice/ice_lib.c
@@ -3308,7 +3308,8 @@
pi->phy.curr_user_speed_req = sysctl_speeds;
- if (!ice_test_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN) && !sc->link_up)
+ if (!ice_test_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN) &&
+ !sc->link_up && !(if_getflags(sc->ifp) & IFF_UP))
return 0;
/* Apply settings requested by user */
@@ -6246,11 +6247,12 @@
"\n\t 0x20000 - Resources" \
"\n\t 0x40000 - ACL" \
"\n\t 0x80000 - PTP" \
-"\n\t 0x100000 - Admin Queue messages" \
-"\n\t 0x200000 - Admin Queue descriptors" \
-"\n\t 0x400000 - Admin Queue descriptor buffers" \
-"\n\t 0x800000 - Admin Queue commands" \
-"\n\t 0x1000000 - Parser" \
+"\n\t ..." \
+"\n\t 0x1000000 - Admin Queue messages" \
+"\n\t 0x2000000 - Admin Queue descriptors" \
+"\n\t 0x4000000 - Admin Queue descriptor buffers" \
+"\n\t 0x8000000 - Admin Queue commands" \
+"\n\t 0x10000000 - Parser" \
"\n\t ..." \
"\n\t 0x80000000 - (Reserved for user)" \
"\n\t" \
@@ -9493,15 +9495,28 @@
struct ice_port_info *pi = sc->hw.port_info;
struct ice_hw *hw = &sc->hw;
device_t dev = sc->dev;
- int status;
+ int status, retry_count = 0;
+retry:
pi->phy.get_link_info = true;
status = ice_get_link_status(pi, &sc->link_up);
+
if (status) {
- device_printf(dev,
- "%s: ice_get_link_status failed; status %s, aq_err %s\n",
- __func__, ice_status_str(status),
- ice_aq_str(hw->adminq.sq_last_status));
+ if (hw->adminq.sq_last_status == ICE_AQ_RC_EAGAIN) {
+ retry_count++;
+ ice_debug(hw, ICE_DBG_LINK,
+ "%s: ice_get_link_status failed with EAGAIN, attempt %d\n",
+ __func__, retry_count);
+ if (retry_count < ICE_LINK_AQ_MAX_RETRIES) {
+ ice_msec_pause(ICE_LINK_RETRY_DELAY);
+ goto retry;
+ }
+ } else {
+ device_printf(dev,
+ "%s: ice_get_link_status failed; status %s, aq_err %s\n",
+ __func__, ice_status_str(status),
+ ice_aq_str(hw->adminq.sq_last_status));
+ }
return;
}
diff --git a/sys/dev/ice/ice_strings.c b/sys/dev/ice/ice_strings.c
--- a/sys/dev/ice/ice_strings.c
+++ b/sys/dev/ice/ice_strings.c
@@ -1052,6 +1052,8 @@
return "DO_CREATE_MIRR_INTFC";
case ICE_STATE_DO_DESTROY_MIRR_INTFC:
return "DO_DESTROY_MIRR_INTFC";
+ case ICE_STATE_PHY_FW_INIT_PENDING:
+ return "PHY_FW_INIT_PENDING";
case ICE_STATE_LAST:
return NULL;
}
diff --git a/sys/dev/ice/ice_switch.c b/sys/dev/ice/ice_switch.c
--- a/sys/dev/ice/ice_switch.c
+++ b/sys/dev/ice/ice_switch.c
@@ -4292,8 +4292,6 @@
if (!itr->vsi_list_info ||
!ice_is_bit_set(itr->vsi_list_info->vsi_map, vsi_handle))
continue;
- /* Clearing it so that the logic can add it back */
- ice_clear_bit(vsi_handle, itr->vsi_list_info->vsi_map);
f_entry.fltr_info.vsi_handle = vsi_handle;
f_entry.fltr_info.fltr_act = ICE_FWD_TO_VSI;
/* update the src in case it is VSI num */
diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c
--- a/sys/dev/ice/if_ice_iflib.c
+++ b/sys/dev/ice/if_ice_iflib.c
@@ -84,6 +84,7 @@
static int ice_if_suspend(if_ctx_t ctx);
static int ice_if_resume(if_ctx_t ctx);
static bool ice_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event);
+static void ice_init_link(struct ice_softc *sc);
static int ice_setup_mirror_vsi(struct ice_mirr_if *mif);
static int ice_wire_mirror_intrs(struct ice_mirr_if *mif);
static void ice_free_irqvs_subif(struct ice_mirr_if *mif);
@@ -833,9 +834,8 @@
/* Get DCBX/LLDP state and start DCBX agent */
ice_init_dcb_setup(sc);
- /* Setup link configuration parameters */
- ice_init_link_configuration(sc);
- ice_update_link_status(sc, true);
+ /* Setup link, if PHY FW is ready */
+ ice_init_link(sc);
/* Configure interrupt causes for the administrative interrupt */
ice_configure_misc_interrupts(sc);
@@ -2136,6 +2136,18 @@
struct ice_hw *hw = &sc->hw;
struct ice_port_info *pi = hw->port_info;
+ /* E830 only: There's no interrupt for when the PHY FW has finished loading,
+ * so poll for the status in the media task here if it's previously
+ * been detected that it's still loading.
+ */
+ if (ice_is_e830(hw) &&
+ ice_test_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING)) {
+ if (rd32(hw, GL_MNG_FWSM) & GL_MNG_FWSM_FW_LOADING_M)
+ ice_clear_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING);
+ else
+ return;
+ }
+
if (ice_test_state(&sc->state, ICE_STATE_NO_MEDIA)) {
pi->phy.get_link_info = true;
ice_get_link_status(pi, &sc->link_up);
@@ -2705,11 +2717,11 @@
if (hw->port_info->qos_cfg.is_sw_lldp)
ice_add_rx_lldp_filter(sc);
- /* Refresh link status */
+ /* Apply previous link settings and refresh link status, if PHY
+ * FW is ready.
+ */
ice_clear_state(&sc->state, ICE_STATE_LINK_STATUS_REPORTED);
- sc->hw.port_info->phy.get_link_info = true;
- ice_get_link_status(sc->hw.port_info, &sc->link_up);
- ice_update_link_status(sc, true);
+ ice_init_link(sc);
/* RDMA interface will be restarted by the stack re-init */
@@ -2795,12 +2807,23 @@
* resetting.
*/
IFLIB_CTX_UNLOCK(sc);
+
+#define ICE_EMPR_ADDL_WAIT_MSEC_SLOW 20000
+ if ((ice_is_e830(hw) || ice_is_e825c(hw)) &&
+ (((rd32(hw, GLGEN_RSTAT) & GLGEN_RSTAT_RESET_TYPE_M) >>
+ GLGEN_RSTAT_RESET_TYPE_S) == ICE_RESET_EMPR))
+ ice_msec_pause(ICE_EMPR_ADDL_WAIT_MSEC_SLOW);
+
status = ice_check_reset(hw);
IFLIB_CTX_LOCK(sc);
if (status) {
device_printf(dev, "Device never came out of reset, err %s\n",
ice_status_str(status));
+
ice_set_state(&sc->state, ICE_STATE_RESET_FAILED);
+ ice_clear_state(&sc->state, ICE_STATE_RESET_PFR_REQ);
+ ice_clear_state(&sc->state, ICE_STATE_PREPARED_FOR_RESET);
+ device_printf(dev, "Reset failed; please reload the device driver\n");
return;
}
@@ -2888,16 +2911,8 @@
if (ice_is_e810(hw))
ice_set_bit(ICE_FEATURE_PHY_STATISTICS, sc->feat_en);
- /* Set capabilities based on device */
- switch (hw->device_id) {
- case ICE_DEV_ID_E825C_BACKPLANE:
- case ICE_DEV_ID_E825C_QSFP:
- case ICE_DEV_ID_E825C_SFP:
+ if (ice_is_e825c(hw))
ice_set_bit(ICE_FEATURE_DUAL_NAC, sc->feat_cap);
- break;
- default:
- break;
- }
/* Disable features due to hardware limitations... */
if (!hw->func_caps.common_cap.rss_table_size)
ice_clear_bit(ICE_FEATURE_RSS, sc->feat_cap);
@@ -3303,6 +3318,38 @@
}
}
+/**
+ * ice_init_link - Do link configuration and link status reporting
+ * @sc: driver private structure
+ *
+ * Contains an extra check that skips link config when an E830 device
+ * does not have the "FW_LOADING"/"PHYBUSY" bit set in GL_MNG_FWSM set.
+ */
+static void
+ice_init_link(struct ice_softc *sc)
+{
+ struct ice_hw *hw = &sc->hw;
+ device_t dev = sc->dev;
+
+ /* Check if FW is ready before setting up link; defer setup to the
+ * admin task if it isn't.
+ */
+ if (ice_is_e830(hw) &&
+ (rd32(hw, GL_MNG_FWSM) & GL_MNG_FWSM_FW_LOADING_M)) {
+ ice_set_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING);
+ device_printf(dev,
+ "Link initialization is blocked by PHY FW initialization.\n");
+ device_printf(dev,
+ "Link initialization will continue after PHY FW initialization completes.\n");
+ /* Do not access PHY config while PHY FW is busy initializing */
+ } else {
+ ice_clear_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING);
+ ice_init_link_configuration(sc);
+ ice_update_link_status(sc, true);
+ }
+
+}
+
extern struct if_txrx ice_subif_txrx;
/**
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 5, 8:43 PM (19 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16480550
Default Alt Text
D46951.diff (10 KB)
Attached To
Mode
D46951: ice: Update to 1.43.2-k
Attached
Detach File
Event Timeline
Log In to Comment