[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20171018190047.GG15371@lunn.ch>
Date: Wed, 18 Oct 2017 21:00:47 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Felix Manlunas <felix.manlunas@...ium.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
raghu.vatsavayi@...ium.com, derek.chickles@...ium.com,
satananda.burla@...ium.com, veerasenareddy.burru@...ium.com
Subject: Re: [PATCH V2 net-next] liquidio: pass date and time info to NIC
firmware
Hi Felix
> +static void lio_sync_octeon_time(struct work_struct *work)
> +{
> + struct cavium_wk *wk = (struct cavium_wk *)work;
> + struct lio *lio = (struct lio *)wk->ctxptr;
> + struct octeon_device *oct = lio->oct_dev;
> + struct octeon_soft_command *sc;
> + struct timespec64 ts;
> + struct lio_time *lt;
> + int ret;
> +
> + sc = octeon_alloc_soft_command(oct, sizeof(struct lio_time), 0, 0);
> + if (!sc) {
> + dev_err(&oct->pci_dev->dev,
> + "Failed to sync time to octeon: soft command allocation failed\n");
> + return;
> + }
> +
> + lt = (struct lio_time *)sc->virtdptr;
> +
> + /* Get time of the day */
> + getnstimeofday64(&ts);
> @@ -890,11 +894,29 @@ int octeon_download_firmware(struct octeon_device *oct, const u8 *data,
> load_addr += size;
> }
> }
> +
> + /* Get time of the day */
> + do_gettimeofday(&time);
> + time_to_tm(time.tv_sec, (-sys_tz.tz_minuteswest) * 60, &tm_val);
So here, you correct for the timezone the machine is in. However,
lio_sync_octeon_time() uses getnstimeofday64(), which as far as i
know, does not adjust for the time zone.
Maybe put your machine into Pacific/Kiritimati and see what happens?
Andrew
Powered by blists - more mailing lists