From nobody Tue Feb 10 00:23:54 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1588943062; cv=none; d=zohomail.com; s=zohoarc; b=cWd9ggdRyWC0+C+I6wL9x3urOMUK7DRaIQlG1KhY323P8pXDmvrE7F/9RMdWAqakwt0jur+zZz+/X/UKPssq9vxLm9evQlmbaFVyMT0HYjNQOpalfF8o1/ba4H7cUs7ephWOomGWJlOBsyISjB7Lyr8x+KqN26qUs3qHkQnstgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588943062; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=OHvBPJe5dvk8hPuFqDgGk/yn6yHcuCjG//Dr25P1Lus=; b=jrYPkksYKoxCWIJyEhqYbKihC1jEOaQAY8QdG3nO0XPlHPOjGwkGHk0yCY68njhlwr/cVFHNRLU/ZuD9ehF379rYLhHU7rzExu7Me7fkztkNPIEf0pBehET7MpLH2ulyeqeVDJa65D3UsW3doeZWtbEDdQHyqaU6CxS5StwkMws= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588943062769611.5948867296155; Fri, 8 May 2020 06:04:22 -0700 (PDT) Received: from localhost ([::1]:60372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jX2ft-00075l-56 for importer@patchew.org; Fri, 08 May 2020 09:04:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jX2X0-0007Wu-Ei for qemu-devel@nongnu.org; Fri, 08 May 2020 08:55:10 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:33260) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jX2Wz-0003fs-Fz for qemu-devel@nongnu.org; Fri, 08 May 2020 08:55:10 -0400 Received: by mail-wr1-x442.google.com with SMTP id h9so1740750wrt.0 for ; Fri, 08 May 2020 05:55:09 -0700 (PDT) Received: from f2.redhat.com (bzq-79-183-19-16.red.bezeqint.net. [79.183.19.16]) by smtp.gmail.com with ESMTPSA id a8sm2852375wrg.85.2020.05.08.05.55.06 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 May 2020 05:55:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OHvBPJe5dvk8hPuFqDgGk/yn6yHcuCjG//Dr25P1Lus=; b=pt4fYbSiLbj5//HRxyJLdguuEKS7U/VGHx0WtHuEW1zRYt5oOq8YU2qqAE3r+a7ZJy s9I5LqxOYLHYXct06yyaXUD8/tK0JFVuDXFm+inERMtrcE7oEjMncV/hfZq4NbGch1Nt w3qp6bFdu4ehQKKmt6qeMeAN150JldsHHRsNVYKiE5ofmMYZBwwd+PugD10tqgZtbyZd EYW7zZkI59ygOkalNVw9/QeN4hNS+CkDTJsB7iEPx+HSJJTX3cCe57ZoIVmdyIFhvbVp C3eI9n++Rb1iVDI0LnEmMfHnx96MCgrnaIRE/0DvEKDyiX7Y9ZVmmb/id64XAj4J5suN XHyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OHvBPJe5dvk8hPuFqDgGk/yn6yHcuCjG//Dr25P1Lus=; b=qhHqD5Pxr27swUF7i/fr8ejKNaO4FLeH92HvJUyoB8zIIzcXtcVxp6CiwALSvqOwx9 +qbsXlZz1QZ/yAt+A3TeilN5P9rkEYsQIcvzcamsCJlsPSMsAeyr01TwGUXk1RCx8tAR XCLkd9CUC5iqYfaaKw8EjCnmrnq1we2PsJukpKxbuC1ZhaELKvGbcLzxjsX7fqGw9pMD ZvN4waYyvxFEm8DtWdBLYg9AnUCvaURGOY70RxM3AdXKozxb74OwM30Dc31Jasd2TTYG zbwVajgG5Ux+0JpZJzTix4KKQEZAWd3JfunPERo08q0fL23Id58ipXgNVKwbhPaNnFRe BMZA== X-Gm-Message-State: AGi0PuZLjzmItgc6MjJXyJnQHW0nYLpkxfAqW4oiUc6FdRhbMkS9P2Wz lHrfvx+4hbi+FBFnD/lf1oWkcOFNgYUbnQ== X-Google-Smtp-Source: APiQypJB04i6f97WTxW22k0X29rKHvWCqywCLZjCNFcfs/2echI29oq15621ULMKzQlRgpm5Fwa3LA== X-Received: by 2002:adf:e5ce:: with SMTP id a14mr2782846wrn.82.1588942508058; Fri, 08 May 2020 05:55:08 -0700 (PDT) From: Yuri Benditovich To: qemu-devel@nongnu.org, mst@redhat.com, jasowang@redhat.com, quintela@redhat.com, dgilbert@redhat.com Subject: [PATCH 6/7] virtio-net: add migration support for RSS and hash report Date: Fri, 8 May 2020 15:54:51 +0300 Message-Id: <20200508125452.7802-7-yuri.benditovich@daynix.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200508125452.7802-1-yuri.benditovich@daynix.com> References: <20200508125452.7802-1-yuri.benditovich@daynix.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2a00:1450:4864:20::442; envelope-from=yuri.benditovich@daynix.com; helo=mail-wr1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yan@daynix.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @daynix-com.20150623.gappssmtp.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Save and restore RSS/hash report configuration. Signed-off-by: Yuri Benditovich --- hw/net/virtio-net.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 5facd333ce..c263b1511d 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -2777,6 +2777,13 @@ static int virtio_net_post_load_device(void *opaque,= int version_id) } } =20 + if (n->rss_data.enabled) { + trace_virtio_net_rss_enable(n->rss_data.hash_types, + n->rss_data.indirections_len, + sizeof(n->rss_data.key)); + } else { + trace_virtio_net_rss_disable(); + } return 0; } =20 @@ -2954,6 +2961,32 @@ static const VMStateDescription vmstate_virtio_net_h= as_vnet =3D { }, }; =20 +static bool virtio_net_rss_needed(void *opaque) +{ + return VIRTIO_NET(opaque)->rss_data.enabled; +} + +static const VMStateDescription vmstate_virtio_net_rss =3D { + .name =3D "virtio-net-device/rss", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D virtio_net_rss_needed, + .fields =3D (VMStateField[]) { + VMSTATE_BOOL(rss_data.enabled, VirtIONet), + VMSTATE_BOOL(rss_data.redirect, VirtIONet), + VMSTATE_BOOL(rss_data.populate_hash, VirtIONet), + VMSTATE_UINT32(rss_data.hash_types, VirtIONet), + VMSTATE_UINT16(rss_data.indirections_len, VirtIONet), + VMSTATE_UINT16(rss_data.default_queue, VirtIONet), + VMSTATE_UINT8_ARRAY(rss_data.key, VirtIONet, + VIRTIO_NET_RSS_MAX_KEY_SIZE), + VMSTATE_VARRAY_UINT16_ALLOC(rss_data.indirections_table, VirtIONet, + rss_data.indirections_len, 0, + vmstate_info_uint16, uint16_t), + VMSTATE_END_OF_LIST() + }, +}; + static const VMStateDescription vmstate_virtio_net_device =3D { .name =3D "virtio-net-device", .version_id =3D VIRTIO_NET_VM_VERSION, @@ -3004,6 +3037,10 @@ static const VMStateDescription vmstate_virtio_net_d= evice =3D { has_ctrl_guest_offloads), VMSTATE_END_OF_LIST() }, + .subsections =3D (const VMStateDescription * []) { + &vmstate_virtio_net_rss, + NULL + } }; =20 static NetClientInfo net_virtio_info =3D { --=20 2.17.1