All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] get_expected_throughput interface update
@ 2016-08-04 12:43 Maxim Altshul
  2016-08-04 12:43 ` [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput Maxim Altshul
  0 siblings, 1 reply; 20+ messages in thread
From: Maxim Altshul @ 2016-08-04 12:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: john.stultz, Maxim Altshul

These two patches are two important patches (mainly 1/2)
that solve a regression issue that was found in wlcore
(where wl was found to be null in some cases)

Also, they make it easier for driver to get hw->priv when op is invoked. 


Maxim Altshul (2):
  mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  wlcore: Remove wl pointer from wl_sta structure

 drivers/net/wireless/ti/wlcore/main.c     | 6 +++---
 drivers/net/wireless/ti/wlcore/wlcore_i.h | 1 -
 include/net/mac80211.h                    | 3 ++-
 net/mac80211/driver-ops.h                 | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.9.0

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  2016-08-04 12:43 [PATCH 0/2] get_expected_throughput interface update Maxim Altshul
@ 2016-08-04 12:43 ` Maxim Altshul
  2016-08-04 12:43   ` [PATCH 2/2] wlcore: Remove wl pointer from wl_sta structure Maxim Altshul
                     ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Maxim Altshul @ 2016-08-04 12:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: john.stultz, Maxim Altshul, Kalle Valo, Johannes Berg,
	Eliad Peller, Yaniv Machani

- The variable is added to allow the driver an easy access
to it's own hw->priv when the op is invoked.

- Change wlcore op accordingly.

Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>
---
 drivers/net/wireless/ti/wlcore/main.c | 5 +++--
 include/net/mac80211.h                | 3 ++-
 net/mac80211/driver-ops.h             | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 4573614..1ec3545 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -5803,10 +5803,11 @@ out:
 	mutex_unlock(&wl->mutex);
 }
 
-static u32 wlcore_op_get_expected_throughput(struct ieee80211_sta *sta)
+static u32 wlcore_op_get_expected_throughput(struct ieee80211_hw *hw,
+					struct ieee80211_sta *sta)
 {
 	struct wl1271_station *wl_sta = (struct wl1271_station *)sta->drv_priv;
-	struct wl1271 *wl = wl_sta->wl;
+	struct wl1271 *wl = hw->priv;
 	u8 hlid = wl_sta->hlid;
 
 	/* return in units of Kbps */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c328f35..464eb97 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3484,7 +3484,8 @@ struct ieee80211_ops {
 
 	int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
 	void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
-	u32 (*get_expected_throughput)(struct ieee80211_sta *sta);
+	u32 (*get_expected_throughput)(struct ieee80211_hw *hw,
+			struct ieee80211_sta *sta);
 	int (*get_txpower)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 			   int *dbm);
 
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 154ce4b..1f75195 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1081,7 +1081,7 @@ static inline u32 drv_get_expected_throughput(struct ieee80211_local *local,
 
 	trace_drv_get_expected_throughput(sta);
 	if (local->ops->get_expected_throughput)
-		ret = local->ops->get_expected_throughput(sta);
+		ret = local->ops->get_expected_throughput(&local->hw, sta);
 	trace_drv_return_u32(local, ret);
 
 	return ret;
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 2/2] wlcore: Remove wl pointer from wl_sta structure
  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   ` Maxim Altshul
  2016-08-04 21:31     ` John Stultz
                       ` (2 more replies)
  2016-08-04 21:31   ` [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput John Stultz
                     ` (2 subsequent siblings)
  3 siblings, 3 replies; 20+ messages in thread
From: Maxim Altshul @ 2016-08-04 12:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: john.stultz, Maxim Altshul, Kalle Valo, Eliad Peller, Yaniv Machani

