* [PATCH v2 1/2] nl80211: Add support to configure low ack threshold
@ 2015-05-28 6:25 Rajkumar Manoharan
2015-05-28 6:25 ` [PATCH v2 2/2] mac80211: store low ack threshold in bss config Rajkumar Manoharan
2015-05-28 13:19 ` [PATCH v2 1/2] nl80211: Add support to configure low ack threshold Johannes Berg
0 siblings, 2 replies; 3+ messages in thread
From: Rajkumar Manoharan @ 2015-05-28 6:25 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Rajkumar Manoharan
Add a new nl80211 attribute to configure low ack threshold (number of
consecutive frames) not being acked by station. This threshold is used
to kickout station by driver through low ack event. This allows user to
tune the parameter to improve robustness under noisy environment.
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
---
include/net/cfg80211.h | 3 +++
include/uapi/linux/nl80211.h | 9 +++++++++
net/wireless/nl80211.c | 13 +++++++++++++
3 files changed, 25 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index f8d6813..4e42b09 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -812,6 +812,8 @@ enum station_parameters_apply_mask {
* @supported_oper_classes_len: number of supported operating classes
* @opmode_notif: operating mode field from Operating Mode Notification
* @opmode_notif_used: information if operating mode field is used
+ * @low_ack_threshold: number of consecutive frames not being ACKed by
+ * station, used to trigger low_ack event.
*/
struct station_parameters {
const u8 *supported_rates;
@@ -837,6 +839,7 @@ struct station_parameters {
u8 supported_oper_classes_len;
u8 opmode_notif;
bool opmode_notif_used;
+ u16 low_ack_threshold;
};
/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 241220c..9ab3b01 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1761,6 +1761,10 @@ enum nl80211_commands {
* @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device
* is operating in an indoor environment.
*
+ * @NL80211_ATTR_STA_LOW_ACK_THRESH: number of consecutive frames that are not
+ * ACKed by station. This threshold is used to generate low ack event
+ * by driver.
+ *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2130,6 +2134,8 @@ enum nl80211_attrs {
NL80211_ATTR_REG_INDOOR,
+ NL80211_ATTR_STA_LOW_ACK_THRESH,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -4585,4 +4591,7 @@ enum nl80211_tdls_peer_capability {
NL80211_TDLS_PEER_WMM = 1<<2,
};
+/* Default low ack threshold for station kickout event */
+#define NL80211_DEFAULT_LOW_ACK_THRESH 50
+
#endif /* __LINUX_NL80211_H */
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index dd78445..9ca2c18 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -400,6 +400,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
[NL80211_ATTR_NETNS_FD] = { .type = NLA_U32 },
[NL80211_ATTR_SCHED_SCAN_DELAY] = { .type = NLA_U32 },
[NL80211_ATTR_REG_INDOOR] = { .type = NLA_FLAG },
+ [NL80211_ATTR_STA_LOW_ACK_THRESH] = { .type = NLA_U16 },
};
/* policy for the key attributes */
@@ -4281,6 +4282,12 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
params.local_pm = pm;
}
+ if (info->attrs[NL80211_ATTR_STA_LOW_ACK_THRESH])
+ params.low_ack_threshold = nla_get_u16(
+ info->attrs[NL80211_ATTR_STA_LOW_ACK_THRESH]);
+ else
+ params.low_ack_threshold = NL80211_DEFAULT_LOW_ACK_THRESH;
+
/* Include parameters for TDLS peer (will check later) */
err = nl80211_set_station_tdls(info, ¶ms);
if (err)
@@ -4389,6 +4396,12 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
return -EINVAL;
}
+ if (info->attrs[NL80211_ATTR_STA_LOW_ACK_THRESH])
+ params.low_ack_threshold = nla_get_u16(
+ info->attrs[NL80211_ATTR_STA_LOW_ACK_THRESH]);
+ else
+ params.low_ack_threshold = NL80211_DEFAULT_LOW_ACK_THRESH;
+
err = nl80211_parse_sta_channel_info(info, ¶ms);
if (err)
return err;
--
2.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] mac80211: store low ack threshold in bss config
2015-05-28 6:25 [PATCH v2 1/2] nl80211: Add support to configure low ack threshold Rajkumar Manoharan
@ 2015-05-28 6:25 ` Rajkumar Manoharan
2015-05-28 13:19 ` [PATCH v2 1/2] nl80211: Add support to configure low ack threshold Johannes Berg
1 sibling, 0 replies; 3+ messages in thread
From: Rajkumar Manoharan @ 2015-05-28 6:25 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Rajkumar Manoharan
Store the low ack threshold configured by user in BSS config.
This will be used by driver for triggering low ack event whenever
the station is not ACKing the number of frames mentioned in
threshold.
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
---
net/mac80211/cfg.c | 1 +
net/mac80211/sta_info.h | 3 +++
net/mac80211/status.c | 4 ++--
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index ff347a0..be0e310 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1145,6 +1145,7 @@ static int sta_apply_parameters(struct ieee80211_local *local,
params->opmode_notif,
band, false);
}
+ sta->low_ack_threshold = params->low_ack_threshold;
if (ieee80211_vif_is_mesh(&sdata->vif)) {
#ifdef CONFIG_MAC80211_MESH
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 5c164fb..ab6af72 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -338,6 +338,8 @@ struct sta_ampdu_mlme {
* using IEEE80211_NUM_TID entry for non-QoS frames
* @rx_msdu: MSDUs received from this station, using IEEE80211_NUM_TID
* entry for non-QoS frames
+ * @low_ack_threshold: Number of consecutive packet loss to trigger low ack
+ * event by driver.
*/
struct sta_info {
/* General information, mostly static */
@@ -459,6 +461,7 @@ struct sta_info {
unsigned long last_tdls_pkt_time;
u8 reserved_tid;
+ u16 low_ack_threshold;
/* keep last! */
struct ieee80211_sta sta;
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 005fdbe..f78f8f1 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -520,7 +520,6 @@ static void ieee80211_report_used_skb(struct ieee80211_local *local,
* - on # of retransmissions
* - current throughput (higher value for higher tpt)?
*/
-#define STA_LOST_PKT_THRESHOLD 50
#define STA_LOST_TDLS_PKT_THRESHOLD 10
#define STA_LOST_TDLS_PKT_TIME (10*HZ) /* 10secs since last ACK */
@@ -533,7 +532,8 @@ static void ieee80211_lost_packet(struct sta_info *sta,
return;
sta->lost_packets++;
- if (!sta->sta.tdls && sta->lost_packets < STA_LOST_PKT_THRESHOLD)
+ if (!sta->sta.tdls &&
+ sta->lost_packets < sta->low_ack_threshold)
return;
/*
--
2.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/2] nl80211: Add support to configure low ack threshold
2015-05-28 6:25 [PATCH v2 1/2] nl80211: Add support to configure low ack threshold Rajkumar Manoharan
2015-05-28 6:25 ` [PATCH v2 2/2] mac80211: store low ack threshold in bss config Rajkumar Manoharan
@ 2015-05-28 13:19 ` Johannes Berg
1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2015-05-28 13:19 UTC (permalink / raw)
To: Rajkumar Manoharan; +Cc: linux-wireless
On Thu, 2015-05-28 at 11:55 +0530, Rajkumar Manoharan wrote:
> @@ -837,6 +839,7 @@ struct station_parameters {
> u8 supported_oper_classes_len;
> u8 opmode_notif;
> bool opmode_notif_used;
> + u16 low_ack_threshold;
This cannot work, it leaves no way to detect "no change"; you need to
add that, document it and also implement it in the mac80211 patch.
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-28 13:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-28 6:25 [PATCH v2 1/2] nl80211: Add support to configure low ack threshold Rajkumar Manoharan
2015-05-28 6:25 ` [PATCH v2 2/2] mac80211: store low ack threshold in bss config Rajkumar Manoharan
2015-05-28 13:19 ` [PATCH v2 1/2] nl80211: Add support to configure low ack threshold Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).