034d00d485
The code of setting RX descriptor status field maybe work fine in previously, however with the update of glibc version, it shows two issues when guest using dpdk receive packets: 1. The dpdk has a certain probability getting wrong buffer_addr this impact may be not obvious, such as lost a packet once in a while 2. The dpdk may consume a packet twice when scan the RX desc queue over again this impact will lead a infinite wait in Qemu, since the RDT (tail pointer) be inscreased to equal to RDH by unexpected, which regard as the RX desc queue is full Write a whole of RX desc with DD flag on is not quite correct, because when the underlying implementation of memcpy using XMM registers to copy e1000_rx_desc (when AVX or something else CPU feature is usable), the bytes order of desc writing to memory is indeterminacy We can use full-scale test case to reproduce the issue-2 by https://github.com/BASM/qemu_dpdk_e1000_test (thanks to Leonid Myravjev) I also write a POC test case at https://github.com/cdkey/e1000_poc which can reproduce both of them, and easy to verify the patch effect. The hw watchpoint also shows that, when Qemu using XMM related instructions writing 16 bytes e1000_rx_desc, concurrent with DPDK using movb writing 1 byte status, the final result of writing to memory will be one of them, if it made by Qemu which DD flag is on, DPDK will consume it again. Setting DD status in a separate operation, can prevent the impact of disorder memory writing by memcpy, also avoid unexpected data when concurrent writing status by qemu and guest dpdk. Links: https://lore.kernel.org/qemu-devel/20200102110504.GG121208@stefanha-x1.localdomain/T/ Reported-by: Leonid Myravjev <asm@asm.pp.ru> Cc: Stefan Hajnoczi <stefanha@gmail.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: qemu-stable@nongnu.org Tested-by: Jing Zhang <zhangjing@sangfor.com.cn> Reviewed-by: Frank Lee <lifan38153@sangfor.com.cn> Signed-off-by: Ding Hui <dinghui@sangfor.com.cn> Signed-off-by: Jason Wang <jasowang@redhat.com> |
||
---|---|---|
.. | ||
can | ||
fsl_etsec | ||
rocker | ||
allwinner_emac.c | ||
allwinner-sun8i-emac.c | ||
cadence_gem.c | ||
dp8393x.c | ||
e1000_regs.h | ||
e1000.c | ||
e1000e_core.c | ||
e1000e_core.h | ||
e1000e.c | ||
e1000x_common.c | ||
e1000x_common.h | ||
eepro100.c | ||
etraxfs_eth.c | ||
ftgmac100.c | ||
i82596.c | ||
i82596.h | ||
imx_fec.c | ||
Kconfig | ||
lan9118.c | ||
lance.c | ||
lasi_i82596.c | ||
mcf_fec.c | ||
meson.build | ||
mipsnet.c | ||
msf2-emac.c | ||
mv88w8618_eth.c | ||
ne2000-isa.c | ||
ne2000-pci.c | ||
ne2000.c | ||
ne2000.h | ||
net_rx_pkt.c | ||
net_rx_pkt.h | ||
net_tx_pkt.c | ||
net_tx_pkt.h | ||
npcm7xx_emc.c | ||
opencores_eth.c | ||
pcnet-pci.c | ||
pcnet.c | ||
pcnet.h | ||
rtl8139.c | ||
smc91c111.c | ||
spapr_llan.c | ||
stellaris_enet.c | ||
sungem.c | ||
sunhme.c | ||
trace-events | ||
trace.h | ||
tulip.c | ||
tulip.h | ||
vhost_net-stub.c | ||
vhost_net.c | ||
virtio-net.c | ||
vmware_utils.h | ||
vmxnet3_defs.h | ||
vmxnet3.c | ||
vmxnet3.h | ||
vmxnet_debug.h | ||
xen_nic.c | ||
xgmac.c | ||
xilinx_axienet.c | ||
xilinx_ethlite.c |