Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp286985ybl; Fri, 23 Aug 2019 00:31:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9jM0aQDZ9SxjxksTWjw85PBucksUgpFDOPnw9b2r7yh01IGuombpJGDARjLK2YjJfJmn/ X-Received: by 2002:a17:902:be15:: with SMTP id r21mr3039338pls.293.1566545479123; Fri, 23 Aug 2019 00:31:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566545479; cv=none; d=google.com; s=arc-20160816; b=iUj4zBGHiW9JOxCnM7ANuAnwPkqP/WFKZbLRUtY6aTLHoozdo77IoeDXtsjsHu2DMe ua9DfP3D7QzhyPJXjqjwYBQTZtTN963qAQCkZC1ThixiEzwoY8ggTeDRbUldrmZKSfvz JQvIgYWsEj046LCYSKGYUXFBwtnt3far0pR2HUNe5cp7VsNmnayinop7hzeEu43ioigh W4ZESzJm2sLnLbprvcBbCPt+NYLyEPICyHW+wZll3/kALN2wQJJrWeeINYVoZV5amKu/ Hyvf2e1/yKQu8pksSDgscvxcxpKMIQNGWe1MJ+R3P03eQUO2+O4DFTT60RLjavxEbYV2 Ku+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Fb2qwZYsSzxhGRR5mo2zpxAtspNTusEf9sR5Gv8Wr0w=; b=cSXWKSbVLWkoiyorhkHwJXBlhxlsh0oBdH9CSAU/Qunjg3bKcGB802rVCl+GJv8yZu CpUgGC5Gz+CfAiaRYxSac2XHhMQLJ/D7eyHO3S7/5jNPx+fVr5QWsuTCdLURr9o4Ew8Q V66S/9xADEF18G0zawpUhM/ew0W3ZADMQicxMUMiQsMPnJyqozThlVSjHkbkOQ5ty9ZU /iC3vDMJi4gYaoxzQilXsqdx/Vcpyih5erPdgWp8Vz+rPuiQ2Eq91Q2tOuHGuAJGX6fn yRuo6DiUQFEGuREAHUgQS7Pj6fWW77zou2t4QOB+8ZIyFcfc6z5Els97HOV9nhuPzN8U M+rA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8si1289538pgt.548.2019.08.23.00.31.03; Fri, 23 Aug 2019 00:31:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403818AbfHVTMC (ORCPT + 99 others); Thu, 22 Aug 2019 15:12:02 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:34442 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732147AbfHVTMB (ORCPT ); Thu, 22 Aug 2019 15:12:01 -0400 Received: by mail-qt1-f194.google.com with SMTP id q4so8970757qtp.1; Thu, 22 Aug 2019 12:12:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Fb2qwZYsSzxhGRR5mo2zpxAtspNTusEf9sR5Gv8Wr0w=; b=pbxKW2Wq8ozKXk1AjQ0mKJp6ifr7KAHxIaLtad7RSOq9eHi42/Pz7fgajmpFp7nr/p ew30UMH3oZfrK15Tip2g3tkZlKEGRNTflzUC1wd+fHZeKolMNjYsW+EP4QdyTZlqaWL7 VzsPQF69g9dCK+2mVWTOtrBgTv0BxmsXerNVMU5HRKDsKGu5GaOaEYATkn37qrijuuU9 OixFqWrjuAPbhOihNA4oeRf6Msl4iv6n7P5U/j7lNGAHvEeUgGkHGxK0vY9Tj37vVZrV l8549p7C7NuBT173DIBnSvW3jHYbCo+fVAGHSVUb/MmDVhGhJtC8Hb29QOSbLrNoH0v7 H23Q== X-Gm-Message-State: APjAAAWnsoRAp2dNirUbtJQ98JjiAhQGagEFm3/HycQDzY1WVaKIQNcQ R1kO8vwTW2zB5FTz5mwrk66UtkABvEAdbM8SrVE= X-Received: by 2002:ac8:f99:: with SMTP id b25mr1258325qtk.142.1566501120558; Thu, 22 Aug 2019 12:12:00 -0700 (PDT) MIME-Version: 1.0 References: <1566461871-21992-1-git-send-email-ayal@mellanox.com> <20190822140635.GH13020@lunn.ch> <20190822174037.GA18030@splinter> In-Reply-To: <20190822174037.GA18030@splinter> From: Arnd Bergmann Date: Thu, 22 Aug 2019 21:11:42 +0200 Message-ID: Subject: Re: [net] devlink: Add method for time-stamp on reporter's dump To: Ido Schimmel Cc: Andrew Lunn , Aya Levin , "David S. Miller" , Jiri Pirko , Networking , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 22, 2019 at 7:40 PM Ido Schimmel wrote: > On Thu, Aug 22, 2019 at 04:06:35PM +0200, Andrew Lunn wrote: > > On Thu, Aug 22, 2019 at 11:17:51AM +0300, Aya Levin wrote: > > > When setting the dump's time-stamp, use ktime_get_real in addition to > > > jiffies. This simplifies the user space implementation and bypasses > > > some inconsistent behavior with translating jiffies to current time. > > > > Is this year 2038 safe? I don't know enough about this to answer the > > question myself. > > Good point. 'struct timespec' is not considered year 2038 safe and > unfortunately I recently made the mistake of using it to communicate > timestamps to user space over netlink. :/ The code is still in net-next, > so I will fix it while I can. > > Arnd, would it be acceptable to use 'struct __kernel_timespec' instead? The in-kernel representation should just use 'timespec64' if you need separate seconds and nanoseconds, you can convert that to __kernel_timespec while copying to user space. However, please consider two other points: - for simplicity, the general recommendation is to use 64-bit nanoseconds without separate seconds for timestamps - instead of CLOCK_REALTIME, you could use CLOCK_MONOTONIC timestamps that are not affected by clock_settime() or leap second jumps. Arnd