No longer needed due to get_expected_throughput op change

Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>
---
 drivers/net/wireless/ti/wlcore/main.c     | 1 -
 drivers/net/wireless/ti/wlcore/wlcore_i.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 1ec3545..8589e5a 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -5043,7 +5043,6 @@ static int wl12xx_sta_add(struct wl1271 *wl,
 		return ret;
 
 	wl_sta = (struct wl1271_station *)sta->drv_priv;
-	wl_sta->wl = wl;
 	hlid = wl_sta->hlid;
 
 	ret = wl12xx_cmd_add_peer(wl, wlvif, sta, hlid);
diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h
index 3875190..8ee5206 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore_i.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h
@@ -352,7 +352,6 @@ struct wl1271_station {
 	 * Used in both AP and STA mode.
 	 */
 	u64 total_freed_pkts;
-	struct wl1271 *wl;
 };
 
 struct wl12xx_vif {
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  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-05  5:40     ` Johannes Berg
  2016-08-05 12:22   ` Johannes Berg
  2016-08-15  7:59   ` Kalle Valo
  3 siblings, 1 reply; 20+ messages in thread
From: John Stultz @ 2016-08-04 21:31 UTC (permalink / raw)
  To: Maxim Altshul
  Cc: lkml, Kalle Valo, Johannes Berg, Eliad Peller, Yaniv Machani

On Thu, Aug 4, 2016 at 5:43 AM, Maxim Altshul <maxim.altshul@ti.com> wrote:
> - The variable is added to allow the driver an easy access
> to it's own hw->priv when the op is invoked.
>
> - Change wlcore op accordingly.
>
> Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>

These two patches solve the regression I was seeing with pre-v4.8-rc1
kernels on HiKey.

Tested-by: John Stultz <john.stultz@linaro.org>

thanks
-john

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] wlcore: Remove wl pointer from wl_sta structure
  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
  2 siblings, 0 replies; 20+ messages in thread
From: John Stultz @ 2016-08-04 21:31 UTC (permalink / raw)
  To: Maxim Altshul; +Cc: lkml, Kalle Valo, Eliad Peller, Yaniv Machani

On Thu, Aug 4, 2016 at 5:43 AM, Maxim Altshul <maxim.altshul@ti.com> wrote:
> No longer needed due to get_expected_throughput op change
>
> Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>

These two patches solve the regression I was seeing with pre-v4.8-rc1
kernels on HiKey.

Tested-by: John Stultz <john.stultz@linaro.org>

thanks
-john

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  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
  0 siblings, 1 reply; 20+ messages in thread
From: Johannes Berg @ 2016-08-05  5:40 UTC (permalink / raw)
  To: John Stultz, Maxim Altshul; +Cc: lkml, Kalle Valo, Eliad Peller, Yaniv Machani

On Thu, 2016-08-04 at 14:31 -0700, John Stultz wrote:
> On Thu, Aug 4, 2016 at 5:43 AM, Maxim Altshul <maxim.altshul@ti.com>
> wrote:
> > - The variable is added to allow the driver an easy access
> > to it's own hw->priv when the op is invoked.
> > 
> > - Change wlcore op accordingly.
> > 
> > Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>
> 
> These two patches solve the regression I was seeing with pre-v4.8-rc1
> kernels on HiKey.
> 

Interesting, what was the regression? Was the station pointer there not
valid?

johannes

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  2016-08-05  5:40     ` Johannes Berg
@ 2016-08-05  6:03       ` John Stultz
  0 siblings, 0 replies; 20+ messages in thread
From: John Stultz @ 2016-08-05  6:03 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Maxim Altshul, lkml, Kalle Valo, Eliad Peller, Yaniv Machani

On Thu, Aug 4, 2016 at 10:40 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Thu, 2016-08-04 at 14:31 -0700, John Stultz wrote:
>> On Thu, Aug 4, 2016 at 5:43 AM, Maxim Altshul <maxim.altshul@ti.com>
>> wrote:
>> > - The variable is added to allow the driver an easy access
>> > to it's own hw->priv when the op is invoked.
>> >
>> > - Change wlcore op accordingly.
>> >
>> > Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>
>>
>> These two patches solve the regression I was seeing with pre-v4.8-rc1
>> kernels on HiKey.
>>
>
> Interesting, what was the regression? Was the station pointer there not
> valid?

Yea, a null pointer deference:
https://lkml.org/lkml/2016/7/27/712

thanks
-john

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  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   ` [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput John Stultz
@ 2016-08-05 12:22   ` Johannes Berg
  2016-08-05 12:24     ` Johannes Berg
  2016-08-15  7:59   ` Kalle Valo
  3 siblings, 1 reply; 20+ messages in thread
From: Johannes Berg @ 2016-08-05 12:22 UTC (permalink / raw)
  To: Maxim Altshul, linux-kernel
  Cc: john.stultz, Kalle Valo, Eliad Peller, Yaniv Machani

On Thu, 2016-08-04 at 15:43 +0300, Maxim Altshul wrote:
> - The variable is added to allow the driver an easy access
> to it's own hw->priv when the op is invoked.
> 
> - Change wlcore op accordingly.
> 
I'm applying this now, with a big BUT:

1) your changelog is crap - I've rewritten it to indicate what's going
on

2) I think the change makes sense, but as far as fixing the bug is
concerned it's actually completely stupid

3) I expect you to submit a proper bugfix for mac80211 ASAP, to not
call into the driver before the station is actually known to the
driver.

johannes

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  2016-08-05 12:22   ` Johannes Berg
@ 2016-08-05 12:24     ` Johannes Berg
  2016-08-05 13:25       ` Altshul, Maxim
  0 siblings, 1 reply; 20+ messages in thread
From: Johannes Berg @ 2016-08-05 12:24 UTC (permalink / raw)
  To: Maxim Altshul, linux-kernel
  Cc: john.stultz, Kalle Valo, Eliad Peller, Yaniv Machani

On Fri, 2016-08-05 at 14:22 +0200, Johannes Berg wrote:
> On Thu, 2016-08-04 at 15:43 +0300, Maxim Altshul wrote:
> > - The variable is added to allow the driver an easy access
> > to it's own hw->priv when the op is invoked.
> > 
> > - Change wlcore op accordingly.
> > 
> I'm applying this now, with a big BUT:
> 
> 1) your changelog is crap - I've rewritten it to indicate what's
> going
> on
> 
> 2) I think the change makes sense, but as far as fixing the bug is
> concerned it's actually completely stupid
> 
> 3) I expect you to submit a proper bugfix for mac80211 ASAP, to not
> call into the driver before the station is actually known to the
> driver.

