diff mbox

[v4] mac80211: keep sending peer candidate events while in listen state

Message ID 2EB4F5C65A3B8E4E92660930F4EF6B5B06C981@JPYOKXMS113.jp.sony.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Nishikawa, Kenzoh Nov. 21, 2014, 11:24 a.m. UTC
Instead of sending peer candidate events just once, send them 
as long as the peer remains in the LISTEN state in the peering 
state machine, when userspace is implementing the peering manager.
Userspace may silence the events from a peer by progressing 
the state machine or by setting the link state to BLOCKED.

Fixes the problem that a mesh peering process won't be fired 
again after the previous first peering trial fails due to 
like air propagation error if the peering is managed by 
user space such as wpa_supplicant.

This patch works with another patch for wpa_supplicant described 
here which fires a peering process again triggered by the notice 
from kernel.
http://lists.shmoo.com/pipermail/hostap/2014-November/031235.html

Signed-off-by: Kenzoh Nishikawa <Kenzoh.Nishikawa at jp.sony.com>
---
net/mac80211/mesh_plink.c |    7 +++++++
1 file changed, 7 insertions(+)


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Johannes Berg Dec. 12, 2014, 11:41 a.m. UTC | #1
On Fri, 2014-11-21 at 11:24 +0000, Nishikawa, Kenzoh wrote:
> Instead of sending peer candidate events just once, send them 
> as long as the peer remains in the LISTEN state in the peering 
> state machine, when userspace is implementing the peering manager.
> Userspace may silence the events from a peer by progressing 
> the state machine or by setting the link state to BLOCKED.
> 
> Fixes the problem that a mesh peering process won't be fired 
> again after the previous first peering trial fails due to 
> like air propagation error if the peering is managed by 
> user space such as wpa_supplicant.
> 
> This patch works with another patch for wpa_supplicant described 
> here which fires a peering process again triggered by the notice 
> from kernel.
> http://lists.shmoo.com/pipermail/hostap/2014-November/031235.html

Can any of the mesh folks comment on this?

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bob Copeland Dec. 12, 2014, 4:47 p.m. UTC | #2
On Fri, Dec 12, 2014 at 12:41:30PM +0100, Johannes Berg wrote:
> On Fri, 2014-11-21 at 11:24 +0000, Nishikawa, Kenzoh wrote:
> > Instead of sending peer candidate events just once, send them 
> > as long as the peer remains in the LISTEN state in the peering 
> > state machine, when userspace is implementing the peering manager.
> > Userspace may silence the events from a peer by progressing 
> > the state machine or by setting the link state to BLOCKED.
> > 
> > Fixes the problem that a mesh peering process won't be fired 
> > again after the previous first peering trial fails due to 
> > like air propagation error if the peering is managed by 
> > user space such as wpa_supplicant.
> > 
> > This patch works with another patch for wpa_supplicant described 
> > here which fires a peering process again triggered by the notice 
> > from kernel.
> > http://lists.shmoo.com/pipermail/hostap/2014-November/031235.html
> 
> Can any of the mesh folks comment on this?

