Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp339949rdb; Tue, 19 Dec 2023 20:25:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IH75OLgNt2m1WNwvEU0JlbI2P5tOGbVT9zTpB4Ld9/2aEAazfH7zhNt7rgp7IhfHDqVoL4F X-Received: by 2002:a05:6870:b28b:b0:203:f739:6d48 with SMTP id c11-20020a056870b28b00b00203f7396d48mr2064736oao.7.1703046325390; Tue, 19 Dec 2023 20:25:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703046325; cv=none; d=google.com; s=arc-20160816; b=p97+1B3rvot7V++Dplx3/bM+Xku428cY6GtPRQ6G2ouuSbkbubsXmAVZL3aLJ8A7hz JfWJFinzlCMI5dnFMZ/BQwBtQfbzMtF/a7MckFDHOOM63WinCZOOMEmIh2FgP90uJ6Hx C1eNFxBQnss9pu5azw8uoLikLZWXXIVHr2Yy3/6UOr5y54BFQ0EtXYw7KSRVLoZeN0tT /F8gZazI4qhhthYcWenEB+/Il49gW9jbT33LdMpCq9SmyHODDJREwAznCgjPK+45/8G/ 69gJOxlnvDvwKebw9QmeGc/Qo+aiqXLNttWbeAcW3VGgY9WSF8cMFUZYpvSEcUAj8ss+ DuPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:references:in-reply-to :message-id:cc:to:from:date:dkim-signature; bh=rmdtaBqyL+TTKmGt9TVdr/9Xg5s2fXpiGZdJ9KSKVKk=; fh=hRg6lP20wWzFUEabbYGDC/eOSm+Uryh2RmIGF/RymNM=; b=v+0Se4935l1Ueev7Zy5JnJk0+JNbf/zHqDu6vhiPc4bI/8x/VLKlJlQzoVm1VSapVF ECiVAbgUcjoEBVYsvlcUhVeQDbaV0uQO+sYCo40Mqnn7w3y1qvIWe44RC6nvFabz5+b0 sasUgRm5UzdKg5LybkOEQl1vFw/QYx5+qYSMMYAnr+wMxEGwiz2zPSHKnTVRU3Bmv0WE QqEICLR2yUkzybfXIpraVWnyXOXuVg+UnZXI7YRdeW64FaFhAdLxjokucGVPzRcqHPei nHGfLr54s1FwIINOooMdCzVK4dvtY/m6hlY5xmpQ2q37HgLFRBqfZEk+49z7eOWimG7p IcvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Rk4nIgB2; spf=pass (google.com: domain of linux-kernel+bounces-6371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6371-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s8-20020a632c08000000b005cd6507bb85si8954916pgs.565.2023.12.19.20.25.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 20:25:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Rk4nIgB2; spf=pass (google.com: domain of linux-kernel+bounces-6371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6371-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0824B28432D for ; Wed, 20 Dec 2023 04:25:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68F3AC2D8; Wed, 20 Dec 2023 04:25:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Rk4nIgB2" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DC51210E4; Wed, 20 Dec 2023 04:25:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qt1-f180.google.com with SMTP id d75a77b69052e-42788536cddso1801151cf.2; Tue, 19 Dec 2023 20:25:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703046312; x=1703651112; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=rmdtaBqyL+TTKmGt9TVdr/9Xg5s2fXpiGZdJ9KSKVKk=; b=Rk4nIgB2tAHCzK1R+U5dTjL8BP+X/ZRiMaRWxc8w6RWGI3/w3NGb7QYcU56KmB0jhT uqcuLJ+Is7Ej36eadzzSeIrZN7w3OEHnj9IdegRLIBTBfX/156Ix58Z36KTiqvjBnKeV ccheOuz1p3Z7VxD6M42zGq+6cho/zK9RLjM/+8jYI5QE33h3SuxWGNbNwPzs70CpcNqQ 6xu+5eDBbd5Xsz9BQv7dNnw7I1jwgO1yMHHMVpRbxWEGzK44GMmf10HqK/OpSgS9qM75 LOEVyl3K+SCqBMijbIg2/3ZW0qoJeSeGFyqoVqIEFvM8KbhMGmv75B7HVR9ljpOvlaFh QALA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703046312; x=1703651112; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=rmdtaBqyL+TTKmGt9TVdr/9Xg5s2fXpiGZdJ9KSKVKk=; b=FHQNsGyA6CJSMVFzjdw9aMNorY+MqSxAp5eHBy8liXJHUWNcMe27tdjTJcHxVJlfQg lIEaoOYSCXLaBaIBu3HGWpJO8KgVWRyUNQzhQ/76DznWXkUXApNMGTgzb4xIOurhsG5H fzj1nVkckyilEOMoAAX+iWDdLqUSXF179Wh+EBxkhvsn+/rgfXIfCecizssg17xLly/y r02LBFYdL10zCLqDXC0bm1v4Y4QQk0HwYXq2GxCbqPPS9df9T8RNOQXiKXYmKIPtfC+A rKuzbrQaWKW8yPha5JUvL9+awAU6g/z1AoccBOSlO4KfEI01ZxocMxpDYQpnYGfzMOHX TKGg== X-Gm-Message-State: AOJu0YwezCJsFpPgb79DCBgOHFZ3O+JVw+Irl7FhtOXFkLAw4h5qcsIA whD4vuNS1StpgtCdcFOuYds= X-Received: by 2002:a05:622a:188e:b0:427:86ad:47dd with SMTP id v14-20020a05622a188e00b0042786ad47ddmr864739qtc.16.1703046312174; Tue, 19 Dec 2023 20:25:12 -0800 (PST) Received: from localhost (114.66.194.35.bc.googleusercontent.com. [35.194.66.114]) by smtp.gmail.com with ESMTPSA id hh12-20020a05622a618c00b00425f0ab0393sm6253689qtb.17.2023.12.19.20.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 20:25:11 -0800 (PST) Date: Tue, 19 Dec 2023 23:25:11 -0500 From: Willem de Bruijn To: Jason Wang , Willem de Bruijn Cc: Steffen Trumtrar , "Michael S. Tsirkin" , Xuan Zhuo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , virtualization@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Willem de Bruijn Message-ID: <65826ca77a39e_190a43294eb@willemb.c.googlers.com.notmuch> In-Reply-To: References: <20231218-v6-7-topic-virtio-net-ptp-v1-0-cac92b2d8532@pengutronix.de> <65807512bc20b_805482941e@willemb.c.googlers.com.notmuch> Subject: Re: [PATCH RFC 0/4] virtio-net: add tx-hash, rx-tstamp, tx-tstamp and tx-time Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Jason Wang wrote: > On Tue, Dec 19, 2023 at 12:36=E2=80=AFAM Willem de Bruijn > wrote: > > > > Steffen Trumtrar wrote: > > > This series tries to pick up the work on the virtio-net timestampin= g > > > feature from Willem de Bruijn. > > > > > > Original series > > > Message-Id: 20210208185558.995292-1-willemdebruijn.kernel@gmail= .com > > > Subject: [PATCH RFC v2 0/4] virtio-net: add tx-hash, rx-tstamp,= > > > tx-tstamp and tx-time > > > From: Willem de Bruijn > > > > > > RFC for four new features to the virtio network device: > > > > > > 1. pass tx flow state to host, for routing + telemetry > > > 2. pass rx tstamp to guest, for better RTT estimation > > > 3. pass tx tstamp to guest, idem > > > 3. pass tx delivery time to host, for accurate pacing > > > > > > All would introduce an extension to the virtio spec. > > > > > > The original series consisted of a hack around the DMA API, which s= hould > > > be fixed in this series. > > > > > > The changes in this series are to the driver side. For the changes = to qemu see: > > > https://github.com/strumtrar/qemu/tree/v8.1.1/virtio-net-ptp > > > > > > Currently only virtio-net is supported. The original series used > > > vhost-net as backend. However, the path through tun via sendmsg doe= sn't > > > allow us to write data back to the driver side without any hacks. > > > Therefore use the way via plain virtio-net without vhost albeit bet= ter > > > performance. > > > > > > Signed-off-by: Steffen Trumtrar > > > > Thanks for picking this back up, Steffen. Nice to see that the code s= till > > applies mostly cleanly. > > > > For context: I dropped the work only because I had no real device > > implementation. The referenced patch series to qemu changes that. > > > > I suppose the main issue is the virtio API changes that this introduc= es, > > which will have to be accepted to the spec. > > > > One small comment to patch 4: there I just assumed the virtual device= > > time is CLOCK_TAI. There is a concurrent feature under review for HW > > pacing offload with AF_XDP sockets. The clock issue comes up a bit. I= n > > general, for hardware we cannot assume a clock. > = > Any reason for this? E.g some modern NIC have PTP support. I meant that we cannot assume a specific clock, if aiming to offload existing pacing (or "launch time") methods. The issue discussed in the AF_XDP thread is whether to use CLOCK_TAI or CLOCK_MONOTONIC. Both of which are already in use in software pacing offload, in the ETF and FQ qdiscs, respectively. But for virtio it may be acceptable to restrict to one clock, such as CLOCK_REALTIME or CLOCK_TAI. CLOCK_MONOTONIC being boottime is almost certain to have an offset. Even if the clocks' rates are synchronized with phc2sys. > > For virtio, perhaps > > assuming the same monotonic hardware clock in guest and host can be > > assumed. > = > Note that virtio can be implemented in hardware now. So we can assume > things like the kvm ptp clock. > = > > But this clock alignment needs some thought. > > > = > Thanks > =