From nobody Wed May 1 13:00:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495507570073156.51250276825817; Mon, 22 May 2017 19:46:10 -0700 (PDT) Received: from localhost ([::1]:45771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzpo-0005sj-Bh for importer@patchew.org; Mon, 22 May 2017 22:46:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCznx-0004jt-Hu for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCznv-0005EO-VI for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56090) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dCznv-0005EB-M8 for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:11 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 94DCEC04B30E; Tue, 23 May 2017 02:44:10 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-19.pek2.redhat.com [10.72.12.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93DAC7B523; Tue, 23 May 2017 02:44:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 94DCEC04B30E Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jasowang@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 94DCEC04B30E From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 23 May 2017 10:43:51 +0800 Message-Id: <1495507439-1784-2-git-send-email-jasowang@redhat.com> In-Reply-To: <1495507439-1784-1-git-send-email-jasowang@redhat.com> References: <1495507439-1784-1-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 23 May 2017 02:44:10 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 1/9] net/tap: Replace tap-haiku.c and tap-aix.c by a generic tap-stub.c 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: Thomas Huth , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth The files tap-haiku.c and tap-aix.c are identical (except one line of error message). We should avoid such code duplication, so replace these by a generic tap-stub.c file instead. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Jason Wang --- net/Makefile.objs | 15 +++++----- net/tap-aix.c | 88 ---------------------------------------------------= ---- net/tap-haiku.c | 87 ---------------------------------------------------= --- net/tap-stub.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++= +++ 4 files changed, 95 insertions(+), 182 deletions(-) delete mode 100644 net/tap-aix.c delete mode 100644 net/tap-haiku.c create mode 100644 net/tap-stub.c diff --git a/net/Makefile.objs b/net/Makefile.objs index 2e2fd43..67ba5e2 100644 --- a/net/Makefile.objs +++ b/net/Makefile.objs @@ -3,13 +3,7 @@ common-obj-y +=3D socket.o common-obj-y +=3D dump.o common-obj-y +=3D eth.o common-obj-$(CONFIG_L2TPV3) +=3D l2tpv3.o -common-obj-$(CONFIG_POSIX) +=3D tap.o vhost-user.o -common-obj-$(CONFIG_LINUX) +=3D tap-linux.o -common-obj-$(CONFIG_WIN32) +=3D tap-win32.o -common-obj-$(CONFIG_BSD) +=3D tap-bsd.o -common-obj-$(CONFIG_SOLARIS) +=3D tap-solaris.o -common-obj-$(CONFIG_AIX) +=3D tap-aix.o -common-obj-$(CONFIG_HAIKU) +=3D tap-haiku.o +common-obj-$(CONFIG_POSIX) +=3D vhost-user.o common-obj-$(CONFIG_SLIRP) +=3D slirp.o common-obj-$(CONFIG_VDE) +=3D vde.o common-obj-$(CONFIG_NETMAP) +=3D netmap.o @@ -20,3 +14,10 @@ common-obj-y +=3D colo-compare.o common-obj-y +=3D colo.o common-obj-y +=3D filter-rewriter.o common-obj-y +=3D filter-replay.o + +tap-obj-$(CONFIG_LINUX) =3D tap-linux.o +tap-obj-$(CONFIG_BSD) =3D tap-bsd.o +tap-obj-$(CONFIG_SOLARIS) =3D tap-solaris.o +tap-obj-y ?=3D tap-stub.o +common-obj-$(CONFIG_POSIX) +=3D tap.o $(tap-obj-y) +common-obj-$(CONFIG_WIN32) +=3D tap-win32.o diff --git a/net/tap-aix.c b/net/tap-aix.c deleted file mode 100644 index 0e6da63..0000000 --- a/net/tap-aix.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * QEMU System Emulator - * - * Copyright (c) 2003-2008 Fabrice Bellard - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN - * THE SOFTWARE. - */ - -#include "qemu/osdep.h" -#include "qapi/error.h" -#include "tap_int.h" - -int tap_open(char *ifname, int ifname_size, int *vnet_hdr, - int vnet_hdr_required, int mq_required, Error **errp) -{ - error_setg(errp, "no tap on AIX"); - return -1; -} - -void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp) -{ -} - -int tap_probe_vnet_hdr(int fd) -{ - return 0; -} - -int tap_probe_has_ufo(int fd) -{ - return 0; -} - -int tap_probe_vnet_hdr_len(int fd, int len) -{ - return 0; -} - -void tap_fd_set_vnet_hdr_len(int fd, int len) -{ -} - -int tap_fd_set_vnet_le(int fd, int is_le) -{ - return -EINVAL; -} - -int tap_fd_set_vnet_be(int fd, int is_be) -{ - return -EINVAL; -} - -void tap_fd_set_offload(int fd, int csum, int tso4, - int tso6, int ecn, int ufo) -{ -} - -int tap_fd_enable(int fd) -{ - return -1; -} - -int tap_fd_disable(int fd) -{ - return -1; -} - -int tap_fd_get_ifname(int fd, char *ifname) -{ - return -1; -} - diff --git a/net/tap-haiku.c b/net/tap-haiku.c deleted file mode 100644 index b27e57e..0000000 --- a/net/tap-haiku.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * QEMU System Emulator - * - * Copyright (c) 2003-2008 Fabrice Bellard - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN - * THE SOFTWARE. - */ - -#include "qemu/osdep.h" -#include "qapi/error.h" -#include "tap_int.h" - -int tap_open(char *ifname, int ifname_size, int *vnet_hdr, - int vnet_hdr_required, int mq_required, Error **errp) -{ - error_setg(errp, "no tap on Haiku"); - return -1; -} - -void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp) -{ -} - -int tap_probe_vnet_hdr(int fd) -{ - return 0; -} - -int tap_probe_has_ufo(int fd) -{ - return 0; -} - -int tap_probe_vnet_hdr_len(int fd, int len) -{ - return 0; -} - -void tap_fd_set_vnet_hdr_len(int fd, int len) -{ -} - -int tap_fd_set_vnet_le(int fd, int is_le) -{ - return -EINVAL; -} - -int tap_fd_set_vnet_be(int fd, int is_be) -{ - return -EINVAL; -} - -void tap_fd_set_offload(int fd, int csum, int tso4, - int tso6, int ecn, int ufo) -{ -} - -int tap_fd_enable(int fd) -{ - return -1; -} - -int tap_fd_disable(int fd) -{ - return -1; -} - -int tap_fd_get_ifname(int fd, char *ifname) -{ - return -1; -} diff --git a/net/tap-stub.c b/net/tap-stub.c new file mode 100644 index 0000000..a9ab8f8 --- /dev/null +++ b/net/tap-stub.c @@ -0,0 +1,87 @@ +/* + * QEMU System Emulator + * + * Copyright (c) 2003-2008 Fabrice Bellard + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "tap_int.h" + +int tap_open(char *ifname, int ifname_size, int *vnet_hdr, + int vnet_hdr_required, int mq_required, Error **errp) +{ + error_setg(errp, "tap is not supported in this build"); + return -1; +} + +void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp) +{ +} + +int tap_probe_vnet_hdr(int fd) +{ + return 0; +} + +int tap_probe_has_ufo(int fd) +{ + return 0; +} + +int tap_probe_vnet_hdr_len(int fd, int len) +{ + return 0; +} + +void tap_fd_set_vnet_hdr_len(int fd, int len) +{ +} + +int tap_fd_set_vnet_le(int fd, int is_le) +{ + return -EINVAL; +} + +int tap_fd_set_vnet_be(int fd, int is_be) +{ + return -EINVAL; +} + +void tap_fd_set_offload(int fd, int csum, int tso4, + int tso6, int ecn, int ufo) +{ +} + +int tap_fd_enable(int fd) +{ + return -1; +} + +int tap_fd_disable(int fd) +{ + return -1; +} + +int tap_fd_get_ifname(int fd, char *ifname) +{ + return -1; +} --=20 2.7.4 From nobody Wed May 1 13:00:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495507738424246.53710083356225; Mon, 22 May 2017 19:48:58 -0700 (PDT) Received: from localhost ([::1]:45780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzsW-00088S-W1 for importer@patchew.org; Mon, 22 May 2017 22:48:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzo3-0004ny-3U for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCzo0-0005GQ-15 for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42524) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dCznz-0005GI-Qr for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:15 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB40080F7D; Tue, 23 May 2017 02:44:14 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-19.pek2.redhat.com [10.72.12.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 686AB78125; Tue, 23 May 2017 02:44:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BB40080F7D Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jasowang@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BB40080F7D From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 23 May 2017 10:43:52 +0800 Message-Id: <1495507439-1784-3-git-send-email-jasowang@redhat.com> In-Reply-To: <1495507439-1784-1-git-send-email-jasowang@redhat.com> References: <1495507439-1784-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 23 May 2017 02:44:14 +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] [PULL 2/9] net/dump: Issue a warning for the deprecated "-net dump" 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: Thomas Huth , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Network dumping should be done with "-object filter-dump" nowadays. Using "-net dump" via the VLAN mechanism is considered as deprecated and might be removed in a future release. So warn the users now to inform them to user the filter-dump method instead. Signed-off-by: Thomas Huth Signed-off-by: Jason Wang --- net/dump.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/dump.c b/net/dump.c index 89a149b..442eb53 100644 --- a/net/dump.c +++ b/net/dump.c @@ -194,6 +194,9 @@ int net_init_dump(const Netdev *netdev, const char *nam= e, =20 assert(peer); =20 + error_report("'-net dump' is deprecated. " + "Please use '-object filter-dump' instead."); + if (dump->has_file) { file =3D dump->file; } else { --=20 2.7.4 From nobody Wed May 1 13:00:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495507745867438.15035316570015; Mon, 22 May 2017 19:49:05 -0700 (PDT) Received: from localhost ([::1]:45781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzse-0008Fa-JQ for importer@patchew.org; Mon, 22 May 2017 22:49:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzo7-0004rW-Jz for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCzo6-0005Ia-KH for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38262) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dCzo6-0005IE-Dm; Mon, 22 May 2017 22:44:22 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 267BE80476; Tue, 23 May 2017 02:44:21 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-19.pek2.redhat.com [10.72.12.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 81F8178125; Tue, 23 May 2017 02:44:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 267BE80476 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jasowang@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 267BE80476 From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 23 May 2017 10:43:53 +0800 Message-Id: <1495507439-1784-4-git-send-email-jasowang@redhat.com> In-Reply-To: <1495507439-1784-1-git-send-email-jasowang@redhat.com> References: <1495507439-1784-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 23 May 2017 02:44:21 +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] [PULL 3/9] virtio-net: fix wild pointer when remove virtio-net queues 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: Jason Wang , Yunjian Wang , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yunjian Wang The tx_bh or tx_timer will free in virtio_net_del_queue() function, when removing virtio-net queues if the guest doesn't support multiqueue. But it might be still referenced by virtio_net_set_status(), which needs to be set NULL. And also the tx_waiting needs to be set zero to prevent virtio_net_set_status() accessing tx_bh or tx_timer. Cc: qemu-stable@nongnu.org Signed-off-by: Yunjian Wang Signed-off-by: Jason Wang --- hw/net/virtio-net.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 7d091c9..98bd683 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1522,9 +1522,12 @@ static void virtio_net_del_queue(VirtIONet *n, int i= ndex) if (q->tx_timer) { timer_del(q->tx_timer); timer_free(q->tx_timer); + q->tx_timer =3D NULL; } else { qemu_bh_delete(q->tx_bh); + q->tx_bh =3D NULL; } + q->tx_waiting =3D 0; virtio_del_queue(vdev, index * 2 + 1); } =20 --=20 2.7.4 From nobody Wed May 1 13:00:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495507598269712.8102228880648; Mon, 22 May 2017 19:46:38 -0700 (PDT) Received: from localhost ([::1]:45772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzqG-0006Cx-3z for importer@patchew.org; Mon, 22 May 2017 22:46:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzoD-0004um-IS for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCzoA-0005KK-VE for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56324) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dCzoA-0005Jy-M5 for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:26 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 914D4C04B31B; Tue, 23 May 2017 02:44:25 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-19.pek2.redhat.com [10.72.12.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7F8578125; Tue, 23 May 2017 02:44:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 914D4C04B31B Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jasowang@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 914D4C04B31B From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 23 May 2017 10:43:54 +0800 Message-Id: <1495507439-1784-5-git-send-email-jasowang@redhat.com> In-Reply-To: <1495507439-1784-1-git-send-email-jasowang@redhat.com> References: <1495507439-1784-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 23 May 2017 02:44:25 +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] [PULL 4/9] COLO-compare: Improve tcp compare trace event readability 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: Jason Wang , Zhang Chen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhang Chen Because of previous patch's trace arguments over the limit of UST backend, so I rewrite the patch. Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- net/colo-compare.c | 33 ++++++++++++++++++++++----------- net/trace-events | 3 +-- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 4ab80b1..2639c7f 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -265,17 +265,28 @@ static int colo_packet_compare_tcp(Packet *spkt, Pack= et *ppkt) } =20 if (res !=3D 0 && trace_event_get_state(TRACE_COLO_COMPARE_MISCOMPARE)= ) { - trace_colo_compare_pkt_info_src(inet_ntoa(ppkt->ip->ip_src), - ntohl(stcp->th_seq), - ntohl(stcp->th_ack), - res, stcp->th_flags, - spkt->size); - - trace_colo_compare_pkt_info_dst(inet_ntoa(ppkt->ip->ip_dst), - ntohl(ptcp->th_seq), - ntohl(ptcp->th_ack), - res, ptcp->th_flags, - ppkt->size); + char pri_ip_src[20], pri_ip_dst[20], sec_ip_src[20], sec_ip_dst[20= ]; + + strcpy(pri_ip_src, inet_ntoa(ppkt->ip->ip_src)); + strcpy(pri_ip_dst, inet_ntoa(ppkt->ip->ip_dst)); + strcpy(sec_ip_src, inet_ntoa(spkt->ip->ip_src)); + strcpy(sec_ip_dst, inet_ntoa(spkt->ip->ip_dst)); + + trace_colo_compare_ip_info(ppkt->size, pri_ip_src, + pri_ip_dst, spkt->size, + sec_ip_src, sec_ip_dst); + + trace_colo_compare_tcp_info("pri tcp packet", + ntohl(ptcp->th_seq), + ntohl(ptcp->th_ack), + res, ptcp->th_flags, + ppkt->size); + + trace_colo_compare_tcp_info("sec tcp packet", + ntohl(stcp->th_seq), + ntohl(stcp->th_ack), + res, stcp->th_flags, + spkt->size); =20 qemu_hexdump((char *)ppkt->data, stderr, "colo-compare ppkt", ppkt->size); diff --git a/net/trace-events b/net/trace-events index 35198bc..247e5c0 100644 --- a/net/trace-events +++ b/net/trace-events @@ -13,8 +13,7 @@ colo_compare_icmp_miscompare(const char *sta, int size) "= : %s =3D %d" colo_compare_ip_info(int psize, const char *sta, const char *stb, int ssiz= e, const char *stc, const char *std) "ppkt size =3D %d, ip_src =3D %s, ip_d= st =3D %s, spkt size =3D %d, ip_src =3D %s, ip_dst =3D %s" colo_old_packet_check_found(int64_t old_time) "%" PRId64 colo_compare_miscompare(void) "" -colo_compare_pkt_info_src(const char *src, uint32_t sseq, uint32_t sack, i= nt res, uint32_t sflag, int ssize) "src/dst: %s s: seq/ack=3D%u/%u res=3D%d= flags=3D%x spkt_size: %d\n" -colo_compare_pkt_info_dst(const char *dst, uint32_t dseq, uint32_t dack, i= nt res, uint32_t dflag, int dsize) "src/dst: %s d: seq/ack=3D%u/%u res=3D%d= flags=3D%x dpkt_size: %d\n" +colo_compare_tcp_info(const char *pkt, uint32_t seq, uint32_t ack, int res= , uint32_t flag, int size) "side: %s seq/ack=3D %u/%u res=3D %d flags=3D %x= pkt_size: %d\n" =20 # net/filter-rewriter.c colo_filter_rewriter_debug(void) "" --=20 2.7.4 From nobody Wed May 1 13:00:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495507621916761.4439710257087; Mon, 22 May 2017 19:47:01 -0700 (PDT) Received: from localhost ([::1]:45773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzqe-0006Tb-E4 for importer@patchew.org; Mon, 22 May 2017 22:47:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzoE-0004vg-Or for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCzoD-0005MC-S0 for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52292) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dCzoD-0005LU-IL for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:29 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7D0345F7B6; Tue, 23 May 2017 02:44:28 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-19.pek2.redhat.com [10.72.12.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5531378125; Tue, 23 May 2017 02:44:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7D0345F7B6 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jasowang@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7D0345F7B6 From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 23 May 2017 10:43:55 +0800 Message-Id: <1495507439-1784-6-git-send-email-jasowang@redhat.com> In-Reply-To: <1495507439-1784-1-git-send-email-jasowang@redhat.com> References: <1495507439-1784-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 23 May 2017 02:44:28 +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] [PULL 5/9] hmp / net: Mark host_net_add/remove as deprecated 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: Thomas Huth , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth The netdev_add and netdev_del commands should be used nowadays instead. Signed-off-by: Thomas Huth Signed-off-by: Jason Wang --- hmp-commands.hx | 8 ++++---- net/net.c | 13 +++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 0aca984..baeac47 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1296,7 +1296,7 @@ ETEXI .name =3D "host_net_add", .args_type =3D "device:s,opts:s?", .params =3D "tap|user|socket|vde|netmap|bridge|vhost-user|dump= [options]", - .help =3D "add host VLAN client", + .help =3D "add host VLAN client (deprecated, use netdev_add = instead)", .cmd =3D hmp_host_net_add, .command_completion =3D host_net_add_completion, }, @@ -1304,14 +1304,14 @@ ETEXI STEXI @item host_net_add @findex host_net_add -Add host VLAN client. +Add host VLAN client. Deprecated, please use @code{netdev_add} instead. ETEXI =20 { .name =3D "host_net_remove", .args_type =3D "vlan_id:i,device:s", .params =3D "vlan_id name", - .help =3D "remove host VLAN client", + .help =3D "remove host VLAN client (deprecated, use netdev_d= el instead)", .cmd =3D hmp_host_net_remove, .command_completion =3D host_net_remove_completion, }, @@ -1319,7 +1319,7 @@ ETEXI STEXI @item host_net_remove @findex host_net_remove -Remove host VLAN client. +Remove host VLAN client. Deprecated, please use @code{netdev_del} instead. ETEXI =20 { diff --git a/net/net.c b/net/net.c index 0ac3b9e..6235aab 100644 --- a/net/net.c +++ b/net/net.c @@ -45,6 +45,7 @@ #include "qapi-visit.h" #include "qapi/opts-visitor.h" #include "sysemu/sysemu.h" +#include "sysemu/qtest.h" #include "net/filter.h" #include "qapi/string-output-visitor.h" =20 @@ -1149,6 +1150,12 @@ void hmp_host_net_add(Monitor *mon, const QDict *qdi= ct) const char *opts_str =3D qdict_get_try_str(qdict, "opts"); Error *local_err =3D NULL; QemuOpts *opts; + static bool warned; + + if (!warned && !qtest_enabled()) { + error_report("host_net_add is deprecated, use netdev_add instead"); + warned =3D true; + } =20 if (!net_host_check_device(device)) { monitor_printf(mon, "invalid host network device %s\n", device); @@ -1175,6 +1182,12 @@ void hmp_host_net_remove(Monitor *mon, const QDict *= qdict) NetClientState *nc; int vlan_id =3D qdict_get_int(qdict, "vlan_id"); const char *device =3D qdict_get_str(qdict, "device"); + static bool warned; + + if (!warned && !qtest_enabled()) { + error_report("host_net_remove is deprecated, use netdev_del instea= d"); + warned =3D true; + } =20 nc =3D net_hub_find_client_by_name(vlan_id, device); if (!nc) { --=20 2.7.4 From nobody Wed May 1 13:00:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 14955077661961023.9318443224043; Mon, 22 May 2017 19:49:26 -0700 (PDT) Received: from localhost ([::1]:45782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzsz-0008Vt-07 for importer@patchew.org; Mon, 22 May 2017 22:49:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzoI-0004zU-G9 for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCzoH-0005O2-Ky for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57684) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dCzoH-0005Nl-FE for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:33 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 570BE4E4C6; Tue, 23 May 2017 02:44:32 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-19.pek2.redhat.com [10.72.12.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 361A178125; Tue, 23 May 2017 02:44:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 570BE4E4C6 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jasowang@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 570BE4E4C6 From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 23 May 2017 10:43:56 +0800 Message-Id: <1495507439-1784-7-git-send-email-jasowang@redhat.com> In-Reply-To: <1495507439-1784-1-git-send-email-jasowang@redhat.com> References: <1495507439-1784-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 23 May 2017 02:44:32 +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] [PULL 6/9] net/filter-mirror.c: Remove duplicate check code. 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: Jason Wang , Zhang Chen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhang Chen The s->outdev have checked in filter_mirror_set_outdev(). Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- net/filter-mirror.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/net/filter-mirror.c b/net/filter-mirror.c index 72fa7c2..fd0322f 100644 --- a/net/filter-mirror.c +++ b/net/filter-mirror.c @@ -194,12 +194,6 @@ static void filter_mirror_setup(NetFilterState *nf, Er= ror **errp) MirrorState *s =3D FILTER_MIRROR(nf); Chardev *chr; =20 - if (!s->outdev) { - error_setg(errp, "filter mirror needs 'outdev' " - "property set"); - return; - } - chr =3D qemu_chr_find(s->outdev); if (chr =3D=3D NULL) { error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, --=20 2.7.4 From nobody Wed May 1 13:00:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495507892824408.89795687784726; Mon, 22 May 2017 19:51:32 -0700 (PDT) Received: from localhost ([::1]:45804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzv1-0001ru-8b for importer@patchew.org; Mon, 22 May 2017 22:51:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzoO-00053d-S2 for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCzoL-0005PW-Q0 for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42816) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dCzoL-0005P9-Gw for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:37 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 65CA883F44; Tue, 23 May 2017 02:44:36 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-19.pek2.redhat.com [10.72.12.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B46E7B52F; Tue, 23 May 2017 02:44:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 65CA883F44 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jasowang@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 65CA883F44 From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 23 May 2017 10:43:57 +0800 Message-Id: <1495507439-1784-8-git-send-email-jasowang@redhat.com> In-Reply-To: <1495507439-1784-1-git-send-email-jasowang@redhat.com> References: <1495507439-1784-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 23 May 2017 02:44:36 +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] [PULL 7/9] net/filter-mirror.c: Rename filter_mirror_send() and fix codestyle 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: Jason Wang , Zhang Chen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhang Chen Because filter_mirror_receive_iov() and filter_redirector_receive_iov() both use the filter_mirror_send() to send packet, so I change filter_mirror_send() to filter_send() that looks more common. And fix some codestyle. Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- net/filter-mirror.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/net/filter-mirror.c b/net/filter-mirror.c index fd0322f..8b1b069 100644 --- a/net/filter-mirror.c +++ b/net/filter-mirror.c @@ -43,9 +43,9 @@ typedef struct MirrorState { SocketReadState rs; } MirrorState; =20 -static int filter_mirror_send(CharBackend *chr_out, - const struct iovec *iov, - int iovcnt) +static int filter_send(CharBackend *chr_out, + const struct iovec *iov, + int iovcnt) { int ret =3D 0; ssize_t size =3D 0; @@ -141,9 +141,9 @@ static ssize_t filter_mirror_receive_iov(NetFilterState= *nf, MirrorState *s =3D FILTER_MIRROR(nf); int ret; =20 - ret =3D filter_mirror_send(&s->chr_out, iov, iovcnt); + ret =3D filter_send(&s->chr_out, iov, iovcnt); if (ret) { - error_report("filter_mirror_send failed(%s)", strerror(-ret)); + error_report("filter mirror send failed(%s)", strerror(-ret)); } =20 /* @@ -164,9 +164,9 @@ static ssize_t filter_redirector_receive_iov(NetFilterS= tate *nf, int ret; =20 if (qemu_chr_fe_get_driver(&s->chr_out)) { - ret =3D filter_mirror_send(&s->chr_out, iov, iovcnt); + ret =3D filter_send(&s->chr_out, iov, iovcnt); if (ret) { - error_report("filter_mirror_send failed(%s)", strerror(-ret)); + error_report("filter redirector send failed(%s)", strerror(-re= t)); } return iov_size(iov, iovcnt); } else { @@ -286,8 +286,9 @@ static char *filter_redirector_get_indev(Object *obj, E= rror **errp) return g_strdup(s->indev); } =20 -static void -filter_redirector_set_indev(Object *obj, const char *value, Error **errp) +static void filter_redirector_set_indev(Object *obj, + const char *value, + Error **errp) { MirrorState *s =3D FILTER_REDIRECTOR(obj); =20 @@ -302,8 +303,9 @@ static char *filter_mirror_get_outdev(Object *obj, Erro= r **errp) return g_strdup(s->outdev); } =20 -static void -filter_mirror_set_outdev(Object *obj, const char *value, Error **errp) +static void filter_mirror_set_outdev(Object *obj, + const char *value, + Error **errp) { MirrorState *s =3D FILTER_MIRROR(obj); =20 @@ -323,8 +325,9 @@ static char *filter_redirector_get_outdev(Object *obj, = Error **errp) return g_strdup(s->outdev); } =20 -static void -filter_redirector_set_outdev(Object *obj, const char *value, Error **errp) +static void filter_redirector_set_outdev(Object *obj, + const char *value, + Error **errp) { MirrorState *s =3D FILTER_REDIRECTOR(obj); =20 --=20 2.7.4 From nobody Wed May 1 13:00:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495507785028193.6972246319658; Mon, 22 May 2017 19:49:45 -0700 (PDT) Received: from localhost ([::1]:45783 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCztG-0000Ku-NB for importer@patchew.org; Mon, 22 May 2017 22:49:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzoQ-00055A-Fi for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCzoP-0005Ql-AV for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53930) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dCzoP-0005QJ-5J for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:41 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1B445368E4; Tue, 23 May 2017 02:44:40 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-19.pek2.redhat.com [10.72.12.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1886F7B523; Tue, 23 May 2017 02:44:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1B445368E4 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jasowang@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1B445368E4 From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 23 May 2017 10:43:58 +0800 Message-Id: <1495507439-1784-9-git-send-email-jasowang@redhat.com> In-Reply-To: <1495507439-1784-1-git-send-email-jasowang@redhat.com> References: <1495507439-1784-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 23 May 2017 02:44:40 +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] [PULL 8/9] net/filter-rewriter: Remove unused option in filter-rewriter 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: Jason Wang , Zhang Chen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index f07a310..f63f7dc 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4072,7 +4072,7 @@ Create a filter-redirector we need to differ outdev i= d from indev id, id can not be the same. we can just use indev or outdev, but at least one of indev or= outdev need to be specified. =20 -@item -object filter-rewriter,id=3D@var{id},netdev=3D@var{netdevid},rewrit= er-mode=3D@var{mode}[,queue=3D@var{all|rx|tx}] +@item -object filter-rewriter,id=3D@var{id},netdev=3D@var{netdevid}[,queue= =3D@var{all|rx|tx}] =20 Filter-rewriter is a part of COLO project.It will rewrite tcp packet to secondary from primary to keep secondary tcp connection,and rewrite --=20 2.7.4 From nobody Wed May 1 13:00:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149550788832846.550178655779746; Mon, 22 May 2017 19:51:28 -0700 (PDT) Received: from localhost ([::1]:45801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzuv-0001nf-Ex for importer@patchew.org; Mon, 22 May 2017 22:51:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzoX-000598-1C for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCzoT-0005Sp-UN for qemu-devel@nongnu.org; Mon, 22 May 2017 22:44:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54024) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dCzoT-0005SK-MQ; Mon, 22 May 2017 22:44:45 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 834FB285B1; Tue, 23 May 2017 02:44:44 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-19.pek2.redhat.com [10.72.12.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0FD378125; Tue, 23 May 2017 02:44:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 834FB285B1 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jasowang@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 834FB285B1 From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 23 May 2017 10:43:59 +0800 Message-Id: <1495507439-1784-10-git-send-email-jasowang@redhat.com> In-Reply-To: <1495507439-1784-1-git-send-email-jasowang@redhat.com> References: <1495507439-1784-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 23 May 2017 02:44:44 +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] [PULL 9/9] e1000e: Fix ICR "Other" causes clear logic 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: Sameeh Jubran , Jason Wang , Sameeh Jubran , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Sameeh Jubran This commit fixes a bug which causes the guest to hang. The bug was observed upon a "receive overrun" (bit #6 of the ICR register) interrupt which could be triggered post migration in a heavy traffic environment. Even though the "receive overrun" bit (#6) is masked out by the IMS register (refer to the log below) the driver still receives an interrupt as the "receive overrun" bit (#6) causes the "Other" - bit #24 of the ICR register - bit to be set as documented below. The driver handles the interrupt and clears the "Other" bit (#24) but doesn't clear the "receive overrun" bit (#6) which leads to an infinite loop. Apparently the Windows driver expects that the "receive overrun" bit and other ones - documented below - to be cleared when the "Other" bit (#24) is cleared. So to sum that up: 1. Bit #6 of the ICR register is set by heavy traffic 2. As a results of setting bit #6, bit #24 is set 3. The driver receives an interrupt for bit 24 (it doesn't receieve an interrupt for bit #6 as it is masked out by IMS) 4. The driver handles and clears the interrupt of bit #24 5. Bit #6 is still set. 6. 2 happens all over again The Interrupt Cause Read - ICR register: The ICR has the "Other" bit - bit #24 - that is set when one or more of the following ICR register's bits are set: LSC - bit #2, RXO - bit #6, MDAC - bit #9, SRPD - bit #16, ACK - bit #17, MNG - bit #18 This bug can occur with any of these bits depending on the driver's behaviour and the way it configures the device. However, trying to reproduce it with any bit other than RX0 is challenging and came to failure as the drivers don't implement most of these bits, trying to reproduce it with LSC (Link Status Change - bit #2) bit didn't succeed too as it seems that Windows handles this bit differently. Log sample of the storm: 27563@1494850819.411877:e1000e_irq_pending_interrupts ICR PENDING: 0x100000= 0 (ICR: 0x815000c2, IMS: 0x1a00004) 27563@1494850819.411900:e1000e_irq_pending_interrupts ICR PENDING: 0x0 (ICR= : 0x815000c2, IMS: 0xa00004) 27563@1494850819.411915:e1000e_irq_pending_interrupts ICR PENDING: 0x0 (ICR= : 0x815000c2, IMS: 0xa00004) 27563@1494850819.412380:e1000e_irq_pending_interrupts ICR PENDING: 0x0 (ICR= : 0x815000c2, IMS: 0xa00004) 27563@1494850819.412395:e1000e_irq_pending_interrupts ICR PENDING: 0x0 (ICR= : 0x815000c2, IMS: 0xa00004) 27563@1494850819.412436:e1000e_irq_pending_interrupts ICR PENDING: 0x0 (ICR= : 0x815000c2, IMS: 0xa00004) 27563@1494850819.412441:e1000e_irq_pending_interrupts ICR PENDING: 0x0 (ICR= : 0x815000c2, IMS: 0xa00004) 27563@1494850819.412998:e1000e_irq_pending_interrupts ICR PENDING: 0x100000= 0 (ICR: 0x815000c2, IMS: 0x1a00004) * This bug behaviour wasn't observed with the Linux driver. This commit solves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1447935 https://bugzilla.redhat.com/show_bug.cgi?id=3D1449490 Cc: qemu-stable@nongnu.org Signed-off-by: Sameeh Jubran Signed-off-by: Jason Wang --- hw/net/e1000e_core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 28c5be1..8140564 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -2454,14 +2454,20 @@ e1000e_set_ics(E1000ECore *core, int index, uint32_= t val) static void e1000e_set_icr(E1000ECore *core, int index, uint32_t val) { + uint32_t icr =3D 0; if ((core->mac[ICR] & E1000_ICR_ASSERTED) && (core->mac[CTRL_EXT] & E1000_CTRL_EXT_IAME)) { trace_e1000e_irq_icr_process_iame(); e1000e_clear_ims_bits(core, core->mac[IAM]); } =20 - trace_e1000e_irq_icr_write(val, core->mac[ICR], core->mac[ICR] & ~val); - core->mac[ICR] &=3D ~val; + icr =3D core->mac[ICR] & ~val; + /* Windows driver expects that the "receive overrun" bit and other + * ones to be cleared when the "Other" bit (#24) is cleared. + */ + icr =3D (val & E1000_ICR_OTHER) ? (icr & ~E1000_ICR_OTHER_CAUSES) : ic= r; + trace_e1000e_irq_icr_write(val, core->mac[ICR], icr); + core->mac[ICR] =3D icr; e1000e_update_interrupt_state(core); } =20 --=20 2.7.4