MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ecore_state_wait

Function ecore_state_wait

dpdk/drivers/net/bnx2x/ecore_sp.c:284–322  ·  view source on GitHub ↗

* ecore_state_wait - wait until the given bit(state) is cleared * * @sc: device handle * @state: state which is to be cleared * @state_p: state buffer * */

Source from the content-addressed store, hash-verified

282 *
283 */
284static int ecore_state_wait(struct bnx2x_softc *sc, int state,
285 uint32_t *pstate)
286{
287 /* can take a while if any port is running */
288 int cnt = 5000;
289
290 if (CHIP_REV_IS_EMUL(sc))
291 cnt *= 20;
292
293 ECORE_MSG(sc, "waiting for state to become %d", state);
294
295 ECORE_MIGHT_SLEEP();
296 while (cnt--) {
297 bnx2x_intr_legacy(sc);
298 if (!ECORE_TEST_BIT(state, pstate)) {
299#ifdef ECORE_STOP_ON_ERROR
300 ECORE_MSG(sc, "exit (cnt %d)", 5000 - cnt);
301#endif
302 rte_atomic32_set(&sc->scan_fp, 0);
303 return ECORE_SUCCESS;
304 }
305
306 ECORE_WAIT(sc, delay_us);
307
308 if (sc->panic) {
309 rte_atomic32_set(&sc->scan_fp, 0);
310 return ECORE_IO;
311 }
312 }
313
314 /* timeout! */
315 PMD_DRV_LOG(ERR, sc, "timeout waiting for state %d", state);
316 rte_atomic32_set(&sc->scan_fp, 0);
317#ifdef ECORE_STOP_ON_ERROR
318 ecore_panic();
319#endif
320
321 return ECORE_TIMEOUT;
322}
323
324static int ecore_raw_wait(struct bnx2x_softc *sc, struct ecore_raw_obj *raw)
325{

Callers 5

ecore_raw_waitFunction · 0.85
ecore_mcast_waitFunction · 0.85
ecore_queue_wait_compFunction · 0.85
ecore_func_wait_compFunction · 0.85

Calls 2

bnx2x_intr_legacyFunction · 0.85
rte_atomic32_setFunction · 0.85

Tested by

no test coverage detected