Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171560246
D4333.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D4333.id.diff
View Options
Index: head/sys/dev/sfxge/common/hunt_nic.c
===================================================================
--- head/sys/dev/sfxge/common/hunt_nic.c
+++ head/sys/dev/sfxge/common/hunt_nic.c
@@ -1532,6 +1532,8 @@
uint32_t min_vi_count, max_vi_count;
uint32_t vi_count, vi_base;
uint32_t i;
+ uint32_t retry;
+ uint32_t delay_us;
efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
@@ -1622,14 +1624,48 @@
}
}
- /* Allocate a vAdapter attached to our upstream vPort/pPort */
- if ((rc = efx_mcdi_vadaptor_alloc(enp, EVB_PORT_ID_ASSIGNED)) != 0)
- goto fail5;
+ /*
+ * Allocate a vAdaptor attached to our upstream vPort/pPort.
+ *
+ * On a VF, this may fail with MC_CMD_ERR_NO_EVB_PORT (ENOENT) if the PF
+ * driver has yet to bring up the EVB port. See bug 56147. In this case,
+ * retry the request several times after waiting a while. The wait time
+ * between retries starts small (10ms) and exponentially increases.
+ * Total wait time is a little over two seconds. Retry logic in the
+ * client driver may mean this whole loop is repeated if it continues to
+ * fail.
+ */
+ retry = 0;
+ delay_us = 10000;
+ while ((rc = efx_mcdi_vadaptor_alloc(enp, EVB_PORT_ID_ASSIGNED)) != 0) {
+ if (EFX_PCI_FUNCTION_IS_PF(&enp->en_nic_cfg) ||
+ (rc != ENOENT)) {
+ /*
+ * Do not retry alloc for PF, or for other errors on
+ * a VF.
+ */
+ goto fail5;
+ }
+
+ /* VF startup before PF is ready. Retry allocation. */
+ if (retry > 5) {
+ /* Too many attempts */
+ rc = EINVAL;
+ goto fail6;
+ }
+ EFSYS_PROBE1(mcdi_no_evb_port_retry, int, retry);
+ EFSYS_SLEEP(delay_us);
+ retry++;
+ if (delay_us < 500000)
+ delay_us <<= 2;
+ }
enp->en_vport_id = EVB_PORT_ID_ASSIGNED;
return (0);
+fail6:
+ EFSYS_PROBE(fail6);
fail5:
EFSYS_PROBE(fail5);
fail4:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 12, 6:34 PM (2 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38811575
Default Alt Text
D4333.id.diff (1 KB)
Attached To
Mode
D4333: sfxge: retry VF vAdaptor allocation if it fails because of no EVB port yet
Attached
Detach File
Event Timeline
Log In to Comment