Commit 9e0945b1 authored by Heng Qi's avatar Heng Qi Committed by Jakub Kicinski

virtio_net: fix possible dim status unrecoverable

When the dim worker is scheduled, if it no longer needs to issue
commands, dim may not be able to return to the working state later.

For example, the following single queue scenario:
  1. The dim worker of rxq0 is scheduled, and the dim status is
     changed to DIM_APPLY_NEW_PROFILE;
  2. dim is disabled or parameters have not been modified;
  3. virtnet_rx_dim_work exits directly;

Then, even if net_dim is invoked again, it cannot work because the
state is not restored to DIM_START_MEASURE.

Fixes: 62087995 ("virtio-net: support rx netdim")
Signed-off-by: default avatarHeng Qi <hengqi@linux.alibaba.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarXuan Zhuo <xuanzhuo@linux.alibaba.com>
Link: https://lore.kernel.org/r/20240528134116.117426-2-hengqi@linux.alibaba.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 89e281eb
...@@ -4419,9 +4419,9 @@ static void virtnet_rx_dim_work(struct work_struct *work) ...@@ -4419,9 +4419,9 @@ static void virtnet_rx_dim_work(struct work_struct *work)
if (err) if (err)
pr_debug("%s: Failed to send dim parameters on rxq%d\n", pr_debug("%s: Failed to send dim parameters on rxq%d\n",
dev->name, qnum); dev->name, qnum);
dim->state = DIM_START_MEASURE;
} }
out: out:
dim->state = DIM_START_MEASURE;
mutex_unlock(&rq->dim_lock); mutex_unlock(&rq->dim_lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment