All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Kangjie Xu <kangjie.xu@linux.alibaba.com>
Cc: qemu-devel <qemu-devel@nongnu.org>, mst <mst@redhat.com>,
	hengqi@linux.alibaba.com, Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Subject: Re: [PATCH 07/16] virtio-net: support queue reset
Date: Wed, 27 Jul 2022 14:59:00 +0800	[thread overview]
Message-ID: <CACGkMEvkFMtbKJmK7ZVTVjPNxvF7VM-f_uW4cjuuc2PLeRZ+YQ@mail.gmail.com> (raw)
In-Reply-To: <81462777-254b-762c-cbe3-2272ca343b60@linux.alibaba.com>

On Wed, Jul 27, 2022 at 2:25 PM Kangjie Xu <kangjie.xu@linux.alibaba.com> wrote:
>
>
> 在 2022/7/27 13:00, Jason Wang 写道:
> > On Tue, Jul 26, 2022 at 3:02 PM Kangjie Xu <kangjie.xu@linux.alibaba.com> wrote:
> >>
> >> 在 2022/7/26 11:43, Jason Wang 写道:
> >>> 在 2022/7/18 19:17, Kangjie Xu 写道:
> >>>> From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> >>>>
> >>>> virtio-net implements queue reset. Queued packets in the corresponding
> >>>> queue pair are flushed or purged.
> >>>>
> >>>> Queue reset is currently only implemented for non-vhosts.
> >>>>
> >>>> Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> >>>> ---
> >>>>    hw/net/virtio-net.c | 15 +++++++++++++++
> >>>>    1 file changed, 15 insertions(+)
> >>>>
> >>>> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> >>>> index 7ad948ee7c..8396e21a67 100644
> >>>> --- a/hw/net/virtio-net.c
> >>>> +++ b/hw/net/virtio-net.c
> >>>> @@ -531,6 +531,19 @@ static RxFilterInfo
> >>>> *virtio_net_query_rxfilter(NetClientState *nc)
> >>>>        return info;
> >>>>    }
> >>>>    +static void virtio_net_queue_reset(VirtIODevice *vdev, uint32_t
> >>>> queue_index)
> >>>> +{
> >>>> +    VirtIONet *n = VIRTIO_NET(vdev);
> >>>> +    NetClientState *nc = qemu_get_subqueue(n->nic, vq2q(queue_index));
> >>>> +
> >>>> +    if (!nc->peer) {
> >>>> +        return;
> >>>> +    }
> >>>> +
> >>>> +    qemu_flush_or_purge_queued_packets(nc->peer, true);
> >>>> +    assert(!virtio_net_get_subqueue(nc)->async_tx.elem);
> >>>
> >>> Let's try to reuse this function in virtio_net_reset().
> >>>
> >> Yeah, I'll fix it.
> >>
> >> Thanks.
> >>
> >>>> +}
> >>>> +
> >>>>    static void virtio_net_reset(VirtIODevice *vdev)
> >>>>    {
> >>>>        VirtIONet *n = VIRTIO_NET(vdev);
> >>>> @@ -741,6 +754,7 @@ static uint64_t
> >>>> virtio_net_get_features(VirtIODevice *vdev, uint64_t features,
> >>>>        }
> >>>>          if (!get_vhost_net(nc->peer)) {
> >>>> +        virtio_add_feature(&features, VIRTIO_F_RING_RESET);
> >>>
> >>> This breaks migration compatibility.
> >>>
> >>> We probably need:
> >>>
> >>> 1) a new command line parameter
> >>> 2) make it disabled for pre-7.2 machine
> >>>
> >>> Thanks
> >>>
> >>>
> >> Sorry, I don't get what is the meaning of "pre-7.2 machine". Could you
> >> please explain it?
> > I meant for pre 7.2 machine type, we should make reset fault off by default.
> >
> > Otherwise we break migration compatibility.
> >
> > Thanks
>
> Sorry, I did not express myself clearly. Is "7.2" the version of a
> system or a module? If it is a system version, what is the system?

It's the machine type to make sure the migration can work. (you can
get the list of those types via qemu -machine ?)

E.g you can start a 7.0 machine on Qemu 7.1 and it guarantees to be
migrated to 7.0 machine on Qemu 7.0.

>
> I did not have backgrond knowledge related to this part and will
> investigate migration issues afterwards.

Git grep hw_compat_7_0 may give you more hints.

Thanks

