Skip to content

Commit

Permalink
virtio_net: fix possible dim status unrecoverable
Browse files Browse the repository at this point in the history
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: 6208799 ("virtio-net: support rx netdim")
Signed-off-by: Heng Qi <hengqi@linux.alibaba.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: NipaLocal <nipa@local>
  • Loading branch information
Heng Qi authored and NipaLocal committed May 27, 2024
1 parent e258a2c commit 4c1b78a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -4417,9 +4417,9 @@ static void virtnet_rx_dim_work(struct work_struct *work)
if (err)
pr_debug("%s: Failed to send dim parameters on rxq%d\n",
dev->name, qnum);
dim->state = DIM_START_MEASURE;
}
out:
dim->state = DIM_START_MEASURE;
mutex_unlock(&rq->dim_lock);
}

Expand Down

0 comments on commit 4c1b78a

Please sign in to comment.