4) please indent your code properly when submitting...

johannes

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  2016-08-05 12:24     ` Johannes Berg
@ 2016-08-05 13:25       ` Altshul, Maxim
  2016-08-05 15:34         ` Johannes Berg
  0 siblings, 1 reply; 20+ messages in thread
From: Altshul, Maxim @ 2016-08-05 13:25 UTC (permalink / raw)
  To: Johannes Berg, linux-kernel
  Cc: john.stultz, Kalle Valo, Eliad Peller, Machani, Yaniv

Hi,
1) Sorry about the change log, I will try to be clearer next time.

2+3) The issue is not that the station is not known, it's that wl_sta->wl was null. 
wl member is now completely removed from wl_sta (PATCH 2/2) and hw is sent directly from mac80211 to the driver (so it can get hw->priv).

4) Sorry, I just saw now that everything has a space before the line. I used checkpatch.pl and it was ok. I will be more careful next time.

BR,
Max
________________________________________
From: Johannes Berg [johannes@sipsolutions.net]
Sent: Friday, August 05, 2016 3:24 PM
To: Altshul, Maxim; linux-kernel@vger.kernel.org
Cc: john.stultz@linaro.org; Kalle Valo; Eliad Peller; Machani, Yaniv
Subject: Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput

On Fri, 2016-08-05 at 14:22 +0200, Johannes Berg wrote:
> On Thu, 2016-08-04 at 15:43 +0300, Maxim Altshul wrote:
> > - The variable is added to allow the driver an easy access
> > to it's own hw->priv when the op is invoked.
> >
> > - Change wlcore op accordingly.
> >
> I'm applying this now, with a big BUT:
>
> 1) your changelog is crap - I've rewritten it to indicate what's
> going
> on
>
> 2) I think the change makes sense, but as far as fixing the bug is
> concerned it's actually completely stupid
>
> 3) I expect you to submit a proper bugfix for mac80211 ASAP, to not
> call into the driver before the station is actually known to the
> driver.

4) please indent your code properly when submitting...

johannes

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  2016-08-05 13:25       ` Altshul, Maxim
@ 2016-08-05 15:34         ` Johannes Berg
  2016-08-07 13:42           ` Altshul, Maxim
  0 siblings, 1 reply; 20+ messages in thread
From: Johannes Berg @ 2016-08-05 15:34 UTC (permalink / raw)
  To: Altshul, Maxim, linux-kernel
  Cc: john.stultz, Kalle Valo, Eliad Peller, Machani, Yaniv

On Fri, 2016-08-05 at 13:25 +0000, Altshul, Maxim wrote:
> Hi,
> 1) Sorry about the change log, I will try to be clearer next time.

Just mention something about how the bug happens please, at least.

> 2+3) The issue is not that the station is not known, it's that
> wl_sta->wl was null. 
> wl member is now completely removed from wl_sta (PATCH 2/2) and hw is
> sent directly from mac80211 to the driver (so it can get hw->priv).

Right, I understand that wl_sta->wl was NULL. But the driver must have
some code to assign wl_sta->wl, right? And that would be called in
add_sta or sta_state. Thus the reason for the crash would be that the
station wasn't actually known to the driver yet.

Even if that wasn't quite the reason here, I think we need to take it
into account and check sta->uploaded before calling the driver, so I'd
like you to submit a patch for that.

