From patchwork Wed Mar 28 16:36:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 10313561 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 7103860353 for ; Wed, 28 Mar 2018 16:38:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6103A21EEB for ; Wed, 28 Mar 2018 16:38:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 559E329209; Wed, 28 Mar 2018 16:38:21 +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, T_HK_NAME_DR 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 080E221EEB for ; Wed, 28 Mar 2018 16:38:20 +0000 (UTC) Received: from localhost ([::1]:40115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1E5c-00075C-3Y for patchwork-qemu-devel@patchwork.kernel.org; Wed, 28 Mar 2018 12:38:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1E47-0005vI-0h for qemu-devel@nongnu.org; Wed, 28 Mar 2018 12:36:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f1E46-0007n9-11 for qemu-devel@nongnu.org; Wed, 28 Mar 2018 12:36:47 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56928 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f1E45-0007mz-Su for qemu-devel@nongnu.org; Wed, 28 Mar 2018 12:36:45 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FDEB84256; Wed, 28 Mar 2018 16:36:45 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-237.ams2.redhat.com [10.36.117.237]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E8CEA9F4B; Wed, 28 Mar 2018 16:36:41 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, eswierk@skyportsystems.com, jasowang@redhat.com, pbonzini@redhat.com Date: Wed, 28 Mar 2018 17:36:27 +0100 Message-Id: <20180328163630.48576-4-dgilbert@redhat.com> In-Reply-To: <20180328163630.48576-1-dgilbert@redhat.com> References: <20180328163630.48576-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 28 Mar 2018 16:36:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 28 Mar 2018 16:36:45 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 3/6] e1000: wire new subsection to property 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: peterx@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Dr. David Alan Gilbert" Wire the new subsection from the previous commit to a property so we can turn it off easily. Signed-off-by: Dr. David Alan Gilbert --- hw/net/e1000.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index d399ce3e4f..bb8ee2acb0 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -123,9 +123,11 @@ typedef struct E1000State_st { #define E1000_FLAG_AUTONEG_BIT 0 #define E1000_FLAG_MIT_BIT 1 #define E1000_FLAG_MAC_BIT 2 +#define E1000_FLAG_TSO_BIT 3 #define E1000_FLAG_AUTONEG (1 << E1000_FLAG_AUTONEG_BIT) #define E1000_FLAG_MIT (1 << E1000_FLAG_MIT_BIT) #define E1000_FLAG_MAC (1 << E1000_FLAG_MAC_BIT) +#define E1000_FLAG_TSO (1 << E1000_FLAG_TSO_BIT) uint32_t compat_flags; bool received_tx_tso; } E1000State; @@ -1422,6 +1424,13 @@ static bool e1000_full_mac_needed(void *opaque) return chkflag(MAC); } +static bool e1000_tso_state_needed(void *opaque) +{ + E1000State *s = opaque; + + return chkflag(TSO); +} + static const VMStateDescription vmstate_e1000_mit_state = { .name = "e1000/mit_state", .version_id = 1, @@ -1452,6 +1461,7 @@ static const VMStateDescription vmstate_e1000_tx_tso_state = { .name = "e1000/tx_tso_state", .version_id = 1, .minimum_version_id = 1, + .needed = e1000_tso_state_needed, .post_load = e1000_tx_tso_post_load, .fields = (VMStateField[]) { VMSTATE_UINT8(tx.tso_props.ipcss, E1000State), @@ -1677,6 +1687,8 @@ static Property e1000_properties[] = { compat_flags, E1000_FLAG_MIT_BIT, true), DEFINE_PROP_BIT("extra_mac_registers", E1000State, compat_flags, E1000_FLAG_MAC_BIT, true), + DEFINE_PROP_BIT("migrate_tso_props", E1000State, + compat_flags, E1000_FLAG_TSO_BIT, true), DEFINE_PROP_END_OF_LIST(), };