linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Ben Greear <greearb@candelatech.com>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH-v3 1/2] wireless: Support assoc-at-ms timer in sta-info
Date: Fri, 14 Jun 2019 20:46:40 +0200	[thread overview]
Message-ID: <231c9afd2aaca99c89bc73954307a28a60e86d18.camel@sipsolutions.net> (raw)
In-Reply-To: <7d606df7-bb8e-c454-1eaf-24fd454eab8e@candelatech.com>

On Fri, 2019-06-14 at 08:14 -0700, Ben Greear wrote:
> 
> 
> So, maybe I return instead the elapsed time in the netlink API instead of a
> timestamp.  I think that will give me the value that I am looking for,
> and I can still print out the 'real' time in iw so any tools reading that
> output and do some simple math and figure out the 'real' associated-at time.

I don't think that's good. There's a delay between filling the message
and then processing it in userspace. We had this in the scan code and
learned that was full of races.

The better thing is to use CLOCK_BOOTTIME nanoseconds, and then
userspace can use clock_gettime() to get the current time etc. and then
do whatever calculations it needs. If it wants to print the realtime
timestamp, it could even calculate that (with some jitter) by doing
clock_gettime() on both realtime and boottime clocks...

johannes


      reply	other threads:[~2019-06-14 18:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15 17:21 [PATCH-v3 1/2] wireless: Support assoc-at-ms timer in sta-info greearb
2019-04-15 17:21 ` [PATCH-v3 2/2] mac80211: add assoc-at-ms support greearb
2019-06-12 22:53   ` Ben Greear
2019-06-14 13:38 ` [PATCH-v3 1/2] wireless: Support assoc-at-ms timer in sta-info Johannes Berg
2019-06-14 14:46   ` Ben Greear
2019-06-14 14:56     ` Johannes Berg
2019-06-14 15:14       ` Ben Greear
2019-06-14 18:46         ` Johannes Berg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=231c9afd2aaca99c89bc73954307a28a60e86d18.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).