johannes

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  2016-08-05 15:34         ` Johannes Berg
@ 2016-08-07 13:42           ` Altshul, Maxim
  2016-08-08  6:10             ` Johannes Berg
  0 siblings, 1 reply; 20+ messages in thread
From: Altshul, Maxim @ 2016-08-07 13:42 UTC (permalink / raw)
  To: Johannes Berg, linux-kernel
  Cc: john.stultz, Kalle Valo, Eliad Peller, Machani, Yaniv

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.
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. 
c. Even so, wl_sta itself was not NULL at any point.
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.
 
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.

Please tell me how to proceed. If you still think that a patch is needed, I will send it right away!

Max


-----Original Message-----
From: Johannes Berg [mailto:johannes@sipsolutions.net] 
Sent: Friday, August 05, 2016 6:34 PM
To: Altshul, Maxim; linux-kernel@vger.kernel.org
Cc: john.stultz@linaro.org; Kalle Valo; Eliad Peller; Machani, Yaniv
Subject: Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput

On Fri, 2016-08-05 at 13:25 +0000, Altshul, Maxim wrote:
> Hi,
> 1) Sorry about the change log, I will try to be clearer next time.

Just mention something about how the bug happens please, at least.

> 2+3) The issue is not that the station is not known, it's that
> wl_sta->wl was null.
> wl member is now completely removed from wl_sta (PATCH 2/2) and hw is 
> sent directly from mac80211 to the driver (so it can get hw->priv).

Right, I understand that wl_sta->wl was NULL. But the driver must have some code to assign wl_sta->wl, right? And that would be called in add_sta or sta_state. Thus the reason for the crash would be that the station wasn't actually known to the driver yet.

Even if that wasn't quite the reason here, I think we need to take it into account and check sta->uploaded before calling the driver, so I'd like you to submit a patch for that.

johannes

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  2016-08-07 13:42           ` Altshul, Maxim
@ 2016-08-08  6:10             ` Johannes Berg
  2016-08-08 10:42               ` Altshul, Maxim
  0 siblings, 1 reply; 20+ messages in thread
From: Johannes Berg @ 2016-08-08  6:10 UTC (permalink / raw)
  To: Altshul, Maxim, linux-kernel
  Cc: john.stultz, Kalle Valo, Eliad Peller, Machani, Yaniv

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  2016-08-08  6:10             ` Johannes Berg
@ 2016-08-08 10:42               ` Altshul, Maxim
  2016-08-09  7:58                 ` Johannes Berg
  0 siblings, 1 reply; 20+ messages in thread
From: Altshul, Maxim @ 2016-08-08 10:42 UTC (permalink / raw)
  To: Johannes Berg, linux-kernel
  Cc: john.stultz, Kalle Valo, Eliad Peller, Machani, Yaniv

Yes, exactly! Should I send the patch then so that we protect get_expected_throughput?

If so, then please have a look at my previous mesh patch (not yet applied) "[PATCH v3] mac80211: mesh: Add support for HW RC implementation".

If you approve the mesh patch, then I will send two patches:
1. Check for sta->uploaded in the drv wrapper (will change the drv wrapper header to get sta_info)
2. v4 for the mesh patch with respect to header change in patch 1.

Max

-----Original Message-----
From: Johannes Berg [mailto:johannes@sipsolutions.net] 
Sent: Monday, August 08, 2016 9:11 AM
To: Altshul, Maxim; linux-kernel@vger.kernel.org
Cc: john.stultz@linaro.org; Kalle Valo; Eliad Peller; Machani, Yaniv
Subject: Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  2016-08-08 10:42               ` Altshul, Maxim
@ 2016-08-09  7:58                 ` Johannes Berg
  2016-08-10  8:03                   ` Altshul, Maxim
  0 siblings, 1 reply; 20+ messages in thread
From: Johannes Berg @ 2016-08-09  7:58 UTC (permalink / raw)
  To: Altshul, Maxim, linux-kernel
  Cc: john.stultz, Kalle Valo, Eliad Peller, Machani, Yaniv

On Mon, 2016-08-08 at 10:42 +0000, Altshul, Maxim wrote:
> Yes, exactly! Should I send the patch then so that we protect
> get_expected_throughput?

Yes please.

> If so, then please have a look at my previous mesh patch (not yet
> applied) "[PATCH v3] mac80211: mesh: Add support for HW RC
> implementation".

Looks ok, I just haven't applied it because net-next was closed until
today :)

