From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23323C2D0DD for ; Thu, 2 Jan 2020 06:53:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D445B2053B for ; Thu, 2 Jan 2020 06:53:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=daynix-com.20150623.gappssmtp.com header.i=@daynix-com.20150623.gappssmtp.com header.b="sHREuGSG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D445B2053B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=daynix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imuLr-0008Bg-W1 for qemu-devel@archiver.kernel.org; Thu, 02 Jan 2020 01:53:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58099) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imuLG-0007kR-E5 for qemu-devel@nongnu.org; Thu, 02 Jan 2020 01:52:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1imuLF-0000jP-5D for qemu-devel@nongnu.org; Thu, 02 Jan 2020 01:52:22 -0500 Received: from mail-io1-xd41.google.com ([2607:f8b0:4864:20::d41]:45643) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1imuLE-0000j8-Su for qemu-devel@nongnu.org; Thu, 02 Jan 2020 01:52:21 -0500 Received: by mail-io1-xd41.google.com with SMTP id i11so37398816ioi.12 for ; Wed, 01 Jan 2020 22:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YDBWSMCEbUKVxD/aXrvWJYYnrpdv/8h4uRyORHdMRzo=; b=sHREuGSGAvxpAnAV/UHRaz5d6M4vKsN7lFDkjqx7vi/eAeAHxlod5LO7k13nctIpx6 KTZRRbKt9DQ6Xmk2cT3yNi1C7Rhrc2uhMltc7t3qS1EEsyD4AtkZETTODx5gv88KWBL4 A/JKidZNvmbSlykLKUEO8bRCHoLXnCHFyXx93O8JVz3XuOupfZnWsCYhj35GTVSxQ7eO nPtvSUbicB9wA94NCwSckVmOjhx5wxMu0ULGTEko2lCNWYQiWqFnTksVcQQU7u4D6RG7 SAMaeteTbYFUGk+plqv0Pu+IdDXshQxOYogQbuGlxtOqoA7Ke45BP3DDNeBZ1t/HrcbE wPdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YDBWSMCEbUKVxD/aXrvWJYYnrpdv/8h4uRyORHdMRzo=; b=Z4YWNPikawvRmWQWcFIzMZX/vjvGrfzudUqR4FTG/neEpl57V0WFzASwR7CoKPx9jl uebFm+I5CfAKwDYgr4zwhf10hy1aFB2e6Vtm+F5wjQaq26+Lq+0DYQeaJk9me2oFLnyn 3RfsT8g/nATQ4rFL0Kjhsaj2vhZMsJBnlaX6LsTVRzz/OeA/DIf+yHtCYoO053Babhud tjuEITe0PGb9G1QAddMGEFMxeQW/+5Vo0xEzSyVEjNNq/NqmNvSy7ZDoKOblqY8wFEdM BUaoOUt1e/BGlyAuRnFO9T9ul7pM38s4bWskn5/R5bFgSXaV5A4E/z29cqzHMB1lfgWo 9pUw== X-Gm-Message-State: APjAAAVe1CQ7s2e4Gv048uf3knnkHJ5W/VpO1v0yy0km1qcP1fO2UaZH RGNbO8XCiwmkGOmVIKAmABXOVUqDYfsodEgWTI6C/Q== X-Google-Smtp-Source: APXvYqxAmyBj5/odEXMpJFu5sjwfU8KIDB1T6zhE6kEWqvqp1JczBTDbQlNo7+0RbMIiJnfoGOKEwCdn6SzIaUI22DI= X-Received: by 2002:a6b:7119:: with SMTP id q25mr50100557iog.148.1577947939519; Wed, 01 Jan 2020 22:52:19 -0800 (PST) MIME-Version: 1.0 References: <20191226043649.14481-1-yuri.benditovich@daynix.com> <20191226043649.14481-3-yuri.benditovich@daynix.com> <20200101184128-mutt-send-email-mst@kernel.org> In-Reply-To: <20200101184128-mutt-send-email-mst@kernel.org> From: Yuri Benditovich Date: Thu, 2 Jan 2020 08:52:05 +0200 Message-ID: Subject: Re: [PATCH 2/2] virtio-net: delete also control queue when TX/RX deleted To: "Michael S. Tsirkin" Content-Type: multipart/alternative; boundary="00000000000068ddeb059b22a213" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d41 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yan Vugenfirer , Jason Wang , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --00000000000068ddeb059b22a213 Content-Type: text/plain; charset="UTF-8" On Thu, Jan 2, 2020 at 1:43 AM Michael S. Tsirkin wrote: > On Thu, Dec 26, 2019 at 06:36:49AM +0200, Yuri Benditovich wrote: > > https://bugzilla.redhat.com/show_bug.cgi?id=1708480 > > If the control queue is not deleted together with TX/RX, it > > later will be ignored in freeing cache resources and hot > > unplug will not be completed. > > > > Signed-off-by: Yuri Benditovich > > --- > > hw/net/virtio-net.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c > > index db3d7c38e6..f325440d01 100644 > > --- a/hw/net/virtio-net.c > > +++ b/hw/net/virtio-net.c > > @@ -3101,7 +3101,8 @@ static void > virtio_net_device_unrealize(DeviceState *dev, Error **errp) > > for (i = 0; i < max_queues; i++) { > > virtio_net_del_queue(n, i); > > } > > - > > + /* delete also control vq */ > > + virtio_del_queue(vdev, max_queues * 2); > > qemu_announce_timer_del(&n->announce_timer, false); > > g_free(n->vqs); > > qemu_del_nic(n->nic); > > Do we need to limit this to when ctrl vq exists? > ctrl vq always exists (we _add_ it unconditionally). we may suggest respective feature or not, but the initialized queue structure present. > > > -- > > 2.17.1 > > --00000000000068ddeb059b22a213 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Jan 2, 2020 at 1:43 AM Michae= l S. Tsirkin <mst@redhat.com> w= rote:
On Thu, De= c 26, 2019 at 06:36:49AM +0200, Yuri Benditovich wrote:
> https://bugzilla.redhat.com/show_bug.cgi?= id=3D1708480
> If the control queue is not deleted together with TX/RX, it
> later will be ignored in freeing cache resources and hot
> unplug will not be completed.
>
> Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
> ---
>=C2=A0 hw/net/virtio-net.c | 3 ++-
>=C2=A0 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index db3d7c38e6..f325440d01 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -3101,7 +3101,8 @@ static void virtio_net_device_unrealize(DeviceSt= ate *dev, Error **errp)
>=C2=A0 =C2=A0 =C2=A0 for (i =3D 0; i < max_queues; i++) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 virtio_net_del_queue(n, i);
>=C2=A0 =C2=A0 =C2=A0 }
> -
> +=C2=A0 =C2=A0 /* delete also control vq */
> +=C2=A0 =C2=A0 virtio_del_queue(vdev, max_queues * 2);
>=C2=A0 =C2=A0 =C2=A0 qemu_announce_timer_del(&n->announce_timer,= false);
>=C2=A0 =C2=A0 =C2=A0 g_free(n->vqs);
>=C2=A0 =C2=A0 =C2=A0 qemu_del_nic(n->nic);

Do we need to limit this to when ctrl vq exists?

<= /div>
ctrl vq always exists (we _add_ it unconditionally).
we= may suggest respective feature or not, but the initialized queue structure= present.
=C2=A0

> --
> 2.17.1

--00000000000068ddeb059b22a213--