From patchwork Fri Jan 12 14:56:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 10161235 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C82EB602D8 for ; Fri, 12 Jan 2018 15:03:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9AF02022C for ; Fri, 12 Jan 2018 15:03:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD11328813; Fri, 12 Jan 2018 15:03:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 56D9F2022C for ; Fri, 12 Jan 2018 15:03:46 +0000 (UTC) Received: from localhost ([::1]:46377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0rx-0005PH-BT for patchwork-qemu-devel@patchwork.kernel.org; Fri, 12 Jan 2018 10:03:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0oY-0001w2-BO for qemu-devel@nongnu.org; Fri, 12 Jan 2018 10:00:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0oS-0003NE-3y for qemu-devel@nongnu.org; Fri, 12 Jan 2018 10:00:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39718) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0oR-0003Ks-Uy for qemu-devel@nongnu.org; Fri, 12 Jan 2018 10:00:08 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F359319CF8A; Fri, 12 Jan 2018 15:00:01 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-28.ams2.redhat.com [10.36.112.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 982004C8; Fri, 12 Jan 2018 14:59:38 +0000 (UTC) From: Maxime Coquelin To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:56:58 +0100 Message-Id: <20180112145658.17121-5-maxime.coquelin@redhat.com> In-Reply-To: <20180112145658.17121-1-maxime.coquelin@redhat.com> References: <20180112145658.17121-1-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 12 Jan 2018 15:00:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/4] virtio-net: notify backend with number of queue pairs setup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com, Maxime Coquelin , zhengxiang9@huawei.com, mlureau@redhat.com, pbonzini@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Maxime Coquelin --- hw/net/virtio-net.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 38674b08aa..b8908c98ed 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -561,6 +561,7 @@ static int peer_detach(VirtIONet *n, int index) static void virtio_net_set_queues(VirtIONet *n) { + NetClientState *nc = qemu_get_queue(n->nic); int i; int r; @@ -568,6 +569,10 @@ static void virtio_net_set_queues(VirtIONet *n) return; } + if (get_vhost_net(nc->peer)) { + vhost_net_set_queue_num(nc->peer, n->curr_queues); + } + for (i = 0; i < n->max_queues; i++) { if (i < n->curr_queues) { r = peer_attach(n, i);