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: 860000 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zJ5bB6gzMz9sNw for ; Sat, 13 Jan 2018 02:03:02 +1100 (AEDT) Received: from localhost ([::1]:46373 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0rF-0003qL-00 for incoming@patchwork.ozlabs.org; Fri, 12 Jan 2018 10:03:01 -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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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);