Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1457552

Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput

From Johannes Berg <johannes@sipsolutions.net>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
Date 2016-08-08 08:20 +0200
Message-ID <s3M4O-68L-3@gated-at.bofh.it> (permalink)
References (2 earlier) <s2Mqd-7rU-9@gated-at.bofh.it> <s2Po5-Va-5@gated-at.bofh.it> <s2Nmi-85e-33@gated-at.bofh.it> <s2Po5-Va-3@gated-at.bofh.it> <s3wCK-4si-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput Maxim Altshul <maxim.altshul@ti.com> - 2016-08-04 14:40 +0200
  [PATCH 2/2] wlcore: Remove wl pointer from wl_sta structure Maxim Altshul <maxim.altshul@ti.com> - 2016-08-04 14:50 +0200
    Re: [PATCH 2/2] wlcore: Remove wl pointer from wl_sta structure John Stultz <john.stultz@linaro.org> - 2016-08-04 23:40 +0200
  Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput John Stultz <john.stultz@linaro.org> - 2016-08-04 23:40 +0200
    Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to  get_expected_throughput Johannes Berg <johannes@sipsolutions.net> - 2016-08-05 07:50 +0200
      Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput John Stultz <john.stultz@linaro.org> - 2016-08-05 08:10 +0200
  Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to  get_expected_throughput Johannes Berg <johannes@sipsolutions.net> - 2016-08-05 14:30 +0200
    RE: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to  get_expected_throughput "Altshul, Maxim" <maxim.altshul@ti.com> - 2016-08-05 15:30 +0200
      Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to  get_expected_throughput Johannes Berg <johannes@sipsolutions.net> - 2016-08-05 17:40 +0200
        RE: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to  get_expected_throughput "Altshul, Maxim" <maxim.altshul@ti.com> - 2016-08-07 15:50 +0200
          Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to  get_expected_throughput Johannes Berg <johannes@sipsolutions.net> - 2016-08-08 08:20 +0200
            RE: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to  get_expected_throughput "Altshul, Maxim" <maxim.altshul@ti.com> - 2016-08-08 12:50 +0200
              Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to  get_expected_throughput Johannes Berg <johannes@sipsolutions.net> - 2016-08-09 10:00 +0200
                RE: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to  get_expected_throughput "Altshul, Maxim" <maxim.altshul@ti.com> - 2016-08-10 23:00 +0200
  Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to  get_expected_throughput Johannes Berg <johannes@sipsolutions.net> - 2016-08-05 14:30 +0200

csiph-web