DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] "No probed ethernet devices" caused by inaccurate msec_delay()
@ 2014-01-27  2:56 Sangjin Han
  2014-01-27  9:19 ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: Sangjin Han @ 2014-01-27  2:56 UTC (permalink / raw)
  To: dev

Hi,

I encountered this error message when I tried to use the testpmd application.

Cause: No probed ethernet devices - check that
CONFIG_RTE_LIBRTE_IGB_PMD=y and that CONFIG_RTE_LIBRTE_EM_PMD=y and
that CONFIG_RTE_LIBRTE_IXGBE_PMD=y in your configuration file

which is caused by rte_eth_dev_count() == 0. However, my 82599 ports
are already unbound from ixgbe. (I have two Xeon X5560 (@ 2.80GHz)
processors and two X520-DA2 cards).

I googled for possible causes and came across a similar case:
http://openetworking.blogspot.com/2014/01/debugging-no-probed-ethernet-devices.html

Based on the article, I dug into the source code, and found the cause:

ixgbe_82599.c: ixgbe_reset_pipeline_82599()
...
for (i = 0; i < 10; i++) {
        msec_delay(4);
        anlp1_reg = IXGBE_READ_REG(hw, IXGBE_ANLP1);
        if (anlp1_reg & IXGBE_ANLP1_AN_STATE_MASK)
                break;
}

if (!(anlp1_reg & IXGBE_ANLP1_AN_STATE_MASK)) {
        DEBUGOUT("auto negotiation not completed\n");
        ret_val = IXGBE_ERR_RESET_FAILED;
        goto reset_pipeline_out;
}
...

The number of iterations (== 10) in the for loop was not enough. In my
case, it needed to be at least 12, then everything worked fine.

The issue was that msec_delay() is not very accurate on my system.
While it reads the CPU Hz info from /proc/cpuinfo, it may not reflect
the actual TSCs/sec. Since I did not disable the P-State feature ,
/proc/cpuinfo reports 1.6GHz, but my TSC counter is 2.8GHz. As a
result, msec_delay(4) only waited 2.x milliseconds, which in turn
causes the failure.

I think /proc/cpuinfo is not a reliable way to get
eal_tsc_resolution_hz, since it varies based on the current CPU clock
frequency. Enforcing applications to run at the max frequency can be
too restrictive. It would be nice if I can bypass
set_tsc_freq_from_cpuinfo() in set_tsc_freq().

Thanks,
Sangjin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-01-28 18:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-27  2:56 [dpdk-dev] "No probed ethernet devices" caused by inaccurate msec_delay() Sangjin Han
2014-01-27  9:19 ` Thomas Monjalon
2014-01-28  1:16   ` Sangjin Han
2014-01-28 16:23     ` Thomas Monjalon
2014-01-28 18:13       ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).