I think it's fine.  It's not strictly necessary: userspace could
run its own timers to restart peering with any unpeered candidates
periodically, but doing it based on beacon arrival is a little better
since it indicates the peer is still alive, and this is also exactly
how the in-kernel MPM operates.
Nishikawa, Kenzoh Dec. 14, 2014, 2:18 a.m. UTC | #3
SGkgSm9oYW5uZXMsDQoNCkkgY2hhbmdlZCB0aGUgcGF0Y2ggdGl0bGUgZnJvbSBWMy4gVGhlIHBy
ZXZpb3VzIHBhdGNoIHRpdGxlIHdhcyANCiJtYWM4MDIxMTogU2VuZCBwZWVyaW5nIG9wZW4gZnJh
bWUgYWdhaW4gaWYgYmVhY29uIGZyb20gbGlzdGVuIHN0YXRlIHBlZXIgaXMgcmVjZWl2ZWQiLg0K
DQpUaGUgY29tbWVudHMgZnJvbSB0aGUgbWVzaCBmb3JrcyBhcmUgYXMgZm9sbG93cy4NCmh0dHA6
Ly9tYXJjLmluZm8vP2w9bGludXgtd2lyZWxlc3MmbT0xNDE1OTAzMDkyMDg2NjImdz0yDQpodHRw
Oi8vbWFyYy5pbmZvLz9sPWxpbnV4LXdpcmVsZXNzJm09MTQxNjIzMTQ2MDAzMzQxJnc9Mg0KDQoN
Ci0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQpGc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dvbid0IGJlIGZpcmVkIGFnYWluIA0KPiBhZnRlciB0aGUg
cHJldmlvdXMgZmlyc3QgcGVlcmluZyB0cmlhbCBmYWlscyBkdWUgdG8gbGlrZSBhaXIgDQo+IHBy
b3BhZ2F0aW9uIGVycm9yIGlmIHRoZSBwZWVyaW5nIGlzIG1hbmFnZWQgYnkgdXNlciBzcGFjZSBz
dWNoIGFzIA0KPiB3cGFfc3VwcGxpY2FudC4NCj4gDQo+IFRoaXMgcGF0Y2ggd29ya3Mgd2l0aCBh
bm90aGVyIHBhdGNoIGZvciB3cGFfc3VwcGxpY2FudCBkZXNjcmliZWQgaGVyZSANCj4gd2hpY2gg
ZmlyZXMgYSBwZWVyaW5nIHByb2Nlc3MgYWdhaW4gdHJpZ2dlcmVkIGJ5IHRoZSBub3RpY2UgZnJv
bSANCj4ga2VybmVsLg0KPiBodHRwOi8vbGlzdHMuc2htb28uY29tL3BpcGVybWFpbC9ob3N0YXAv
MjAxNC1Ob3ZlbWJlci8wMzEyMzUuaHRtbA0KDQpDYW4gYW55IG9mIHRoZSBtZXNoIGZvbGtzIGNv
bW1lbnQgb24gdGhpcz8NCg0Kam9oYW5uZXMNCg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Johannes Berg Dec. 15, 2014, 12:39 p.m. UTC | #4
On Fri, 2014-12-12 at 11:47 -0500, Bob Copeland (me@bobcopeland.com)
wrote:
> On Fri, Dec 12, 2014 at 12:41:30PM +0100, Johannes Berg wrote:
> > On Fri, 2014-11-21 at 11:24 +0000, Nishikawa, Kenzoh wrote:
> > > Instead of sending peer candidate events just once, send them 
> > > as long as the peer remains in the LISTEN state in the peering 
> > > state machine, when userspace is implementing the peering manager.
> > > Userspace may silence the events from a peer by progressing 
> > > the state machine or by setting the link state to BLOCKED.
> > > 
> > > Fixes the problem that a mesh peering process won't be fired 
> > > again after the previous first peering trial fails due to 
> > > like air propagation error if the peering is managed by 
> > > user space such as wpa_supplicant.
> > > 
> > > This patch works with another patch for wpa_supplicant described 
> > > here which fires a peering process again triggered by the notice 
> > > from kernel.
> > > http://lists.shmoo.com/pipermail/hostap/2014-November/031235.html
> > 
> > Can any of the mesh folks comment on this?
> 
> I think it's fine.  It's not strictly necessary: userspace could
> run its own timers to restart peering with any unpeered candidates
> periodically, but doing it based on beacon arrival is a little better
> since it indicates the peer is still alive, and this is also exactly
> how the in-kernel MPM operates.

Great, thanks.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Johannes Berg Dec. 15, 2014, 12:40 p.m. UTC | #5
On Fri, 2014-11-21 at 11:24 +0000, Nishikawa, Kenzoh wrote:

> +		cfg80211_notify_new_peer_candidate(sdata->dev, hw_addr,
> +							   elems->ie_start,
> +							   elems->total_len,
> +							   GFP_ATOMIC);

Please indent properly (to align after the opening parenthesis)

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 32c7bd0..dfc429b 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -524,6 +524,13 @@  void mesh_neighbour_update(struct ieee80211_sub_if_data *sdata,
 	    sdata->u.mesh.mshcfg.auto_open_plinks &&
 	    rssi_threshold_check(sta, sdata))
 		changed = mesh_plink_open(sta);
+	else if (sta->plink_state == NL80211_PLINK_LISTEN &&
+		 (sdata->u.mesh.user_mpm ||
+		  sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED))
+		cfg80211_notify_new_peer_candidate(sdata->dev, hw_addr,
+							   elems->ie_start,
+							   elems->total_len,
+							   GFP_ATOMIC);
 
 	ieee80211_mps_frame_release(sta, elems);
 out: