netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Heng Qi <hengqi@linux.alibaba.com>
Cc: netdev@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	 "Michael S . Tsirkin" <mst@redhat.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Alexei Starovoitov <ast@kernel.org>,
	 Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	 John Fastabend <john.fastabend@gmail.com>,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
	 Gavin Li <gavinl@nvidia.com>
Subject: Re: [PATCH net v2 4/6] virtio-net: fix per queue coalescing parameter setting
Date: Sun, 8 Oct 2023 13:20:41 +0800	[thread overview]
Message-ID: <CACGkMEt3JOXpH5Mvqw6Xy6L1HfO2MdOKmOTH8AeoH=UV1xhmHA@mail.gmail.com> (raw)
In-Reply-To: <967eec7b4eaad940222448043c1098559bc484da.1695627660.git.hengqi@linux.alibaba.com>

On Mon, Sep 25, 2023 at 3:53 PM Heng Qi <hengqi@linux.alibaba.com> wrote:
>
> 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: 394bd87764b6 ("virtio_net: support per queue interrupt coalesce command")
> Reported-by: Xiaoming Zhao <zxm377917@alibaba-inc.com>
> Cc: Gavin Li <gavinl@nvidia.com>
> Signed-off-by: Heng Qi <hengqi@linux.alibaba.com>

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks

> ---
> v1->v2:
>     1. Remove useless comments.
>
>  drivers/net/virtio_net.c | 36 ++++++++++++++++--------------------
>  1 file changed, 16 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 6120dd5343dd..12ec3ae19b60 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -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;
>  }
> --
> 2.19.1.6.gb485710b
>
>


  reply	other threads:[~2023-10-08  5:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-25  7:52 [PATCH net v2 0/6] virtio-net: Fix and update interrupt moderation Heng Qi
2023-09-25  7:52 ` [PATCH net v2 1/6] virtio-net: initially change the value of tx-frames Heng Qi
2023-09-25  7:52 ` [PATCH net v2 2/6] virtio-net: fix mismatch of getting tx-frames Heng Qi
2023-09-25  7:52 ` [PATCH net v2 3/6] virtio-net: consistently save parameters for per-queue Heng Qi
2023-09-25  7:53 ` [PATCH net v2 4/6] virtio-net: fix per queue coalescing parameter setting Heng Qi
2023-10-08  5:20   ` Jason Wang [this message]
2023-09-25  7:53 ` [PATCH net v2 5/6] virtio-net: fix the vq coalescing setting for vq resize Heng Qi
2023-10-03 10:41   ` Paolo Abeni
     [not found]     ` <21d1ab6c-b94c-44c5-b8c3-2d7e7aa32dd9@linux.alibaba.com>
2023-10-08  5:21       ` Jason Wang
2023-09-25  7:53 ` [PATCH net v2 6/6] virtio-net: a tiny comment update Heng Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACGkMEt3JOXpH5Mvqw6Xy6L1HfO2MdOKmOTH8AeoH=UV1xhmHA@mail.gmail.com' \
    --to=jasowang@redhat.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gavinl@nvidia.com \
    --cc=hawk@kernel.org \
    --cc=hengqi@linux.alibaba.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).