Open james-jra opened 7 years ago
That's an interesting problem, I suspect that the counters are wrong because we don't have an explicit implementation of statistics for the ixgbevf driver, so it falls back to the DPDK implementation.
The DPDK stats are unfortunately vastly inconsistent between different drivers, IIRC ixgbe didn't count "missed" packets properly in DPDK which is why we re-implemented this part.
I unfortunately don't have a SR-IOV setup here at the moment, so I can't reproduce this at the moment. But I've wanted to take a deeper look at SR-IOV in the near future anyways. Might be able to test it without a VM but with SR-IOV next week.
A few things to try:
mg.sleepMicros(micros)
which directly calls rte_delay_us()) afterwards in the loop.Thanks for getting back to me, and providing some suggestions for looking into this.
I've since run some more tests corresponding to your suggestions. The topology for tests 1 & 2 used one VM with 2 vNICs, one from each physical 10GEth port, which are connected by physical cable. Test 5 used 2 separate VMs with one vNIC each. All tests ran for 30 seconds and measured total TX packets and total RX packets.
Manually counting packets gives the same results as reported by the device.
(For this, I used the values returned by queue:send()
on the tx-side and
queue:tryRecv()
on the rx-side).
This confirms your assertion that the RX device is not counting missed
packets rte_eth_stats_get()
always returns imissed = 0
Right you are, I'd stopped reading after seeing rte_eth_tx_burst
in
src/software-rate-limiter.cpp
and didn't realise you were only passing a
single packet.
Running simple burst rate control (queue:send()
followed by
mg.sleepMicros()
) gave lesser packet loss than software rate-limited, and
was linear with requested rate.
All counter types were consistent in this test.
I've attached a graph to show dependence of % packet loss on offered rate.
3&4. It is not currently convenient to make the necessary changes to our OpenStack rig to investigate these.
I wrote a simple tight-loop in C using DPDK to poll a receive queue from a second VM and used this instead of MoonGen as my endpoint to repeat the first 2 tests. main.c.txt
This showed zero packet loss across the whole test range in both cases. This confirms that packets were indeed being lost on the RX side of transmission.
My interpretation of these results is that the RX queue's ring buffer was being
filled, and then packets were dropped (but not reported due to the previously
mentioned stats unreliability for the ixgbevf driver).
The solution to this is therefore to poll the ring buffer more frequently (as in
the C receive tight-loop), or increase the size of the ring buffer (by
passing a large rxDescs
value when configuring the device).
As I understand it, I shouldn't expect to be dropping packets at the rates tested above, so I think that using SR-IOV vfs and/or running in a VM must have some performance impact too.
I read through the relevant parts of the 82599 and X550 datasheets and there is simply no counter for missed packets in a VF :(
So you will have to receive every single packet from the VF to count them, no way around that, unfortunately
A few observations:
You still shouldn't see packet loss, though. Will run some more tests later
System
Ubuntu 14.04 VM running on OpenStack Mikata Using SR-IOV and 1 Intel X520 NICs (total of 2 physical 10GEth ports) Latest version on MoonGen.
Topology
For the purposes of this test, I used a single VM with 2 vNICs, 1 for each physical port, connected by physical cable.
Issue
In simple tests of transmitting from one interface, and receiving at another over a physical cable, MoonGen's counters report a packet loss when the transmission rate is above ~ 0.5 million packets per second. The packet loss is less significant when not using software rate control, but is still present. I imagine this difference is due to the fact software rate control really transmits in short line-rate bursts. (Hardware rate control is not supported on this device driver, but just sends at some rate).
This packet_loss.lua.txt test script was used.
Example MoonGen trace for back-to-back transmission. This test used software rate-control, sending at 0.6 Mpps over 10 seconds, the receiver hangs until no packets were received in a 5 second period. It showed around 2000 packets lost over a 10 second run: