Received: by 10.223.164.202 with SMTP id h10csp2605766wrb; Mon, 27 Nov 2017 21:06:21 -0800 (PST) X-Google-Smtp-Source: AGs4zMZO/+zf4Z5o/7tF/IPVttE21MS2hKH/ABAK/OHd3e+8KKNDpmh2pFixLlKSOB0jDR8KZ/zQ X-Received: by 10.98.36.199 with SMTP id k68mr39078449pfk.236.1511845581303; Mon, 27 Nov 2017 21:06:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511845581; cv=none; d=google.com; s=arc-20160816; b=UuqElX2Hlj5Htf3rhz6GVTXjTmodnNo4s/KcGIoOPepnQCO3ggyqtcQrja6lfbvLT+ pnLXnpWtzgk/qBED00ssko+MMOxk6KYuhQb+Rz3SbeqX5Udm3u2UhXlPzleIOeIDU6vg s0HkQ9YhpKS21iwbCZVvHBfVl51DkXMR/glIV2w5mirENLTLFagVqIyq5Ohg0IuG92rc VjUCCq2RQBwcIJYqwHI1NTmKoTCrjWzVB87ME7WRSnr/ZdVPCtYkCSrImeoswJu5so0N 3fle4RoplKsPktFcxzaIffo6dT1ANHTrd3ZWsJoE4pyvWgJkjHpuv2fHbfOa15ixIe0l tdzA== 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 :references:in-reply-to:mime-version:arc-authentication-results; bh=3WbFWqEYQUsVkkpEmRzGpblOgderBltYN+49IO7GREw=; b=ip+TtuXSFcncQGendXqrNOlcmxJS7LGOGQdNgqp3uIOXuWagtlP2TtKhpz6P2KRd/b CRK+KcYB5IXj7LtvyV63I1Q3smqTbVywgn36IED7jpHbqEXvOksNfJZNvlNUvaitkvps dC9YJJIr/945Gq5XXzcOePwyd3joRGT1sZKZLPDXSoQ2ziRApNfy9aXt+k7K1RFpq1Gj WxQ01HinfxdxaDObJEPUWA2qtPIgIxuvtDRY2NIpYCbPLeVunryGSqrgNZE/nqh59HV0 oW9pzno9YVBsoc5ZXM62jzVEfXgi3uEmL+tjBB6BTQV61QRB7Cy1tsQN9KMVe3s//7kB K5oQ== 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 r59si19597094plb.314.2017.11.27.21.06.09; Mon, 27 Nov 2017 21:06:21 -0800 (PST) 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 S1751451AbdK1FF0 (ORCPT + 77 others); Tue, 28 Nov 2017 00:05:26 -0500 Received: from slow1-d.mail.gandi.net ([217.70.178.86]:44793 "EHLO slow1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750829AbdK1FFX (ORCPT ); Tue, 28 Nov 2017 00:05:23 -0500 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by slow1-d.mail.gandi.net (Postfix) with ESMTP id A1B8E47B6E1 for ; Tue, 28 Nov 2017 05:59:59 +0100 (CET) X-Originating-IP: 209.85.128.182 Received: from mail-wr0-f182.google.com (mail-wr0-f182.google.com [209.85.128.182]) (Authenticated sender: pshelar@ovn.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id C30FDA80CB; Tue, 28 Nov 2017 05:59:57 +0100 (CET) Received: by mail-wr0-f182.google.com with SMTP id 55so12310533wrx.0; Mon, 27 Nov 2017 20:59:57 -0800 (PST) X-Gm-Message-State: AJaThX5p1XWiNisnCAIKMzaFjM9RsmUOt7ZLOlGVCYn8evgc385k3vnm VAZ6RTNRVaZ49GrH1+9u0izlz0BFCzZu07KUiGE= X-Received: by 10.223.171.202 with SMTP id s68mr8926070wrc.13.1511845197333; Mon, 27 Nov 2017 20:59:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.178.69 with HTTP; Mon, 27 Nov 2017 20:59:56 -0800 (PST) In-Reply-To: <20171127114159.2528123-1-arnd@arndb.de> References: <20171127114159.2528123-1-arnd@arndb.de> From: Pravin Shelar Date: Tue, 28 Nov 2017 10:29:56 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] openvswitch: use ktime_get_ts64() instead of ktime_get_ts() To: Arnd Bergmann Cc: Pravin Shelar , "David S. Miller" , y2038@lists.linaro.org, Tonghao Zhang , Jiri Benc , Willem de Bruijn , Jarno Rajahalme , Yi-Hung Wei , Yi Yang , Linux Kernel Network Developers , ovs dev , linux-kernel@vger.kernel.org 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 Mon, Nov 27, 2017 at 5:11 PM, Arnd Bergmann wrote: > timespec is deprecated because of the y2038 overflow, so let's convert > this one to ktime_get_ts64(). The code is already safe even on 32-bit > architectures, since it uses monotonic times. On 64-bit architectures, > nothing changes, while on 32-bit architectures this avoids one > type conversion. > > Signed-off-by: Arnd Bergmann > --- > net/openvswitch/flow.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c > index dbe2379329c5..76d050aba7a4 100644 > --- a/net/openvswitch/flow.c > +++ b/net/openvswitch/flow.c > @@ -56,12 +56,12 @@ > > u64 ovs_flow_used_time(unsigned long flow_jiffies) > { > - struct timespec cur_ts; > + struct timespec64 cur_ts; > u64 cur_ms, idle_ms; > > - ktime_get_ts(&cur_ts); > + ktime_get_ts64(&cur_ts); > idle_ms = jiffies_to_msecs(jiffies - flow_jiffies); > - cur_ms = (u64)cur_ts.tv_sec * MSEC_PER_SEC + > + cur_ms = (u64)(u32)cur_ts.tv_sec * MSEC_PER_SEC + I am not sure why is tv_sec converted to u32. > cur_ts.tv_nsec / NSEC_PER_MSEC; > > return cur_ms - idle_ms; > -- > 2.9.0 > From 1585219465523485672@xxx Mon Nov 27 11:44:50 +0000 2017 X-GM-THRID: 1585219465523485672 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread