public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
From: Eugenio Perez Martin <eperezma@redhat.com>
To: Koushik Dutta <kdutta@redhat.com>
Cc: qemu-devel@nongnu.org, Stefano Garzarella <sgarzare@redhat.com>,
	 "Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>
Subject: Re: [PATCH v2] hw/net/virtio-net: add support for notification coalescing
Date: Mon, 23 Mar 2026 10:46:35 +0100	[thread overview]
Message-ID: <CAJaqyWdMPQiUoJtuef3pzggRb-6wk4EJD8h8yy4z=HF_CwTKAQ@mail.gmail.com> (raw)
In-Reply-To: <CALseRdf-2dUhKk51hKn8Kb=GiXA8QqbQG+n+txy6S-B+OJ3mMg@mail.gmail.com>

On Mon, Mar 23, 2026 at 9:39 AM Koushik Dutta <kdutta@redhat.com> wrote:
>
> Hi Eugenio,
> Regarding the point about not enabling VIRTIO_NET_F_NOTF_COAL unconditionally: since feature negotiation happens during VM bootup and coalescing is configured via ethtool after the VM has already booted, how would we handle this under a conditional property?
>
> If the feature isn't negotiated at the start, we wouldn't be able to enable it dynamically later. Could you clarify how you'd like the command-line regulation to interact with the guest's ability to enable it later?

Replying at the position of the comment, marked with [1]. Please
interleave your reply for the next time, as it makes revision easier
:) [2].

> ------------------------------------------------------------
>
> > @@ -37,6 +37,7 @@ bool vhost_svq_valid_features(uint64_t features, Error **errp)
> >          case VIRTIO_RING_F_INDIRECT_DESC:
> >              continue;
> >
> > +        case VIRTIO_F_RING_RESET:
>
> This patch does not handle VIRTIO_F_RING_RESET, so this should not be enabled.
>
> => I included VIRTIO_F_RING_RESET in the valid features list because the vDPA host device offers it by default; without it, SVQ fails the feature negotiation check during initialization.
> qemu-system-x86_64: -netdev type=vhost-vdpa,vhostdev=/dev/vhost-vdpa-0,id=vhost-vdpa0,x-svq=on: SVQ Invalid device feature flags, offer: 0x1e0010330bfffa7, ok: 0x1e0000330bfffa7
>

Since you're testing the feature with nested virtualization, you can
disable the features in the L0 QEMU with:
-device virtio-net-pci,...,queue_reset=off,iommu_platform=off,guest_uso4=off,guest_uso6=off,host_uso=off,guest_announce=off

> Regards,
> Koushik Dutta
>
> On Thu, Mar 12, 2026 at 3:47 PM Eugenio Perez Martin <eperezma@redhat.com> wrote:
>>
>> On Wed, Mar 11, 2026 at 2:28 PM Koushik Dutta <kdutta@redhat.com> wrote:
>> >

[...]

>> > +
>> > +static void virtio_net_add_queue(VirtIONet *n, int index)
>> > +{
>> > +    VirtIODevice *vdev = VIRTIO_DEVICE(n);
>> > +
>> > +    n->vqs[index].rx_vq =
>> > +        virtio_add_queue(vdev,
>> > +                         n->net_conf.rx_queue_size,
>> > +                         virtio_net_handle_rx);
>> > +
>> > +    n->vqs[index].tx_vq =
>> > +        virtio_add_queue(vdev,
>> > +                         n->net_conf.tx_queue_size,
>> > +                         virtio_net_handle_tx_dispatch);
>> > +
>> > +    n->vqs[index].tx_timer =
>> > +        timer_new_ns(QEMU_CLOCK_VIRTUAL,
>> > +                     virtio_net_tx_timer,
>> > +                     &n->vqs[index]);
>>
>> We should avoid creating a new timer if it will not be used by
>> default. Create it only if cmdline enables it or the guest enable it
>> via control vq.
>>

[1]

I'm proposing we switch this to something like:

if (!strcmp(n->net_conf.tx, "timer")) {
  n->vqs[index].tx_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
virtio_net_tx_timer, &n->vqs[index]);
}

And, in the CVQ code that you created,

if (n->tx_coal_usecs) {
  n->vqs[index].tx_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
virtio_net_tx_timer, &n->vqs[index]);
}

And the same applies to RX timers.

[2] https://subspace.kernel.org/etiquette.html#do-not-top-post-when-replying



      reply	other threads:[~2026-03-23  9:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 13:28 [PATCH v2] hw/net/virtio-net: add support for notification coalescing Koushik Dutta
2026-03-12 10:17 ` Eugenio Perez Martin
2026-03-23  8:38   ` Koushik Dutta
2026-03-23  9:46     ` Eugenio Perez Martin [this message]

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='CAJaqyWdMPQiUoJtuef3pzggRb-6wk4EJD8h8yy4z=HF_CwTKAQ@mail.gmail.com' \
    --to=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kdutta@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.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