Commit bfb2b360 authored by Heng Qi's avatar Heng Qi Committed by David S. Miller

virtio-net: fix per queue coalescing parameter setting

When the user sets a non-zero coalescing parameter to 0 for a specific
virtqueue, it does not work as expected, so let's fix this.

Fixes: 394bd877 ("virtio_net: support per queue interrupt coalesce command")
Reported-by: default avatarXiaoming Zhao <zxm377917@alibaba-inc.com>
Cc: Gavin Li <gavinl@nvidia.com>
Signed-off-by: default avatarHeng Qi <hengqi@linux.alibaba.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e9420838
......@@ -3296,27 +3296,23 @@ static int virtnet_send_notf_coal_vq_cmds(struct virtnet_info *vi,
{
int err;
if (ec->rx_coalesce_usecs || ec->rx_max_coalesced_frames) {
err = virtnet_send_ctrl_coal_vq_cmd(vi, rxq2vq(queue),
ec->rx_coalesce_usecs,
ec->rx_max_coalesced_frames);
if (err)
return err;
/* Save parameters */
vi->rq[queue].intr_coal.max_usecs = ec->rx_coalesce_usecs;
vi->rq[queue].intr_coal.max_packets = ec->rx_max_coalesced_frames;
}
err = virtnet_send_ctrl_coal_vq_cmd(vi, rxq2vq(queue),
ec->rx_coalesce_usecs,
ec->rx_max_coalesced_frames);
if (err)
return err;
if (ec->tx_coalesce_usecs || ec->tx_max_coalesced_frames) {
err = virtnet_send_ctrl_coal_vq_cmd(vi, txq2vq(queue),
ec->tx_coalesce_usecs,
ec->tx_max_coalesced_frames);
if (err)
return err;
/* Save parameters */
vi->sq[queue].intr_coal.max_usecs = ec->tx_coalesce_usecs;
vi->sq[queue].intr_coal.max_packets = ec->tx_max_coalesced_frames;
}
vi->rq[queue].intr_coal.max_usecs = ec->rx_coalesce_usecs;
vi->rq[queue].intr_coal.max_packets = ec->rx_max_coalesced_frames;
err = virtnet_send_ctrl_coal_vq_cmd(vi, txq2vq(queue),
ec->tx_coalesce_usecs,
ec->tx_max_coalesced_frames);
if (err)
return err;
vi->sq[queue].intr_coal.max_usecs = ec->tx_coalesce_usecs;
vi->sq[queue].intr_coal.max_packets = ec->tx_max_coalesced_frames;
return 0;
}
......
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