> If you approve the mesh patch, then I will send two patches:
> 1. Check for sta->uploaded in the drv wrapper (will change the drv
> wrapper header to get sta_info)
> 2. v4 for the mesh patch with respect to header change in patch 1.

I don't think adding the check changes anything wrt. the mesh patch?

johannes

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  2016-08-09  7:58                 ` Johannes Berg
@ 2016-08-10  8:03                   ` Altshul, Maxim
  0 siblings, 0 replies; 20+ messages in thread
From: Altshul, Maxim @ 2016-08-10  8:03 UTC (permalink / raw)
  To: Johannes Berg, linux-kernel
  Cc: john.stultz, Kalle Valo, Eliad Peller, Machani, Yaniv

On Tue, Aug 09, 2016 at 10:58:30, Johannes Berg wrote:
> Subject: Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to 
> get_expected_throughput
> > 
> > If you approve the mesh patch, then I will send two patches:
> > 1. Check for sta->uploaded in the drv wrapper (will change the drv 
> > wrapper header to get sta_info) 2. v4 for the mesh patch with 
> > respect to header change in patch 1.
> 
> I don't think adding the check changes anything wrt. the mesh patch?
> 

I thought about changing the header of drv_get_expected_throughput to receive sta_info *sta so that I can get sta->uploaded from that.
I could use get container of &sta->sta to get sta->uploaded, but I think it's better to get the pointer directly?

Max

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] wlcore: Remove wl pointer from wl_sta structure
  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
  2 siblings, 0 replies; 20+ messages in thread
From: Kalle Valo @ 2016-08-15  7:56 UTC (permalink / raw)
  To: Maxim Altshul
  Cc: linux-kernel, john.stultz, Eliad Peller, Yaniv Machani, linux-wireless

Maxim Altshul <maxim.altshul@ti.com> writes:

> No longer needed due to get_expected_throughput op change
>
> Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>

The commit log is very vague, please improve it. But most importantly
you did not CC linux-wireless (adding it now) so lots of wireless people
missed this patch. Please resend.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] wlcore: Remove wl pointer from wl_sta structure
  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
  2 siblings, 0 replies; 20+ messages in thread
From: Kalle Valo @ 2016-08-15  7:56 UTC (permalink / raw)
  To: Maxim Altshul
  Cc: linux-kernel, john.stultz, Eliad Peller, Yaniv Machani, linux-wireless

Maxim Altshul <maxim.altshul@ti.com> writes:

> No longer needed due to get_expected_throughput op change
>
> Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>

The commit log is very vague, please improve it. But most importantly
you did not CC linux-wireless (adding it now) so lots of wireless people
missed this patch. Please resend.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  2016-08-04 12:43 ` [PATCH 1/2] mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput Maxim Altshul
                     ` (2 preceding siblings ...)
  2016-08-05 12:22   ` Johannes Berg
@ 2016-08-15  7:59   ` Kalle Valo
  3 siblings, 0 replies; 20+ messages in thread
From: Kalle Valo @ 2016-08-15  7:59 UTC (permalink / raw)
  To: Maxim Altshul
  Cc: linux-kernel, john.stultz, Johannes Berg, Eliad Peller,
	Yaniv Machani, linux-wireless

Maxim Altshul <maxim.altshul@ti.com> writes:

> - The variable is added to allow the driver an easy access
> to it's own hw->priv when the op is invoked.
>
> - Change wlcore op accordingly.
>
> Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>

You didn't CC linux-wireless, adding it now. Others can find the full
discussion here:

http://lkml.kernel.org/g/20160804124314.7636-2-maxim.altshul@ti.com

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 0/2] get_expected_throughput interface update
@ 2016-08-04 12:48 Maxim Altshul
  0 siblings, 0 replies; 20+ messages in thread
From: Maxim Altshul @ 2016-08-04 12:48 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, kvalo, Maxim Altshul

These two patches are two important patches (mainly 1/2)
that solve a regression issue that was found in wlcore
(where wl was found to be null in some cases)

Also, they make it easier for driver to get hw->priv when op is invoked. 


Maxim Altshul (2):
  mac80211/wlcore: Add ieee80211_hw variable to get_expected_throughput
  wlcore: Remove wl pointer from wl_sta structure

 drivers/net/wireless/ti/wlcore/main.c     | 6 +++---
 drivers/net/wireless/ti/wlcore/wlcore_i.h | 1 -
 include/net/mac80211.h                    | 3 ++-
 net/mac80211/driver-ops.h                 | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.9.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2016-08-15  7:59 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
2016-08-04 12:48 [PATCH 0/2] get_expected_throughput interface update Maxim Altshul

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.