From patchwork Tue Jun 7 07:37:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 9159963 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 503BA60573 for ; Tue, 7 Jun 2016 07:38:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41FFA27248 for ; Tue, 7 Jun 2016 07:38:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36B2B281FE; Tue, 7 Jun 2016 07:38:43 +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 9CD8B27248 for ; Tue, 7 Jun 2016 07:38:42 +0000 (UTC) Received: from localhost ([::1]:47542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bABax-0000Rh-FA for patchwork-qemu-devel@patchwork.kernel.org; Tue, 07 Jun 2016 03:38:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bABab-0000O3-Ie for qemu-devel@nongnu.org; Tue, 07 Jun 2016 03:38:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bABaP-0002JP-Rh for qemu-devel@nongnu.org; Tue, 07 Jun 2016 03:38:16 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:54919 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bABaP-0002It-Hy for qemu-devel@nongnu.org; Tue, 07 Jun 2016 03:38:05 -0400 Received: (qmail 26307 invoked by uid 89); 7 Jun 2016 07:38:03 -0000 Received: from [195.62.97.28] by client-16-kamp (envelope-from , uid 89) with qmail-scanner-2010/03/19-MF (clamdscan: 0.99.2/21685. hbedv: 8.3.40.34/7.12.97.218. avast: 1.2.2/16060601. spamassassin: 3.4.1. Clear:RC:1(195.62.97.28):. Processed in 0.069829 secs); 07 Jun 2016 07:38:03 -0000 Received: from smtp.kamp.de (HELO submission.kamp.de) ([195.62.97.28]) by mx01.kamp.de with ESMTPS (DHE-RSA-AES256-GCM-SHA384 encrypted); 7 Jun 2016 07:38:02 -0000 X-GL_Whitelist: yes Received: (qmail 29162 invoked from network); 7 Jun 2016 07:38:02 -0000 Received: from lieven-pc.kamp-intra.net (HELO lieven-pc) (relay@kamp.de@::ffff:172.21.12.60) by submission.kamp.de with ESMTPS (DHE-RSA-AES256-GCM-SHA384 encrypted) ESMTPA; 7 Jun 2016 07:38:02 -0000 Received: by lieven-pc (Postfix, from userid 1000) id B38A72070F; Tue, 7 Jun 2016 09:38:00 +0200 (CEST) From: Peter Lieven To: qemu-devel@nongnu.org Date: Tue, 7 Jun 2016 09:37:44 +0200 Message-Id: <1465285064-24833-1-git-send-email-pl@kamp.de> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a02:248:0:51::16 Subject: [Qemu-devel] [PATCH] net: fix qemu_announce_self not emitting packets 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: jasowang@redhat.com, yanghy@cn.fujitsu.com, Peter Lieven , qemu-stable@nongnu.org, s.priebe@profihost.ag Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP commit fefe2a78 accidently dropped the code path for injecting raw packets. This feature is needed for sending gratuitous ARPs after an incoming migration has completed. The result is increased network downtime for vservers where the network card is not virtio-net with the VIRTIO_NET_F_GUEST_ANNOUNCE feature. Fixes: fefe2a78abde932e0f340b21bded2c86def1d242 Cc: qemu-stable@nongnu.org Cc: yanghy@cn.fujitsu.com Signed-off-by: Peter Lieven Reviewed-by: Yang Hongyang --- net/net.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/net.c b/net/net.c index 5f3e5a9..d5834ea 100644 --- a/net/net.c +++ b/net/net.c @@ -722,7 +722,11 @@ ssize_t qemu_deliver_packet_iov(NetClientState *sender, return 0; } - if (nc->info->receive_iov) { + if (flags & QEMU_NET_PACKET_FLAG_RAW && iovcnt == 1 && + nc->info->receive_raw) { + /* this is required for qemu_announce_self() */ + ret = nc->info->receive_raw(nc, iov[0].iov_base, iov[0].iov_len); + } else if (nc->info->receive_iov) { ret = nc->info->receive_iov(nc, iov, iovcnt); } else { ret = nc_sendv_compat(nc, iov, iovcnt, flags);