genode/repos/os/src/drivers
Piotr Tworek 880cd3a490 virtio_nic: Fix packet transmission handling.
The problem can be seen when running nic_router_flood scenarion on arm
qemu_virt boards. With the amount of data this scenario tries to send
the driver quickly complains it has failed to push data into TX VirtIO
queue. After this warning message is printed nothing really happens and
after a while the test scenario fails.

The fact that we can't write all available data to the device is not
unexpected. VirtIO queue size is slected at initialization time and we
don't change it during driver lifetime. It can be tweaked via driver
config, but this does not change the fact that we'll always be able to
produce more data packets than we have free space in the VirtIO queue.

IMO the expected behavior of the driver in such case should be to:
1. Notify the device there is data to process.
2. Wait for the device to process at least part of it.
3. Retry sending queued packets.

One could expect returning Transmit_result::RETRY from _drv_transmit_pkt
would produce such result. Unfortunately it seems that Uplink_client_base
treats RETRY return value as indication of link being down. It'll retry
sending the packet only after the device notifies it the link is once
again up. This is the reason why nothing happens when running
nic_router_flood on top of virtio_nic driver. The link never goes down
in this case so once we fill the TX VirtIO queue and tell the base class
to retry the send, we'll be stuck waiting for link up change event
which will never arrive.

To fix this problem, when sending a packet to the device fails, do a
synchrnonus TX VirtIO queue flush (tell device there is data to process
and wait until its done with it).

With this fix in place nic_router_flood test scenario passes on both arm
qemu_virt boards.

Issue #4264
2021-10-13 14:46:51 +02:00
..
acpi acpi_drv: use expanding reporter 2021-04-20 12:10:58 +02:00
ahci platform_session: cache arg for alloc_dma_buffer 2021-04-20 12:10:57 +02:00
audio/spec/linux Avoid use of deprecated Xml_node methods 2020-05-18 10:16:14 +02:00
framebuffer ram_fb_drv: RAM framebuffer driver for Qemu 2021-08-30 15:00:38 +02:00
gpio Streamline platform-device API on ARM 2021-04-20 12:10:58 +02:00
gpu/intel gpu/intel: provide supported devices as config 2021-10-13 14:46:51 +02:00
i2c i2c: extend API to support transactions 2021-05-28 14:16:45 +02:00
nic virtio_nic: Fix packet transmission handling. 2021-10-13 14:46:51 +02:00
nvme platform_session: cache arg for alloc_dma_buffer 2021-04-20 12:10:57 +02:00
platform imx8mq_platform_drv: introduce reset domains 2021-05-28 14:16:45 +02:00
ps2 platform driver: make device info XML optional 2021-05-05 11:31:16 +02:00
rtc rtc_drv: defer init until first use 2021-04-20 12:03:03 +02:00
sd_card platform driver: make device info XML optional 2021-05-05 11:31:16 +02:00
touch/synaptics_dsx platform driver: make device info XML optional 2021-05-05 11:31:16 +02:00
uart Retire Exynos 5 support (fix #3725) 2020-04-17 12:53:57 +02:00
usb_block usb_block: fix upper block-number range check 2020-08-25 11:50:11 +02:00
virtdev_rom platform driver: make device info XML optional 2021-05-05 11:31:16 +02:00