From d38a53b175935066b7a7a9c1d632c5f92cea7f5d Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Fri, 15 Oct 2021 23:05:44 +0800 Subject: [PATCH] vdpa/mlx5: workaround FW first completion in start After a vDPA application restart, Qemu restores VQ with used and available index, new incoming packet triggers virtio driver to handle buffers. Under heavy traffic, no available buffer for firmware to receive new packets, no Rx interrupts generated, driver is stuck on endless interrupt waiting. As a firmware workaround, this patch sends a notification after VQ setup to ask driver handling buffers and filling new buffers. Fixes: bff735011078 ("vdpa/mlx5: prepare virtio queues") Cc: stable@dpdk.org Signed-off-by: Xueming Li Reviewed-by: Matan Azrad Reviewed-by: Maxime Coquelin --- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c index cfd50d92f5..c5b357a83b 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -367,6 +368,9 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index) goto error; } virtq->stopped = false; + /* Initial notification to ask Qemu handling completed buffers. */ + if (virtq->eqp.cq.callfd != -1) + eventfd_write(virtq->eqp.cq.callfd, (eventfd_t)1); DRV_LOG(DEBUG, "vid %u virtq %u was created successfully.", priv->vid, index); return 0; -- 2.39.5