Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp377391lqh; Tue, 7 May 2024 01:42:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWIu1+BxAYhlMVEmnebkQLuIxaX1IAaYbasa/UbnKctMbFSbK+phwXkAtdg9ofH2fA9qy1eaa6hWyqYbUcASdoDpG7nCNiTfwwaJnLMKg== X-Google-Smtp-Source: AGHT+IFvYtauSoyJAbAWrRUJtECzDVv9GzA89D4+LJsSJA/J+V70zmG2W5CpEbYi8HdXXKIqyXXG X-Received: by 2002:a05:620a:57ce:b0:792:9bec:8c1e with SMTP id wl14-20020a05620a57ce00b007929bec8c1emr4458755qkn.24.1715071376924; Tue, 07 May 2024 01:42:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715071376; cv=pass; d=google.com; s=arc-20160816; b=Ui7W2bkln/tAcvZtnl3h64QFulth5k/79L/AhO3Hl6QvH/LljtgS+BXE+ltcrZuGXf 3szprqtS6f3mPDmcdSs0RV/QjTBP2cHmDKMpO7bclVECO5Zigv7YI6GE+I9qLHEX9mhb D+pRnlJiCejpxd9bmhRgs6vw2UJzKcXRhVIjEwkZ13ENhSoSfDgDzx1CllHoha0VjkCa F3Ki3pXJcLHSDpIP4Xkl4A1QtmTlH3tHkM9wrxLfC5C9ojBj7wH0V5l/0ogw9A82+/YL zkKVFnlrhnDwlutlrE78Lz380T06bQ/nDGm+Ky30oD0e17X9rA2olkXwVRevB0VqIiiJ TWVg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=MeEIcD5RTZy4syRWjHXHQyoYiBxz8Z+MY7de/HdeVBo=; fh=mPGffdR6b6frDouQe0Q3Z4ZV97Y6QADTtljN155ni8g=; b=kEV5dwRy+uNswREujgcL+qKJqSLWPDeVBbhzzRagpn7cyt9+HCphD5BjtU2Vn83GIq I1oOygc8Res6khXWTBQVN49Hk4vQmNn0wWPVJ4s7cdJLV7zH9m63xJub0xspJu4eQteo k7/tEhW5gXbiQe0pa3ke2IYChB8DjgnC+suimcr3CiXjmhigk4dE98XYiN0JXS8IicJx milMnD4+RsOfuQqyCD2z1bnlqQCUpptGDM7aCDEgClHU7WMOJZRPusrTFuvbw24Y7cho 1lQQ/iH465q/gpEp7/sMyJ8EvTMyBfLYmtkXBB2zIO8HDTi6D9MmKcbc7kZi8WoEAsta AOhQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AupHgVjw; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-170887-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170887-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a36-20020a05620a43a400b0079065e4fbdbsi10175007qkp.200.2024.05.07.01.42.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 01:42:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170887-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AupHgVjw; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-170887-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170887-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 927271C20D29 for ; Tue, 7 May 2024 08:42:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 046C914D439; Tue, 7 May 2024 08:42:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AupHgVjw" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8515E13C9A6 for ; Tue, 7 May 2024 08:42:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715071364; cv=none; b=nnrC3O4kZ4Vvy0/MNfvI2IpPLwe94QjXLuLq52OJ+gLolKPraXVV62ADnH5bxiH+6x4vzr6a7eDwZgZBDiWnm3wUias/Wm79RUJPD4X+FaS7W4iLDWDj1sfnf3Xr2CgJS4jTG4Ct5FulNOn9yy+s/6bdRhgpkjakG7dyaP9XC1E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715071364; c=relaxed/simple; bh=joLZ82/qDlnM3hqNQDbtKRts1WGRIsmAEuypVyS/k5g=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=RwJU0O1X9GOkysbS964ttTwbfP2fR5FGoUVToVh+UzCzo8GnpDtLadf+KahKAWpsjZWGQdNi7YF+WRhlkr9bwYzAMLXlP9rJqzRIts2plIqtCMlU6CNRZ3+HHeGU4UyIEAnlGZiQ91Bmc+mHJAoBzFArIsjlEtVmpVc603/uNsc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=AupHgVjw; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715071361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=MeEIcD5RTZy4syRWjHXHQyoYiBxz8Z+MY7de/HdeVBo=; b=AupHgVjwrQ82aLrJuiD+86B/G+pzgeDyBuoqK59rYWVyqIniSUq9NPvezjLsL6BtLy+/r2 S+lt+f8zi1OwB7SPIOok/nT2v1Ndp4ZNrzYtm9Xb53Fb7vOU+4afPaXZ030Sla6VWYnHnO VCNMZsVJ4ioKPw7wzbREUHAq3X6iAow= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-308--nSAW8PVNNOYSlvQO3udUQ-1; Tue, 07 May 2024 04:42:40 -0400 X-MC-Unique: -nSAW8PVNNOYSlvQO3udUQ-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2e20f2db07fso4119321fa.2 for ; Tue, 07 May 2024 01:42:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715071358; x=1715676158; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MeEIcD5RTZy4syRWjHXHQyoYiBxz8Z+MY7de/HdeVBo=; b=A08FGQgIfaqpQP6uCuP0RRIISJi4mg7XwJlRKJyfHL/+k1wkBMP8wTT5Y9DpL3+w8o szCA2uKqnPZzGvZQRC0GOOfC3Is6qyLDEIeC3gT4Oeurga7x9FxwL1ccVNMKr/PI/O3K M4KqVcSiJfbntzi/lBpmlYKsm7EHLR9M/UMN4shzwOFQmHhD174NrIEfwX16VodpFuRo Mn/3bRqNkxYTX/OCoqm2H+oyCwqIPLNp+vH5oXNwVD3G1Ap/0JB31NAEv8mrYskQuuQq c4xOJo4peonJHgQF7TZMreCzzZYJqydtdvIvne7cpR7dMjJJp7dpxeStfttTFqGbO5Dz PTKA== X-Forwarded-Encrypted: i=1; AJvYcCWhlwbeK8L8lbcKYUx5zW0KRdDSR568YRQp077N2hDLKUT8WoqdVY+3WMPWTAWCQVMw/U2WQqHeT9EnmVbOuln18z74GU15sxSJ+2YJ X-Gm-Message-State: AOJu0Yxh5fTAKnst2zxUTD0khkQlLIJcGyKKktBG9y7G3IHW3M2/EwJu Wm9qUt065zlzBapIM+LgKzTfKkTLupIcg8FaISrP7CnZfOct4mANLZR2SWHTbMhIaJduQDU3i9u AQep+P48efNprcv64TvirnRPnLSzfNtLK+dXO6tm/fGqlYfNZtc1HgK8X7m1a4Z+O064nuQ== X-Received: by 2002:a05:6512:3286:b0:51f:1896:be05 with SMTP id p6-20020a056512328600b0051f1896be05mr7822754lfe.1.1715071358186; Tue, 07 May 2024 01:42:38 -0700 (PDT) X-Received: by 2002:a05:6512:3286:b0:51f:1896:be05 with SMTP id p6-20020a056512328600b0051f1896be05mr7822739lfe.1.1715071357734; Tue, 07 May 2024 01:42:37 -0700 (PDT) Received: from gerbillo.redhat.com ([2a0d:3341:b09b:b810::f71]) by smtp.gmail.com with ESMTPSA id b17-20020a05600c4e1100b0041be3383a2fsm22688823wmq.19.2024.05.07.01.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 01:42:37 -0700 (PDT) Message-ID: Subject: Re: [PATCHv4 net-next] ptp/ioctl: support MONOTONIC_RAW timestamps for PTP_SYS_OFFSET_EXTENDED From: Paolo Abeni To: Mahesh Bandewar , Netdev , Linux , David Miller , Jakub Kicinski , Eric Dumazet , Thomas Gleixner , Richard Cochran , Arnd Bergmann , Sagi Maimon Cc: Jonathan Corbet , John Stultz , Mahesh Bandewar Date: Tue, 07 May 2024 10:42:35 +0200 In-Reply-To: <20240502211047.2240237-1-maheshb@google.com> References: <20240502211047.2240237-1-maheshb@google.com> Autocrypt: addr=pabeni@redhat.com; prefer-encrypt=mutual; keydata=mQINBGISiDUBEAC5uMdJicjm3ZlWQJG4u2EU1EhWUSx8IZLUTmEE8zmjPJFSYDcjtfGcbzLPb63BvX7FADmTOkO7gwtDgm501XnQaZgBUnCOUT8qv5MkKsFH20h1XJyqjPeGM55YFAXc+a4WD0YyO5M0+KhDeRLoildeRna1ey944VlZ6Inf67zMYw9vfE5XozBtytFIrRyGEWkQwkjaYhr1cGM8ia24QQVQid3P7SPkR78kJmrT32sGk+TdR4YnZzBvVaojX4AroZrrAQVdOLQWR+w4w1mONfJvahNdjq73tKv51nIpu4SAC1Zmnm3x4u9r22mbMDr0uWqDqwhsvkanYmn4umDKc1ZkBnDIbbumd40x9CKgG6ogVlLYeJa9WyfVMOHDF6f0wRjFjxVoPO6p/ZDkuEa67KCpJnXNYipLJ3MYhdKWBZw0xc3LKiKc+nMfQlo76T/qHMDfRMaMhk+L8gWc3ZlRQFG0/Pd1pdQEiRuvfM5DUXDo/YOZLV0NfRFU9SmtIPhbdm9cV8Hf8mUwubihiJB/9zPvVq8xfiV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N87fpIbpbZaIdinF7b9srwUvDOKsywfs5HMiUZhLKoZzCcU/AEFjQsPTATACGsWf3JYPnWxL9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, 2024-05-02 at 14:10 -0700, Mahesh Bandewar wrote: > The ability to read the PHC (Physical Hardware Clock) alongside > multiple system clocks is currently dependent on the specific > hardware architecture. This limitation restricts the use of > PTP_SYS_OFFSET_PRECISE to certain hardware configurations. >=20 > The generic soultion which would work across all architectures > is to read the PHC along with the latency to perform PHC-read as > offered by PTP_SYS_OFFSET_EXTENDED which provides pre and post > timestamps. However, these timestamps are currently limited > to the CLOCK_REALTIME timebase. Since CLOCK_REALTIME is affected > by NTP (or similar time synchronization services), it can > experience significant jumps forward or backward. This hinders > the precise latency measurements that PTP_SYS_OFFSET_EXTENDED > is designed to provide. >=20 > This problem could be addressed by supporting MONOTONIC_RAW > timestamps within PTP_SYS_OFFSET_EXTENDED. Unlike CLOCK_REALTIME > or CLOCK_MONOTONIC, the MONOTONIC_RAW timebase is unaffected > by NTP adjustments. >=20 > This enhancement can be implemented by utilizing one of the three > reserved words within the PTP_SYS_OFFSET_EXTENDED struct to pass > the clock-id for timestamps. The current behavior aligns with > clock-id for CLOCK_REALTIME timebase (value of 0), ensuring > backward compatibility of the UAPI. >=20 > Signed-off-by: Mahesh Bandewar LGTM, but let's wait a bit for Richard ack. @Richard, could you please have look? Paolo