All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: "Altshul, Maxim" <maxim.altshul@ti.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "john.stultz@linaro.org" <john.stultz@linaro.org>,
	Kalle Valo <kvalo@codeaurora.org>,
	Eliad Peller <eliad@wizery.com>,
	"Machani, Yaniv" <yanivma@ti.com>
Subject: Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
Date: Mon, 08 Aug 2016 08:10:51 +0200	[thread overview]
Message-ID: <1470636651.2597.10.camel@sipsolutions.net> (raw)
In-Reply-To: <F52F6CF13382174692D81838F3DBEF41136F0441@DFRE01.ent.ti.com>

On Sun, 2016-08-07 at 13:42 +0000, Altshul, Maxim wrote:
> Hi Johaness,
> I have prepared a patch for the issue and it is waiting for me to
> send it, but I feel that maybe I have not explained the previous
> issue well enough or I did not understand your request fully.
> I would like to clarify about the previous patch (the one that you
> applied) again:
> 
> a. The bug occurred because I have added a member called wl to the
> structure wl_sta, but it turned to be NULL when the function
> drv_get_expected_throughput was called.

Right.

> b. This member was NULL because it was initialized in the wrong place
> (sta_add instead of update_sta_state), and thus the regression has
> failed. 

Ah. So you *do* in fact implement the sta_state op (op_sta_state)
instead of the sta_add op, which I thought you were using and which was
causing the error. Perhaps sta_add came from being originally called
through mac80211's sta_add op.

So in essence, in this particular case it ended up being just a driver
bug because it was initializing the pointer in the wrong place, and I
agree that the fix in mac80211 to pass the hw pointer like everywhere
else makes perfect sense.

> c. Even so, wl_sta itself was not NULL at any point.

Right.

> d. This is why I have created two patches:
> First patch (the one that you have applied) made it easy for the
> driver to access hw->priv (the problematic access to hw->priv was the
> reason I added wl to wl_sta in the first place, which was a mistake).
> Second patch reverted the addition of wl member to wl_sta.

Right.
 
> 2. From what I have seen, other ops that take ieee80211_sta as a
> parameter do not check for sta->uploaded, which is why it feels a
> little odd to do it in drv_get_expected_throughput and nowhere else.

I think most of them have a different protection; perhaps some are
lacking it?

 * set_tim: can only be called when the station is associated
 * set_key: likewise, iirc, though perhaps userspace can mess up?
 * update_tkip_key: must have a key and traffic
 * sta_notify: powersave - must be associated
 * sta_pre_rcu_remove: only pre removal etc.
 * sta_rc_update: looks partially problematic through RX action frame, 
                  if a peer messes up and sends one ... oops
 * TDLS ones look fine, I think

So I *think* that most are OK - RC update might be an issue.

get_expected_throughput is unique in that it can be called from
userspace at any time after the station is added, and that happened in
the case that John had (called immediately after ADD_STA notification,
afaict)

johannes

  reply	other threads:[~2016-08-08  6:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-04 12:43 [PATCH 0/2] get_expected_throughput interface update Maxim Altshul
2016-08-04 12:43 ` [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput Maxim Altshul
2016-08-04 12:43   ` [PATCH 2/2] wlcore: Remove wl pointer from wl_sta structure Maxim Altshul
2016-08-04 21:31     ` John Stultz
2016-08-15  7:56     ` Kalle Valo
2016-08-15  7:56     ` Kalle Valo
2016-08-04 21:31   ` [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput John Stultz
2016-08-05  5:40     ` Johannes Berg
2016-08-05  6:03       ` John Stultz
2016-08-05 12:22   ` Johannes Berg
2016-08-05 12:24     ` Johannes Berg
2016-08-05 13:25       ` Altshul, Maxim
2016-08-05 15:34         ` Johannes Berg
2016-08-07 13:42           ` Altshul, Maxim
2016-08-08  6:10             ` Johannes Berg [this message]
2016-08-08 10:42               ` Altshul, Maxim
2016-08-09  7:58                 ` Johannes Berg
2016-08-10  8:03                   ` Altshul, Maxim
2016-08-15  7:59   ` Kalle Valo

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=1470636651.2597.10.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=eliad@wizery.com \
    --cc=john.stultz@linaro.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxim.altshul@ti.com \
    --cc=yanivma@ti.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.