[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACGkMEumtfsqmB5F+c9t+6mSkEN_UB8iS9ztTg+NfYm56mQuvg@mail.gmail.com>
Date: Fri, 22 Sep 2023 12:26:45 +0800
From: Jason Wang <jasowang@...hat.com>
To: Heng Qi <hengqi@...ux.alibaba.com>
Cc: netdev@...r.kernel.org, virtualization@...ts.linux-foundation.org,
"Michael S . Tsirkin" <mst@...hat.com>, "David S . Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>, Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Gavin Li <gavinl@...dia.com>
Subject: Re: [PATCH net 3/6] virtio-net: consistently save parameters for per-queue
On Tue, Sep 19, 2023 at 3:49 PM Heng Qi <hengqi@...ux.alibaba.com> wrote:
>
> When using .set_coalesce interface to set all queue coalescing
> parameters, we need to update both per-queue and global save values.
>
> Fixes: 394bd87764b6 ("virtio_net: support per queue interrupt coalesce command")
> Cc: Gavin Li <gavinl@...dia.com>
> Signed-off-by: Heng Qi <hengqi@...ux.alibaba.com>
Acked-by: Jason Wang <jasowang@...hat.com>
Thanks
> ---
> drivers/net/virtio_net.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 80d35a864790..ce60162d380a 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -3233,6 +3233,7 @@ static int virtnet_send_notf_coal_cmds(struct virtnet_info *vi,
> struct ethtool_coalesce *ec)
> {
> struct scatterlist sgs_tx, sgs_rx;
> + int i;
>
> vi->ctrl->coal_tx.tx_usecs = cpu_to_le32(ec->tx_coalesce_usecs);
> vi->ctrl->coal_tx.tx_max_packets = cpu_to_le32(ec->tx_max_coalesced_frames);
> @@ -3246,6 +3247,10 @@ static int virtnet_send_notf_coal_cmds(struct virtnet_info *vi,
> /* Save parameters */
> vi->intr_coal_tx.max_usecs = ec->tx_coalesce_usecs;
> vi->intr_coal_tx.max_packets = ec->tx_max_coalesced_frames;
> + for (i = 0; i < vi->max_queue_pairs; i++) {
> + vi->sq[i].intr_coal.max_usecs = ec->tx_coalesce_usecs;
> + vi->sq[i].intr_coal.max_packets = ec->tx_max_coalesced_frames;
> + }
>
> vi->ctrl->coal_rx.rx_usecs = cpu_to_le32(ec->rx_coalesce_usecs);
> vi->ctrl->coal_rx.rx_max_packets = cpu_to_le32(ec->rx_max_coalesced_frames);
> @@ -3259,6 +3264,10 @@ static int virtnet_send_notf_coal_cmds(struct virtnet_info *vi,
> /* Save parameters */
> vi->intr_coal_rx.max_usecs = ec->rx_coalesce_usecs;
> vi->intr_coal_rx.max_packets = ec->rx_max_coalesced_frames;
> + for (i = 0; i < vi->max_queue_pairs; i++) {
> + vi->rq[i].intr_coal.max_usecs = ec->rx_coalesce_usecs;
> + vi->rq[i].intr_coal.max_packets = ec->rx_max_coalesced_frames;
> + }
>
> return 0;
> }
> --
> 2.19.1.6.gb485710b
>
Powered by blists - more mailing lists