From nobody Sun Nov 24 13:44:13 2024 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1723581092; cv=none; d=zohomail.com; s=zohoarc; b=hVoi0cx4MHE6GqbMDTA4a5GAus9eBf9zZfW5zr1buZYZmnB7P4+9QS5lShp0PCQ+pBcRdAKvh/FDyFZpvSWrID75EE8edHhE6dp8BWlqI4F37dZd/JPCNbToIxyvrSN9K98hU7Z9jrnSZYFyRe01hHGqtu5a7ta39oBjgVAxZhk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723581092; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=h8VJVqwOU+3OnI+KhTAsjide89+CrsOHDPq/j9RwzJ8=; b=foM4TmUps6C7JVkyLEaeGlsimT+DKIMXW3ww6uGyJDhSsF1pECls2p3rIuM3Xk64LmDK2LMqM8H9z4A3QGFrGtoqgnxJMZv1Nu0yLboor560MchW4S2XzS6f2LrLQ1MXWeSDr1ThDGFt1KNMgIc6IdryuJ+EPv0ROBFnXGqXEG4= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172358109234423.041813754743316; Tue, 13 Aug 2024 13:31:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdy9y-000813-0q; Tue, 13 Aug 2024 16:30:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdy9t-0007rF-UC for qemu-devel@nongnu.org; Tue, 13 Aug 2024 16:30:21 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sdy9o-0007hF-05 for qemu-devel@nongnu.org; Tue, 13 Aug 2024 16:30:20 -0400 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5af6a1afa63so6927491a12.0 for ; Tue, 13 Aug 2024 13:30:10 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a80f3f48ed5sm96719366b.29.2024.08.13.13.30.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 13:30:08 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 0D7465F8BB; Tue, 13 Aug 2024 21:23:31 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723581009; x=1724185809; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h8VJVqwOU+3OnI+KhTAsjide89+CrsOHDPq/j9RwzJ8=; b=B4jddG6PtgQVd/JlRN2Dn7Dy97dgxuHR32ymDUrNpiOAgog27C186v7MMS76wpdNdi iiCPa3akNprKBIVs8XySt0Ryri3mM5yeyjVQtOf2BVruPjg+Qf11B4X5itzVKcyowMJv gc7LaEQLYiEhdWDF6B+58KMZduusE/HPHnG5/sz3mkFTAGr4uCBPDeHxg3RyDlwuOMNy jZxXLQdccXhIH8asVKww6TPJFSZZ8LgneHPW+kCIWRBJEQOQyn3RVrmtUiMEtw/vDiVF lHcZ3F9WMTh8+H9/l5f0xI26DL0fDQ6vahjMWd+tGNec0svFqDe5CuIJV2B9E4P1kvny m2AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723581009; x=1724185809; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h8VJVqwOU+3OnI+KhTAsjide89+CrsOHDPq/j9RwzJ8=; b=BsY2qr9wXCU6rdfqG3ugKUv0yFp4xIBmRIxAMkn1FbHUfQhMI7n1hLRpQGfkdEYXQ0 WO4Gk5G3h81sv6U8TDfynO+3slC0nhMDvegVmtf6nJ3C21NqhiyuHhEFw82BRwdHEH6Q bnhRwlYjS3UPKEtKxp8VB/aeWKWMA06RvBB8EWeZlrMzth+O4ooyK0t3vx4FvTekSmPL ci+odM5WH4cITTU/WxtjdLXjGATMljhk1/tt+Qggc2BHyaqxINvLCYCmWm9ZJVE0Cpm0 FzfSDitmDY+dMIimfGR6rvv0jo439QOBXSl4fehS5BidD0OvUta4YmeWZDFast6mYySs jg+A== X-Gm-Message-State: AOJu0YwRTfzQzBWTZxwHVIVaeZOL4VpjaqqMEnEqDtQ6H6AXfKUUBCan oF6IngySi8/kswyFpPDCcRMQ5e3CdZZej397n8LSAoHCBn8MfH8mw/WCyd/+yu4= X-Google-Smtp-Source: AGHT+IEbrpg+FXr45vd3vgmckaaVoEmq3bFsXX8AczPKD5IDIqNa2uewY1v70Y3ToIBVCfXRhW6gow== X-Received: by 2002:a17:907:f704:b0:a72:80b8:ba64 with SMTP id a640c23a62f3a-a8366d552ccmr40115966b.25.1723581009064; Tue, 13 Aug 2024 13:30:09 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Michael Roth , Palmer Dabbelt , Mahmoud Mandour , Pavel Dovgalyuk , Yoshinori Sato , Weiwei Li , Eduardo Habkost , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster , David Hildenbrand , Beraldo Leal , Liu Zhiwei , Eric Auger , Song Gao , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-arm@nongnu.org, Peter Xu , Jiri Pirko , Eric Blake , Fabiano Rosas , qemu-s390x@nongnu.org, Peter Maydell , "Michael S. Tsirkin" , Daniel Henrique Barboza , John Snow , Alexandre Iooss , Konstantin Kostiuk , Pierrick Bouvier , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Thomas Huth , Paolo Bonzini , Richard Henderson , Jason Wang , Bin Meng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Nicholas Piggin Subject: [PATCH v2 17/21] virtio-net: Use virtual time for RSC timers Date: Tue, 13 Aug 2024 21:23:25 +0100 Message-Id: <20240813202329.1237572-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240813202329.1237572-1-alex.bennee@linaro.org> References: <20240813202329.1237572-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: pass client-ip=2a00:1450:4864:20::536; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1723581094520116600 From: Nicholas Piggin Receive coalescing is visible to the target machine, so its timers should use virtual time like other timers in virtio-net, to be compatible with record-replay. Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-10-npiggin@gmail.com> Signed-off-by: Alex Benn=C3=A9e Acked-by: Michael S. Tsirkin --- hw/net/virtio-net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 10ebaae5e2..ed33a32877 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -2124,7 +2124,7 @@ static void virtio_net_rsc_purge(void *opq) chain->stat.timer++; if (!QTAILQ_EMPTY(&chain->buffers)) { timer_mod(chain->drain_timer, - qemu_clock_get_ns(QEMU_CLOCK_HOST) + chain->n->rsc_timeout); + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + chain->n->rsc_timeou= t); } } =20 @@ -2360,7 +2360,7 @@ static size_t virtio_net_rsc_do_coalesce(VirtioNetRsc= Chain *chain, chain->stat.empty_cache++; virtio_net_rsc_cache_buf(chain, nc, buf, size); timer_mod(chain->drain_timer, - qemu_clock_get_ns(QEMU_CLOCK_HOST) + chain->n->rsc_timeout); + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + chain->n->rsc_timeou= t); return size; } =20 @@ -2598,7 +2598,7 @@ static VirtioNetRscChain *virtio_net_rsc_lookup_chain= (VirtIONet *n, chain->max_payload =3D VIRTIO_NET_MAX_IP6_PAYLOAD; chain->gso_type =3D VIRTIO_NET_HDR_GSO_TCPV6; } - chain->drain_timer =3D timer_new_ns(QEMU_CLOCK_HOST, + chain->drain_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, virtio_net_rsc_purge, chain); memset(&chain->stat, 0, sizeof(chain->stat)); =20 --=20 2.39.2