>
> Thanks.
>
> >> Thanks
> >>
> >>>>            return features;
> >>>>        }
> >>>>    @@ -3766,6 +3780,7 @@ static void virtio_net_class_init(ObjectClass
> >>>> *klass, void *data)
> >>>>        vdc->set_features = virtio_net_set_features;
> >>>>        vdc->bad_features = virtio_net_bad_features;
> >>>>        vdc->reset = virtio_net_reset;
> >>>> +    vdc->queue_reset = virtio_net_queue_reset;
> >>>>        vdc->set_status = virtio_net_set_status;
> >>>>        vdc->guest_notifier_mask = virtio_net_guest_notifier_mask;
> >>>>        vdc->guest_notifier_pending = virtio_net_guest_notifier_pending;
>



  reply	other threads:[~2022-07-27  7:16 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18 11:16 [PATCH 00/16] Support VIRTIO_F_RING_RESET for virtio-net and vhost-user in virtio pci Kangjie Xu
2022-07-18 11:16 ` [PATCH 01/16] virtio-pci: virtio_pci_common_cfg add queue_notify_data Kangjie Xu
2022-07-26  3:17   ` Jason Wang
2022-07-26  6:16     ` Kangjie Xu
2022-07-18 11:16 ` [PATCH 02/16] virtio: add VIRTIO_F_RING_RESET Kangjie Xu
2022-07-18 11:17 ` [PATCH 03/16] virtio: pci: virtio_pci_common_cfg add queue_reset Kangjie Xu
2022-07-18 11:17 ` [PATCH 04/16] virtio: introduce __virtio_queue_reset() Kangjie Xu
2022-07-26  3:20   ` Jason Wang
2022-07-18 11:17 ` [PATCH 05/16] virtio: introduce virtio_queue_reset() Kangjie Xu
2022-07-26  3:21   ` Jason Wang
2022-07-18 11:17 ` [PATCH 06/16] virtio-pci: support queue reset Kangjie Xu
2022-07-26  3:31   ` Jason Wang
2022-07-18 11:17 ` [PATCH 07/16] virtio-net: " Kangjie Xu
2022-07-26  3:43   ` Jason Wang
2022-07-26  7:01     ` Kangjie Xu
2022-07-27  5:00       ` Jason Wang
2022-07-27  6:23         ` Kangjie Xu
2022-07-27  6:59           ` Jason Wang [this message]
2022-07-27  7:12             ` Kangjie Xu
2022-07-18 11:17 ` [PATCH 08/16] vhost: add op to enable or disable a single vring Kangjie Xu
2022-07-26  3:49   ` Jason Wang
2022-07-26  6:39     ` Kangjie Xu
2022-07-27  4:55       ` Jason Wang
2022-07-27  7:05         ` Kangjie Xu
2022-07-28  2:41           ` Jason Wang
2022-07-29  1:51             ` Kangjie Xu
2022-07-18 11:17 ` [PATCH 09/16] vhost-user: enable/disable " Kangjie Xu
2022-07-26  4:07   ` Jason Wang
2022-07-26  5:27     ` Kangjie Xu
2022-07-27  4:51       ` Jason Wang
2022-07-27  6:44         ` Kangjie Xu
2022-07-18 11:17 ` [PATCH 10/16] vhost: extract the logic of unmapping the vrings and desc Kangjie Xu
2022-07-26  4:07   ` Jason Wang
2022-07-18 11:17 ` [PATCH 11/16] vhost: introduce restart and release for vhost_dev's vqs Kangjie Xu
2022-07-26  4:13   ` Jason Wang
2022-07-26  6:15     ` Kangjie Xu
     [not found]     ` <f28d29ac-f244-a523-ed78-84c438d13340@linux.alibaba.com>
     [not found]       ` <CACGkMEtxXSm8Qc1LpKJJYm9cQ-F+eU5Lqecr62maRPxq1tM5rg@mail.gmail.com>
2022-07-27  8:23         ` Kangjie Xu
2022-07-18 11:17 ` [PATCH 12/16] vhost-net: introduce restart and stop for vhost_net's vqs Kangjie Xu
2022-07-26  4:16   ` Jason Wang
2022-07-26  6:11     ` Kangjie Xu
2022-07-18 11:17 ` [PATCH 13/16] virtio: introduce queue_enable in virtio Kangjie Xu
2022-07-26  4:17   ` Jason Wang
2022-07-26  6:19     ` Kangjie Xu
2022-07-18 11:17 ` [PATCH 14/16] virtio-net: support queue_enable for vhost-user Kangjie Xu
2022-07-26  4:25   ` Jason Wang
2022-07-26  6:54     ` Kangjie Xu
2022-07-27  4:58       ` Jason Wang
2022-07-18 11:17 ` [PATCH 15/16] virtio-net: support queue_reset " Kangjie Xu
2022-07-18 11:17 ` [PATCH 16/16] vhost-net: vq reset feature bit support Kangjie Xu
2022-07-26  4:28   ` Jason Wang
2022-07-26  6:24     ` Kangjie Xu
2022-07-27  4:53       ` Jason Wang
2022-07-27  6:48         ` Kangjie Xu
2022-07-25  2:34 ` [PATCH 00/16] Support VIRTIO_F_RING_RESET for virtio-net and vhost-user in virtio pci Kangjie Xu
2022-07-25  3:29   ` Jason Wang

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=CACGkMEvkFMtbKJmK7ZVTVjPNxvF7VM-f_uW4cjuuc2PLeRZ+YQ@mail.gmail.com \
    --to=jasowang@redhat.com \
    --cc=hengqi@linux.alibaba.com \
    --cc=kangjie.xu@linux.alibaba.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.