linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] nl80211: Add support to configure low ack threshold
@ 2015-05-14 10:47 Rajkumar Manoharan
  2015-05-14 10:47 ` [PATCH 2/2] mac80211: store low ack threshold in bss config Rajkumar Manoharan
  2015-05-19  7:29 ` [PATCH 1/2] nl80211: Add support to configure low ack threshold Johannes Berg
  0 siblings, 2 replies; 4+ messages in thread
From: Rajkumar Manoharan @ 2015-05-14 10:47 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 | 11 ++++++++++-
 net/wireless/nl80211.c       |  7 +++++++
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index f8d6813..ae55d20 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -711,6 +711,8 @@ struct cfg80211_acl_data {
  * @p2p_opp_ps: P2P opportunistic PS
  * @acl: ACL configuration used by the drivers which has support for
  *	MAC address based access control
+ * @low_ack_threshold: number of consecutive frames not being ACKed by
+ *	station, used to trigger low_ack event.
  */
 struct cfg80211_ap_settings {
 	struct cfg80211_chan_def chandef;
@@ -729,6 +731,7 @@ struct cfg80211_ap_settings {
 	u8 p2p_ctwindow;
 	bool p2p_opp_ps;
 	const struct cfg80211_acl_data *acl;
+	u16 low_ack_threshold;
 };
 
 /**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 241220c..0986a98 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -232,7 +232,8 @@
  *	%NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
  *	%NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
  *	%NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT,
- *	%NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS.
+ *	%NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS
+ *	%NL80211_ATTR_LOW_ACK_THRESH.
  *	The channel to use can be set on the interface or be given using the
  *	%NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width.
  * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
@@ -1761,6 +1762,9 @@ enum nl80211_commands {
  * @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device
  *      is operating in an indoor environment.
  *
+ * @NL80211_ATTR_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_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..7e7f96f 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_LOW_ACK_THRESH] = { .type = NLA_U16 },
 };
 
 /* policy for the key attributes */
@@ -3436,6 +3437,12 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
 		params.smps_mode = NL80211_SMPS_OFF;
 	}
 
+	if (info->attrs[NL80211_ATTR_LOW_ACK_THRESH])
+		params.low_ack_threshold = nla_get_u16(
+			info->attrs[NL80211_ATTR_LOW_ACK_THRESH]);
+	else
+		params.low_ack_threshold = NL80211_DEFAULT_LOW_ACK_THRESH;
+
 	wdev_lock(wdev);
 	err = rdev_start_ap(rdev, dev, &params);
 	if (!err) {
-- 
2.4.0


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

* [PATCH 2/2] mac80211: store low ack threshold in bss config
  2015-05-14 10:47 [PATCH 1/2] nl80211: Add support to configure low ack threshold Rajkumar Manoharan
@ 2015-05-14 10:47 ` Rajkumar Manoharan
  2015-05-19  7:29 ` [PATCH 1/2] nl80211: Add support to configure low ack threshold Johannes Berg
  1 sibling, 0 replies; 4+ messages in thread
From: Rajkumar Manoharan @ 2015-05-14 10:47 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>
---
 include/net/mac80211.h | 3 +++
 net/mac80211/cfg.c     | 1 +
 net/mac80211/status.c  | 4 ++--
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 8e3668b..76cb0e4 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -488,6 +488,8 @@ struct ieee80211_event {
  *	userspace), whereas TPC is disabled if %txpower_type is set to
  *	NL80211_TX_POWER_FIXED (use value configured from userspace)
  * @p2p_noa_attr: P2P NoA attribute for P2P powersave
+ * @low_ack_threshold: Number of consecutive packet loss to trigger low ack
+ *	event by driver.
  */
 struct ieee80211_bss_conf {
 	const u8 *bssid;
@@ -524,6 +526,7 @@ struct ieee80211_bss_conf {
 	int txpower;
 	enum nl80211_tx_power_setting txpower_type;
 	struct ieee80211_p2p_noa_attr p2p_noa_attr;
+	u16 low_ack_threshold;
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 265e427..b207e46 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -773,6 +773,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
 	sdata->vif.bss_conf.beacon_int = params->beacon_interval;
 	sdata->vif.bss_conf.dtim_period = params->dtim_period;
 	sdata->vif.bss_conf.enable_beacon = true;
+	sdata->vif.bss_conf.low_ack_threshold = params->low_ack_threshold;
 
 	sdata->vif.bss_conf.ssid_len = params->ssid_len;
 	if (params->ssid_len)
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 005fdbe..2a8cdac 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->sdata->vif.bss_conf.low_ack_threshold)
 		return;
 
 	/*
-- 
2.4.0


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

* Re: [PATCH 1/2] nl80211: Add support to configure low ack threshold
  2015-05-14 10:47 [PATCH 1/2] nl80211: Add support to configure low ack threshold Rajkumar Manoharan
  2015-05-14 10:47 ` [PATCH 2/2] mac80211: store low ack threshold in bss config Rajkumar Manoharan
@ 2015-05-19  7:29 ` Johannes Berg
  2015-05-21  6:28   ` Rajkumar Manoharan
  1 sibling, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2015-05-19  7:29 UTC (permalink / raw)
  To: Rajkumar Manoharan; +Cc: linux-wireless

On Thu, 2015-05-14 at 16:17 +0530, Rajkumar Manoharan wrote:
> 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.

If we're making this configurable, why not allow it to be done per
station?

johannes


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

* Re: [PATCH 1/2] nl80211: Add support to configure low ack threshold
  2015-05-19  7:29 ` [PATCH 1/2] nl80211: Add support to configure low ack threshold Johannes Berg
@ 2015-05-21  6:28   ` Rajkumar Manoharan
  0 siblings, 0 replies; 4+ messages in thread
From: Rajkumar Manoharan @ 2015-05-21  6:28 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On Tue, May 19, 2015 at 09:29:39AM +0200, Johannes Berg wrote:
> On Thu, 2015-05-14 at 16:17 +0530, Rajkumar Manoharan wrote:
> > 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.
> 
> If we're making this configurable, why not allow it to be done per
> station?
>
Though per-STA config looks granular, does it look good to have
different threshold for each station within the same BSS? On what basis
threshold will be defined for each station?

Please share your comments.

-Rajkumar

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

end of thread, other threads:[~2015-05-21  6:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-14 10:47 [PATCH 1/2] nl80211: Add support to configure low ack threshold Rajkumar Manoharan
2015-05-14 10:47 ` [PATCH 2/2] mac80211: store low ack threshold in bss config Rajkumar Manoharan
2015-05-19  7:29 ` [PATCH 1/2] nl80211: Add support to configure low ack threshold Johannes Berg
2015-05-21  6:28   ` Rajkumar Manoharan

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).