All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marco Porsch <marco@cozybit.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: mcgrof@qca.qualcomm.com, jouni@qca.qualcomm.com,
	vthiagar@qca.qualcomm.com, senthilb@qca.qualcomm.com,
	linux-wireless@vger.kernel.org, devel@lists.open80211s.org,
	ath9k-devel@lists.ath9k.org
Subject: Re: [PATCH 1/3] mac80211: move mesh sync beacon handler into neighbour_update
Date: Fri, 15 Feb 2013 14:48:39 +0100	[thread overview]
Message-ID: <511E3CB7.4040207@cozybit.com> (raw)
In-Reply-To: <1360935431.15040.14.camel@jlt4.sipsolutions.net>

On 02/15/2013 02:37 PM, Johannes Berg wrote:
> On Fri, 2013-02-15 at 14:31 +0100, Marco Porsch wrote:
>> Hi,
>>
>> On 02/15/2013 01:46 PM, Johannes Berg wrote:
>>> On Fri, 2013-02-15 at 12:40 +0000, marco@cozybit.com wrote:
>>>> Please check again. The comment is split in two and placed on the respective new positions.
>>>
>>> Yeah, I see, the API is just total shit. First passing the TSF and then
>>> calculating it to override? Why not do the calculation outside the API
>>> always?
>>
>> The TBTT calculation does intentionally not use the mactime value.
>>
>> Synchronization uses the time in local TSF units and the exact same time
>> point in peers TSF units at the time of sending/receiving (mactime field).
>> The TBTT calculation uses the time of NOW, i.e. the current TSF after
>> possible delays in firmware/driver/rx-handler which may have outdated
>> the mactime field.
>
> I'm talking about this API:
>
> mesh_neighbour_update:
> ...
> 	tsf = drv_get_tsf()
> ...
> 	sync_ops->rx_bcn(..., tsf)
>
>
> mesh_sync_offset_rx_bcn(..., t_r):
> 	...
> 	if (have_better_timestamp)
> 		t_r = get_better_timestamp()
>
>
> You can hardly claim that's an intuitive API.

Hm, alright. Just saying that ieee80211_mps_sta_tbtt_update still uses 
the unchanged TSF value. But hey :)

What would be more favourable then?

a) second variable in mesh_sync_offset_rx_bcn

mesh_neighbour_update:
...
	tsf = drv_get_tsf()
...
	sync_ops->rx_bcn(..., tsf)

	ieee80211_mps_sta_tbtt_update(..., tsf);


mesh_sync_offset_rx_bcn(..., tsf):
	...
	if (have_better_timestamp)
		t_r = get_better_timestamp()
	else
		t_r = tsf;


b) second variable in mesh_neighbour_update

mesh_neighbour_update:
...
	tsf = drv_get_tsf()
	if (have_better_timestamp)
		t_r = get_better_timestamp()
	else
		t_r = tsf;
...
	sync_ops->rx_bcn(..., t_r)

	ieee80211_mps_sta_tbtt_update(..., tsf);


--Marco


WARNING: multiple messages have this Message-ID (diff)
From: Marco Porsch <marco@cozybit.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH 1/3] mac80211: move mesh sync beacon handler into neighbour_update
Date: Fri, 15 Feb 2013 14:48:39 +0100	[thread overview]
Message-ID: <511E3CB7.4040207@cozybit.com> (raw)
In-Reply-To: <1360935431.15040.14.camel@jlt4.sipsolutions.net>

On 02/15/2013 02:37 PM, Johannes Berg wrote:
> On Fri, 2013-02-15 at 14:31 +0100, Marco Porsch wrote:
>> Hi,
>>
>> On 02/15/2013 01:46 PM, Johannes Berg wrote:
>>> On Fri, 2013-02-15 at 12:40 +0000, marco at cozybit.com wrote:
>>>> Please check again. The comment is split in two and placed on the respective new positions.
>>>
>>> Yeah, I see, the API is just total shit. First passing the TSF and then
>>> calculating it to override? Why not do the calculation outside the API
>>> always?
>>
>> The TBTT calculation does intentionally not use the mactime value.
>>
>> Synchronization uses the time in local TSF units and the exact same time
>> point in peers TSF units at the time of sending/receiving (mactime field).
>> The TBTT calculation uses the time of NOW, i.e. the current TSF after
>> possible delays in firmware/driver/rx-handler which may have outdated
>> the mactime field.
>
> I'm talking about this API:
>
> mesh_neighbour_update:
> ...
> 	tsf = drv_get_tsf()
> ...
> 	sync_ops->rx_bcn(..., tsf)
>
>
> mesh_sync_offset_rx_bcn(..., t_r):
> 	...
> 	if (have_better_timestamp)
> 		t_r = get_better_timestamp()
>
>
> You can hardly claim that's an intuitive API.

