mac80211: mesh - always do every discovery retry
Subsystems (2)
PATCH v2 1/1 mac80211: mesh - always do every discovery retry
Changes since v1: Make this behavior optional and configurable via
netlink.
Instead of stopping path discovery when a path is found continue attempting to find paths until we hit the dot11MeshHWMPmaxPREQretries limit.
This is important because path messages are not reliable and it is relatively common to have a short bad path to the destination along with a longer but better path. With the original code rather often a path message along the long path would be lost so we would stick with the bad path. With this change we have a greater chance to get messages over the longer path allowing us to select the long path if it's better.
The standard doesn't seem to address this issue. All it says (13.10.8.5) is that discovery should be limited to dot11MeshHWMPmaxPREQretries.
--- include/net/cfg80211.h | 3 ++ include/uapi/linux/nl80211.h | 3 ++ net/mac80211/cfg.c | 2 ++ net/mac80211/debugfs_netdev.c | 3 ++ net/mac80211/mesh_hwmp.c | 65 +++++++++++++++++++++++++++++-------------- net/wireless/mesh.c | 1 + net/wireless/nl80211.c | 8 +++++- net/wireless/trace.h | 5 +++- 8 files changed, 67 insertions(+), 23 deletions(-)
include/net/cfg80211.h +3 -0
@@ -1382,6 +1382,8 @@ struct bss_parameters {* @plink_timeout: If no tx activity is seen from a STA we've established * peering with for longer than this time (in seconds), then remove it * from the STA's list of peers. Default is 30 minutes. +* @always_max_discoveries: whether to always perform number of discovery +* attemts equal to dot11MeshHWMPmaxPREQretries */ struct mesh_config {u16 dot11MeshRetryTimeout;
@@ -1412,6 +1414,7 @@ struct mesh_config {enum nl80211_mesh_power_mode power_mode;u16 dot11MeshAwakeWindowDuration;u32 plink_timeout; +bool always_max_discoveries; };/**
include/uapi/linux/nl80211.h +3 -0
@@ -3449,6 +3449,8 @@ enum nl80211_mesh_power_mode {* established peering with for longer than this time (in seconds), then * remove it from the STA's list of peers. You may set this to 0 to disable * the removal of the STA. Default is 30 minutes. +* @NL80211_MESHCONF_HWMP_ALWAYS_MAX_DISCOVERIES: whether to always perform +* number of discovery attempts equal to MaxPREQretries (default is FALSE) * * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use */
@@ -3482,6 +3484,7 @@ enum nl80211_meshconf_params {NL80211_MESHCONF_POWER_MODE ,NL80211_MESHCONF_AWAKE_WINDOW ,NL80211_MESHCONF_PLINK_TIMEOUT , +NL80211_MESHCONF_HWMP_ALWAYS_MAX_DISCOVERIES ,/* keep last */ __NL80211_MESHCONF_ATTR_AFTER_LAST,
net/mac80211/cfg.c +2 -0
@@ -1956,6 +1956,8 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy, nconf->dot11MeshAwakeWindowDuration;if (_chg_mesh_attr (NL80211_MESHCONF_PLINK_TIMEOUT , mask)) conf->plink_timeout = nconf->plink_timeout; +if (_chg_mesh_attr (NL80211_MESHCONF_HWMP_ALWAYS_MAX_DISCOVERIES , mask)) + conf->always_max_discoveries = nconf->always_max_discoveries;ieee80211_mbss_info_change_notify (sdata,BSS_CHANGED_BEACON );return 0 ; }
net/mac80211/debugfs_netdev.c +3 -0
@@ -642,6 +642,8 @@ IEEE80211_IF_FILE(dot11MeshHWMPconfirmationInterval,IEEE80211_IF_FILE (power_mode, u.mesh.mshcfg.power_mode,DEC );IEEE80211_IF_FILE (dot11MeshAwakeWindowDuration, u.mesh.mshcfg.dot11MeshAwakeWindowDuration,DEC ); +IEEE80211_IF_FILE (always_max_discoveries, + u.mesh.mshcfg.always_max_discoveries,DEC );#endif #define DEBUGFS_ADD_MODE (name, mode) \
@@ -763,6 +765,7 @@ static void add_mesh_config(struct ieee80211_sub_if_data *sdata)MESHPARAMS_ADD (dot11MeshHWMPconfirmationInterval);MESHPARAMS_ADD (power_mode);MESHPARAMS_ADD (dot11MeshAwakeWindowDuration); +MESHPARAMS_ADD (always_max_discoveries);#undef MESHPARAMS_ADD }#endif
net/mac80211/mesh_hwmp.c +44 -21
78 lines not on this page · raw message
net/wireless/mesh.c +1 -0
@@ -77,6 +77,7 @@ const struct mesh_config default_mesh_config = { .power_mode = NL80211_MESH_POWER_ACTIVE, .dot11MeshAwakeWindowDuration = MESH_DEFAULT_AWAKE_WINDOW, .plink_timeout = MESH_DEFAULT_PLINK_TIMEOUT, + .always_max_discoveries = false, };const struct mesh_setup default_mesh_setup = {
net/wireless/nl80211.c +7 -1
@@ -5729,7 +5729,9 @@ static int nl80211_get_mesh_config(struct sk_buff *skb,nla_put_u16 (msg,NL80211_MESHCONF_AWAKE_WINDOW , cur_params.dot11MeshAwakeWindowDuration) ||nla_put_u32 (msg,NL80211_MESHCONF_PLINK_TIMEOUT , - cur_params.plink_timeout)) + cur_params.plink_timeout) || +nla_put_u8 (msg,NL80211_MESHCONF_HWMP_ALWAYS_MAX_DISCOVERIES , + cur_params.always_max_discoveries)) goto nla_put_failure;nla_nest_end (msg, pinfoattr);genlmsg_end (msg, hdr);
@@ -5771,6 +5773,7 @@ static const struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_A [NL80211_MESHCONF_POWER_MODE] = { .type = NLA_U32 }, [NL80211_MESHCONF_AWAKE_WINDOW] = { .type = NLA_U16 }, [NL80211_MESHCONF_PLINK_TIMEOUT] = { .type = NLA_U32 }, + [NL80211_MESHCONF_HWMP_ALWAYS_MAX_DISCOVERIES] = { .type = NLA_U8 }, }; static const struct nla_policy
@@ -5995,6 +5998,9 @@ do { \FILL_IN_MESH_PARAM_IF_SET (tb, cfg, plink_timeout,0 ,0xffffffff , mask,NL80211_MESHCONF_PLINK_TIMEOUT , nl80211_check_u32); +FILL_IN_MESH_PARAM_IF_SET (tb, cfg, always_max_discoveries,0 ,1 , mask, +NL80211_MESHCONF_HWMP_ALWAYS_MAX_DISCOVERIES , + nl80211_check_bool);if (mask_out) *mask_out = mask;
net/wireless/trace.h +4 -1
@@ -67,7 +67,8 @@ __field(u16, ht_opmode) \ __field(u32, dot11MeshHWMPactivePathToRootTimeout) \ __field(u16, dot11MeshHWMProotInterval) \ - __field(u16, dot11MeshHWMPconfirmationInterval) + __field(u16, dot11MeshHWMPconfirmationInterval) \ + __field(bool, always_max_discoveries)#define MESH_CFG_ASSIGN \ do { \ __entry->dot11MeshRetryTimeout = conf->dot11MeshRetryTimeout; \
@@ -108,6 +109,8 @@ conf->dot11MeshHWMProotInterval; \ __entry->dot11MeshHWMPconfirmationInterval = \ conf->dot11MeshHWMPconfirmationInterval; \ + __entry->always_max_discoveries = \ + conf->always_max_discoveries; \ } while (0)#define CHAN_ENTRY __field(enum nl80211_band, band) \