Hm, alright. Just saying that ieee80211_mps_sta_tbtt_update still uses 
the unchanged TSF value. But hey :)

What would be more favourable then?

a) second variable in mesh_sync_offset_rx_bcn

mesh_neighbour_update:
...
	tsf = drv_get_tsf()
...
	sync_ops->rx_bcn(..., tsf)

	ieee80211_mps_sta_tbtt_update(..., tsf);


mesh_sync_offset_rx_bcn(..., tsf):
	...
	if (have_better_timestamp)
		t_r = get_better_timestamp()
	else
		t_r = tsf;


b) second variable in mesh_neighbour_update

mesh_neighbour_update:
...
	tsf = drv_get_tsf()
	if (have_better_timestamp)
		t_r = get_better_timestamp()
	else
		t_r = tsf;
...
	sync_ops->rx_bcn(..., t_r)

	ieee80211_mps_sta_tbtt_update(..., tsf);


--Marco

  reply	other threads:[~2013-02-15 13:48 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15 11:40 [PATCH 1/3] mac80211: move mesh sync beacon handler into neighbour_update Marco Porsch
2013-02-15 11:40 ` [ath9k-devel] " Marco Porsch
2013-02-15 11:40 ` [PATCH 2/3] mac80211: mesh power save doze scheduling Marco Porsch
2013-02-15 11:40   ` [ath9k-devel] " Marco Porsch
2013-02-15 11:40 ` [PATCH 3/3] ath9k: mesh powersave support Marco Porsch
2013-02-15 11:40   ` [ath9k-devel] " Marco Porsch
2013-02-15 12:14 ` [PATCH 1/3] mac80211: move mesh sync beacon handler into neighbour_update Johannes Berg
2013-02-15 12:14   ` [ath9k-devel] " Johannes Berg
2013-02-15 12:40   ` Bob Copeland
2013-02-15 12:40     ` [ath9k-devel] " Bob Copeland
2013-02-15 12:42     ` Bob Copeland
2013-02-15 12:42       ` [ath9k-devel] " Bob Copeland
2013-02-15 13:30       ` Marco Porsch
2013-02-15 13:30         ` [ath9k-devel] " Marco Porsch
2013-02-15 12:40   ` marco
2013-02-15 12:40     ` [ath9k-devel] " marco at cozybit.com
2013-02-15 12:46     ` Johannes Berg
2013-02-15 12:46       ` [ath9k-devel] " Johannes Berg
2013-02-15 13:31       ` Marco Porsch
2013-02-15 13:31         ` [ath9k-devel] " Marco Porsch
2013-02-15 13:37         ` Johannes Berg
2013-02-15 13:37           ` [ath9k-devel] " Johannes Berg
2013-02-15 13:48           ` Marco Porsch [this message]
2013-02-15 13:48             ` Marco Porsch
2013-02-15 13:58             ` Johannes Berg
2013-02-15 13:58               ` [ath9k-devel] " Johannes Berg
2013-02-18 15:07               ` Marco Porsch
2013-02-18 15:07                 ` [ath9k-devel] " Marco Porsch
2013-02-18 15:20                 ` Johannes Berg
2013-02-18 15:20                   ` [ath9k-devel] " Johannes Berg

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=511E3CB7.4040207@cozybit.com \
    --to=marco@cozybit.com \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=devel@lists.open80211s.org \
    --cc=johannes@sipsolutions.net \
    --cc=jouni@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcgrof@qca.qualcomm.com \
    --cc=senthilb@qca.qualcomm.com \
    --cc=vthiagar@qca.qualcomm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.