Skip to contentSkip to conversation

wireless: Per-sta NoAck and offload support

PATCH In review Tamizh chelvam 2 participants 8 messages Oct 16, 2018 – Nov 9, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover wireless: Per-sta NoAck and offload support

Adds infrastructure for driver to offload NoAck functionality, driver like ath10k could make use of it. Also extends the current ndev wide NoAck policy to per-station, with sta level NoAck policy configuration userspace could selectively turn off/on Noack based on various connection parameters of the station.

Tamizh chelvam (2):
ath10k: Add wmi command support for station specific TID config
ath10k: Add support for station specific noack TID policy

Vasanthakumar Thiagarajan (4):
mac80211: Add NoAck policy functionality offload infrastructure nl80211/mac80211: Extend NoAck policy command with peer MAC address
mac80211: Apply per-peer NoAck tid bitmap configuration
mac80211: Advertise per-peer NoAck policy support

 include/net/cfg80211.h       |   12 +++++++++--
 include/net/mac80211.h       |   13 ++++++++++++
 include/uapi/linux/nl80211.h |   16 +++++++++++++-
 net/mac80211/cfg.c           |   48 ++++++++++++++++++++++++++++++++++++++----
 net/mac80211/driver-ops.h    |   22 +++++++++++++++++++
 net/mac80211/ieee80211_i.h   |    2 +-
 net/mac80211/iface.c         |    4 ++++
 net/mac80211/main.c          |    4 ++++
 net/mac80211/sta_info.c      |    2 ++
 net/mac80211/sta_info.h      |    3 +++
 net/mac80211/trace.h         |   25 ++++++++++++++++++++++
 net/mac80211/tx.c            |    4 +++-
 net/mac80211/wme.c           |   35 +++++++++++++++++++++++++++++-
 net/wireless/nl80211.c       |   22 ++++++++++++++-----
 net/wireless/rdev-ops.h      |    7 +++---
 net/wireless/trace.h         |   15 +++++++------
 16 files changed, 210 insertions(+), 24 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/6 mac80211: Add NoAck policy functionality offload infrastructure

From: Vasanthakumar Thiagarajan <[email protected]>

Add infrastructure for drivers to implement NoAck policy functionlity. Driver like ath10k does not use the per-packet TID NoAck policy configuration. Instead NoAck map is sent to the firmware/hardware in control path. Firmware takes care of setting up QOS header with NoAck policy based on the TID NoAck map.

Drivers having this support should implement callback set_noack_tid_bitmap(). Supporting drivers would receive TID NoAck map through set_noack_tid_bitmap() instead of receiving as part of every tx skb.

---
 include/net/mac80211.h    |    7 +++++++
 net/mac80211/cfg.c        |   10 ++++++++--
 net/mac80211/driver-ops.h |   21 +++++++++++++++++++++
 net/mac80211/iface.c      |    4 ++++
 net/mac80211/trace.h      |   25 +++++++++++++++++++++++++
 net/mac80211/tx.c         |    2 +-
 net/mac80211/wme.c        |    3 ++-
 7 files changed, 68 insertions(+), 4 deletions(-)
include/net/mac80211.h +7 -0
index 71985e9..7da9d30 100644
@@ -3623,6 +3623,10 @@ enum ieee80211_reconfig_type {
  *	skb is always a real frame, head may or may not be an A-MSDU.
  * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available.
  *	Statistics should be cumulative, currently no way to reset is provided.
+ *
+ * @set_noack_tid_bitmap: Set NoAck policy TID bitmap for a virtual interface.
+ *	Drivers mplementing this callback must take care of setting NoAck policy
+ *	in QOS control field based on the configured TID bitmap.
  */
 struct ieee80211_ops {
 	void (*tx)(struct ieee80211_hw *hw,
@@ -3911,6 +3915,9 @@ struct ieee80211_ops {
 	int (*get_ftm_responder_stats)(struct ieee80211_hw *hw,
 				       struct ieee80211_vif *vif,
 				       struct cfg80211_ftm_responder_stats *ftm_stats);
+
+	int (*set_noack_tid_bitmap)(struct ieee80211_hw *hw,
+				    struct ieee80211_vif *vif, u16 noack_map);
 };
 
 /**
net/mac80211/cfg.c +8 -2
index 5162233..4d8cc8d 100644
@@ -346,9 +346,15 @@ static int ieee80211_set_noack_map(struct wiphy *wiphy,
 
 	sdata->noack_map = noack_map;
 
-	ieee80211_check_fast_xmit_iface(sdata);
+	if (!sdata->local->ops->set_noack_tid_bitmap) {
+		ieee80211_check_fast_xmit_iface(sdata);
+		return 0;
+	}
 
-	return 0;
+	if (!ieee80211_sdata_running(sdata))
+		return 0;
+
+	return drv_set_noack_tid_bitmap(sdata->local, sdata, noack_map);
 }
 
 static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
net/mac80211/driver-ops.h +21 -0
index 0b1747a..a6dcef5 100644
@@ -1278,4 +1278,25 @@ static inline void drv_del_nan_func(struct ieee80211_local *local,
 	trace_drv_return_void(local);
 }
 
+static inline int drv_set_noack_tid_bitmap(struct ieee80211_local *local,
+					   struct ieee80211_sub_if_data *sdata,
+					   u16 noack_map)
+{
+	int ret;
+
+	might_sleep();
+	if (!check_sdata_in_driver(sdata))
+		return -EIO;
+
+	if (!local->ops->set_noack_tid_bitmap)
+		return -EOPNOTSUPP;
+
+	trace_drv_set_noack_tid_bitmap(local, sdata, noack_map);
+	ret = local->ops->set_noack_tid_bitmap(&local->hw, &sdata->vif,
+					       noack_map);
+	trace_drv_return_int(local, ret);
+
+	return ret;
+}
+
 #endif /* __MAC80211_DRIVER_OPS */
net/mac80211/iface.c +4 -0
index 5836dde..06106f2 100644
@@ -633,6 +633,10 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
 				ieee80211_vif_type_p2p(&sdata->vif));
 			if (res)
 				goto err_del_interface;
+
+			if (sdata->noack_map)
+				drv_set_noack_tid_bitmap(local, sdata,
+							 sdata->noack_map);
 		}
 
 		if (sdata->vif.type == NL80211_IFTYPE_AP) {
net/mac80211/trace.h +25 -0
index 588c51a..a563904 100644
@@ -1882,6 +1882,31 @@ struct trace_switch_entry {
 	)
 );
 
+TRACE_EVENT(drv_set_noack_tid_bitmap,
+	TP_PROTO(struct ieee80211_local *local,
+		 struct ieee80211_sub_if_data *sdata,
+		 u16 noack_map),
+
+	TP_ARGS(local, sdata, noack_map),
+	TP_STRUCT__entry(
+		LOCAL_ENTRY
+		VIF_ENTRY
+		__field(u16, noack_map)
+	),
+
+	TP_fast_assign(
+		LOCAL_ASSIGN;
+		VIF_ASSIGN;
+		__entry->noack_map = noack_map;
+	),
+
+	TP_printk(
+		LOCAL_PR_FMT  VIF_PR_FMT
+		", noack_map: %u",
+		LOCAL_PR_ARG, VIF_PR_ARG, __entry->noack_map
+	)
+);
+
 /*
  * Tracing for API calls that drivers call.
  */
net/mac80211/tx.c +1 -1
index e0ccee2..d744c4b 100644
@@ -2872,7 +2872,7 @@ void ieee80211_check_fast_xmit(struct sta_info *sta)
 	    test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT))
 		goto out;
 
-	if (sdata->noack_map)
+	if (sdata->noack_map && !local->ops->set_noack_tid_bitmap)
 		goto out;
 
 	/* fast-xmit doesn't handle fragmentation at all */
net/mac80211/wme.c +2 -1
index 5f7c963..11c14b9 100644
@@ -256,7 +256,8 @@ void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
 		       IEEE80211_QOS_CTL_ACK_POLICY_MASK);
 
 	if (is_multicast_ether_addr(hdr->addr1) ||
-	    sdata->noack_map & BIT(tid)) {
+	    (!sdata->local->ops->set_noack_tid_bitmap &&
+	    sdata->noack_map & BIT(tid))) {
 		flags |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK;
 		info->flags |= IEEE80211_TX_CTL_NO_ACK;
 	}
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/6 nl80211/mac80211: Extend NoAck policy command with peer MAC address

In reply to Tamizh chelvam

From: Vasanthakumar Thiagarajan <[email protected]>

Provides peer level NoAck policy configuration by extending NL80211_CMD_SET_NOACK_MAP command with peer MAC address.
If user space does not give any peer mac address, the driver should retain the existing functionality of applying the NoAck policy for all the staions connected to the netdev. For a connected peer, the peer specific configuration takes precedence over netdev level configuration when both are set by the user. When the command is given without attribute NL80211_ATTR_NOACK_MAP for a peer, the NoAck policy for the peer will be reset to default which is peer's netdev NoAck policy. Newly connected stations will have default NoAck policy. Drivers supporting per-sta NoAck policy must advertise the support through the extended flag index NL80211_EXT_FEATURE_PER_STA_NOACK_MAP. Since a value of -1 NoAck map is used for default configuration, redefine noack_map as int from u16.

---
 include/net/cfg80211.h       |   12 ++++++++++--
 include/net/mac80211.h       |    2 +-
 include/uapi/linux/nl80211.h |   16 +++++++++++++++-
 net/mac80211/cfg.c           |    3 ++-
 net/mac80211/driver-ops.h    |    2 +-
 net/mac80211/ieee80211_i.h   |    2 +-
 net/mac80211/trace.h         |    6 +++---
 net/wireless/nl80211.c       |   22 +++++++++++++++++-----
 net/wireless/rdev-ops.h      |    7 ++++---
 net/wireless/trace.h         |   15 +++++++++------
 10 files changed, 63 insertions(+), 24 deletions(-)
include/net/cfg80211.h +10 -2
index 1fa41b7..5801d76 100644
@@ -3086,7 +3086,15 @@ struct cfg80211_ftm_responder_stats {
  * @probe_client: probe an associated client, must return a cookie that it
  *	later passes to cfg80211_probe_status().
  *
- * @set_noack_map: Set the NoAck Map for the TIDs.
+ * @set_noack_map: Set the NoAck Map for the TIDs. When peer is not %NULL NoAck
+ *	map will be applied for that particular peer. A NoAck map value of -1
+ *	for non-%NULL peer would indicate that the peer's current NoAck
+ *	configuration should be reset to the default one. The default NoAck
+ *	configuration for a peer uses the currently configured NoAck setting of
+ *	netdev. When peer is %NULL NoAck map will be applied for all the
+ *	connected stations on the netdev which have default NoAck policy
+ *	configuration. Default NoAck configuration should be used for newly
+ *	connected stations.
  *
  * @get_channel: Get the current operating channel for the virtual interface.
  *	For monitor interfaces, it should return %NULL unless there's a single
@@ -3403,7 +3411,7 @@ struct cfg80211_ops {
 
 	int	(*set_noack_map)(struct wiphy *wiphy,
 				  struct net_device *dev,
-				  u16 noack_map);
+				  const u8 *peer, int noack_map);
 
 	int	(*get_channel)(struct wiphy *wiphy,
 			       struct wireless_dev *wdev,
include/net/mac80211.h +1 -1
index 7da9d30..5ce7ce7 100644
@@ -3917,7 +3917,7 @@ struct ieee80211_ops {
 				       struct cfg80211_ftm_responder_stats *ftm_stats);
 
 	int (*set_noack_tid_bitmap)(struct ieee80211_hw *hw,
-				    struct ieee80211_vif *vif, u16 noack_map);
+				    struct ieee80211_vif *vif, int noack_map);
 };
 
 /**
include/uapi/linux/nl80211.h +15 -1
index 6d610ba..31b7a4b 100644
@@ -788,7 +788,18 @@
  *	messages. Note that per PHY only one application may register.
  *
  * @NL80211_CMD_SET_NOACK_MAP: sets a bitmap for the individual TIDs whether
- *      No Acknowledgement Policy should be applied.
+ *	No Acknowledgement Policy should be applied. %NL80211_ATTR_MAC is used
+ *	to apply No Acknowledgement policy for a particular connected station.
+ *	When the command is received without %NL80211_ATTR_NOACK_MAP for a
+ *	connected station (%NL80211_ATTR_MAC), the station's current NoAck
+ *	policy configuration should be reset to default. The default
+ *	configuration for a peer should use the current ndev level NoAck
+ *	policy configuration. Station specific NoAck policy configuration is
+ *	valid only for STA's current connection, i.e. the configuration will
+ *	be reset to default when the station connects back after disconnection/
+ *	roaming. When user-space does not include %NL80211_ATTR_MAC, the No
+ *	Acknowledgement Policy setting should be treated as per-netdev
+ *	configuration.
  *
  * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
  *	independently of the userspace SME, send this event indicating
@@ -5257,6 +5268,8 @@ enum nl80211_feature_flags {
  *      able to rekey an in-use key correctly. Userspace must not rekey PTK keys
  *      if this flag is not set. Ignoring this can leak clear text packets and/or
  *      freeze the connection.
+ * @NL80211_EXT_FEATURE_PER_STA_NOACK_MAP: Driver supports STA specific NoAck
+ *	policy functionality.
  *
  * @NUM_NL80211_EXT_FEATURES: number of extended features.
  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
@@ -5297,6 +5310,7 @@ enum nl80211_ext_feature_index {
 	NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,
 	NL80211_EXT_FEATURE_CAN_REPLACE_PTK0,
 	NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER,
+	NL80211_EXT_FEATURE_PER_STA_NOACK_MAP,
 
 	/* add new features before the definition below */
 	NUM_NL80211_EXT_FEATURES,
net/mac80211/cfg.c +2 -1
index 4d8cc8d..7a7e423 100644
@@ -340,7 +340,8 @@ static void ieee80211_del_nan_func(struct wiphy *wiphy,
 
 static int ieee80211_set_noack_map(struct wiphy *wiphy,
 				  struct net_device *dev,
-				  u16 noack_map)
+				  const u8 *peer,
+				  int noack_map)
 {
 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
net/mac80211/driver-ops.h +1 -1
index a6dcef5..d705938 100644
@@ -1280,7 +1280,7 @@ static inline void drv_del_nan_func(struct ieee80211_local *local,
 
 static inline int drv_set_noack_tid_bitmap(struct ieee80211_local *local,
 					   struct ieee80211_sub_if_data *sdata,
-					   u16 noack_map)
+					   int noack_map)
 {
 	int ret;
 
net/mac80211/ieee80211_i.h +1 -1
index 10a0506..257dec5 100644
@@ -891,7 +891,7 @@ struct ieee80211_sub_if_data {
 	unsigned int fragment_next;
 
 	/* TID bitmap for NoAck policy */
-	u16 noack_map;
+	int noack_map;
 
 	/* bit field of ACM bits (BIT(802.1D tag)) */
 	u8 wmm_acm;
net/mac80211/trace.h +3 -3
index a563904..e0e6c9a 100644
@@ -1885,13 +1885,13 @@ struct trace_switch_entry {
 TRACE_EVENT(drv_set_noack_tid_bitmap,
 	TP_PROTO(struct ieee80211_local *local,
 		 struct ieee80211_sub_if_data *sdata,
-		 u16 noack_map),
+		 int noack_map),
 
 	TP_ARGS(local, sdata, noack_map),
 	TP_STRUCT__entry(
 		LOCAL_ENTRY
 		VIF_ENTRY
-		__field(u16, noack_map)
+		__field(int, noack_map)
 	),
 
 	TP_fast_assign(
@@ -1902,7 +1902,7 @@ struct trace_switch_entry {
 
 	TP_printk(
 		LOCAL_PR_FMT  VIF_PR_FMT
-		", noack_map: %u",
+		", noack_map: %d",
 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->noack_map
 	)
 );
net/wireless/nl80211.c +17 -5
index 744b585..d744388 100644
@@ -3331,17 +3331,29 @@ static int nl80211_set_noack_map(struct sk_buff *skb, struct genl_info *info)
 {
 	struct cfg80211_registered_device *rdev = info->user_ptr[0];
 	struct net_device *dev = info->user_ptr[1];
-	u16 noack_map;
+	int noack_map = -1;
+	const u8 *peer = NULL;
 
-	if (!info->attrs[NL80211_ATTR_NOACK_MAP])
+	if (!(info->attrs[NL80211_ATTR_NOACK_MAP] ||
+	      info->attrs[NL80211_ATTR_MAC]))
 		return -EINVAL;
 
+	if (info->attrs[NL80211_ATTR_NOACK_MAP])
+		noack_map = nla_get_u16(info->attrs[NL80211_ATTR_NOACK_MAP]);
+
+	if (info->attrs[NL80211_ATTR_MAC]) {
+		if (!wiphy_ext_feature_isset(
+				&rdev->wiphy,
+				NL80211_EXT_FEATURE_PER_STA_NOACK_MAP))
+			return -EOPNOTSUPP;
+
+		peer = nla_data(info->attrs[NL80211_ATTR_MAC]);
+	}
+
 	if (!rdev->ops->set_noack_map)
 		return -EOPNOTSUPP;
 
-	noack_map = nla_get_u16(info->attrs[NL80211_ATTR_NOACK_MAP]);
-
-	return rdev_set_noack_map(rdev, dev, noack_map);
+	return rdev_set_noack_map(rdev, dev, peer, noack_map);
 }
 
 struct get_key_cookie {
net/wireless/rdev-ops.h +4 -3
index 51380b5..8426eb1 100644
@@ -908,11 +908,12 @@ static inline int rdev_probe_client(struct cfg80211_registered_device *rdev,
 }
 
 static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev,
-				     struct net_device *dev, u16 noack_map)
+				     struct net_device *dev, const u8 *peer,
+				     int noack_map)
 {
 	int ret;
-	trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map);
-	ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map);
+	trace_rdev_set_noack_map(&rdev->wiphy, dev, peer, noack_map);
+	ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, peer, noack_map);
 	trace_rdev_return_int(&rdev->wiphy, ret);
 	return ret;
 }
net/wireless/trace.h +9 -6
index c6a9446..2ff78dd 100644
@@ -1909,21 +1909,24 @@
 );
 
 TRACE_EVENT(rdev_set_noack_map,
-	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
-		 u16 noack_map),
-	TP_ARGS(wiphy, netdev, noack_map),
+	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *peer,
+		 int noack_map),
+	TP_ARGS(wiphy, netdev, peer, noack_map),
 	TP_STRUCT__entry(
 		WIPHY_ENTRY
 		NETDEV_ENTRY
-		__field(u16, noack_map)
+		MAC_ENTRY(peer)
+		__field(int, noack_map)
 	),
 	TP_fast_assign(
 		WIPHY_ASSIGN;
 		NETDEV_ASSIGN;
+		MAC_ASSIGN(peer, peer);
 		__entry->noack_map = noack_map;
 	),
-	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", noack_map: %u",
-		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->noack_map)
+	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT
+		  ", noack_map: %d", WIPHY_PR_ARG, NETDEV_PR_ARG,
+		  MAC_PR_ARG(peer), __entry->noack_map)
 );
 
 DEFINE_EVENT(wiphy_wdev_evt, rdev_get_channel,
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/6 mac80211: Apply per-peer NoAck tid bitmap configuration

In reply to Tamizh chelvam

From: Vasanthakumar Thiagarajan <[email protected]>

Use per-peer NoAck tid bitmap, if it is configured,
when setting up the qos header. If the NoAck tid bitmap is default (-1) for a peer, use the netdev wide noack policy configuration. The NoAck tid bitmap for newly connected stations is set to default (-1). Also modifies callback set_noack_tid_bitmap() with the provision to send per-peer NoAck policy configuration to the drivers.

---
 include/net/mac80211.h    |   14 ++++++++++----
 net/mac80211/cfg.c        |   43 ++++++++++++++++++++++++++++++++++++++-----
 net/mac80211/driver-ops.h |    3 ++-
 net/mac80211/iface.c      |    2 +-
 net/mac80211/sta_info.c   |    2 ++
 net/mac80211/sta_info.h   |    3 +++
 net/mac80211/tx.c         |    4 +++-
 net/mac80211/wme.c        |   34 +++++++++++++++++++++++++++++++++-
 8 files changed, 92 insertions(+), 13 deletions(-)
include/net/mac80211.h +10 -4
index 5ce7ce7..b6cc3e33 100644
@@ -3624,9 +3624,14 @@ enum ieee80211_reconfig_type {
  * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available.
  *	Statistics should be cumulative, currently no way to reset is provided.
  *
- * @set_noack_tid_bitmap: Set NoAck policy TID bitmap for a virtual interface.
- *	Drivers mplementing this callback must take care of setting NoAck policy
- *	in QOS control field based on the configured TID bitmap.
+ * @set_noack_tid_bitmap: Set NoAck policy TID bitmap. Apply the TID NoAck
+ *	configuration for a particular station when @sta is non-NULL. NoAck
+ *	policy is set to default for a peer when noack_map is -1 for the peer.
+ *	The default NoAck policy for a peer is using netdev NoAck policy.
+ *	When @sta is NULL, apply TID NoAck configuration at virtual interface
+ *	level. Drivers mplementing this callback must take care of setting NoAck
+ *	policy in QOS control field based on the configured TID bitmap.
+ *	This callback may sleep.
  */
 struct ieee80211_ops {
 	void (*tx)(struct ieee80211_hw *hw,
@@ -3917,7 +3922,8 @@ struct ieee80211_ops {
 				       struct cfg80211_ftm_responder_stats *ftm_stats);
 
 	int (*set_noack_tid_bitmap)(struct ieee80211_hw *hw,
-				    struct ieee80211_vif *vif, int noack_map);
+				    struct ieee80211_vif *vif,
+				    struct ieee80211_sta *sta, int noack_map);
 };
 
 /**
net/mac80211/cfg.c +38 -5

56 lines not on this page · raw message

net/mac80211/driver-ops.h +2 -1
index d705938..ed9bd59 100644
@@ -1280,6 +1280,7 @@ static inline void drv_del_nan_func(struct ieee80211_local *local,
 
 static inline int drv_set_noack_tid_bitmap(struct ieee80211_local *local,
 					   struct ieee80211_sub_if_data *sdata,
+					   struct ieee80211_sta *sta,
 					   int noack_map)
 {
 	int ret;
@@ -1293,7 +1294,7 @@ static inline int drv_set_noack_tid_bitmap(struct ieee80211_local *local,
 
 	trace_drv_set_noack_tid_bitmap(local, sdata, noack_map);
 	ret = local->ops->set_noack_tid_bitmap(&local->hw, &sdata->vif,
-					       noack_map);
+					       sta, noack_map);
 	trace_drv_return_int(local, ret);
 
 	return ret;
net/mac80211/iface.c +1 -1
index 06106f2..4999977 100644
@@ -635,7 +635,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
 				goto err_del_interface;
 
 			if (sdata->noack_map)
-				drv_set_noack_tid_bitmap(local, sdata,
+				drv_set_noack_tid_bitmap(local, sdata, NULL,
 							 sdata->noack_map);
 		}
 
net/mac80211/sta_info.c +2 -0
index fb8c225..d2ea8ee 100644
@@ -606,6 +606,8 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
 	cfg80211_new_sta(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL);
 	kfree(sinfo);
 
+	sta->noack_map = -1;
+
 	sta_dbg(sdata, "Inserted STA %pM\n", sta->sta.addr);
 
 	/* move reference to rcu-protected */
net/mac80211/sta_info.h +3 -0
index 9a04327..863601a 100644
@@ -583,6 +583,9 @@ struct sta_info {
 
 	struct cfg80211_chan_def tdls_chandef;
 
+	/* TID bitmap for station's NoAck policy */
+	int noack_map;
+
 	/* keep last! */
 	struct ieee80211_sta sta;
 };
net/mac80211/tx.c +3 -1
index d744c4b..b57cd1f 100644
@@ -2872,7 +2872,9 @@ void ieee80211_check_fast_xmit(struct sta_info *sta)
 	    test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT))
 		goto out;
 
-	if (sdata->noack_map && !local->ops->set_noack_tid_bitmap)
+	if (((sta->noack_map == -1 && sdata->noack_map) ||
+	     (sta->noack_map != -1 && sta->noack_map)) &&
+	    !local->ops->set_noack_tid_bitmap)
 		goto out;
 
 	/* fast-xmit doesn't handle fragmentation at all */
net/mac80211/wme.c +33 -1
index 11c14b9..b1722b8 100644
@@ -227,6 +227,38 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
 }
 
 /**
+ * ieee80211_get_noack_map - Get TID bitmap of NoAck policy. NoAck policy
+ * could be device wide or per-station.
+ *
+ * @sdata: local subif
+ * @mac: MAC address of the receiver
+ */
+int ieee80211_get_noack_map(struct ieee80211_sub_if_data *sdata, const u8 *mac)
+{
+	struct sta_info *sta;
+	int noack_map = 0;
+
+	/* Retrieve per-station noack_map config for the receiver, if any */
+
+	rcu_read_lock();
+
+	sta = sta_info_get(sdata, mac);
+	if (!sta) {
+		rcu_read_unlock();
+		return noack_map;
+	}
+
+	noack_map = sta->noack_map;
+
+	rcu_read_unlock();
+
+	if (noack_map == -1)
+		noack_map = sdata->noack_map;
+
+	return noack_map;
+}
+
+/**
  * ieee80211_set_qos_hdr - Fill in the QoS header if there is one.
  *
  * @sdata: local subif
@@ -257,7 +289,7 @@ void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
 
 	if (is_multicast_ether_addr(hdr->addr1) ||
 	    (!sdata->local->ops->set_noack_tid_bitmap &&
-	    sdata->noack_map & BIT(tid))) {
+	     ieee80211_get_noack_map(sdata, hdr->addr1) & BIT(tid))) {
 		flags |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK;
 		info->flags |= IEEE80211_TX_CTL_NO_ACK;
 	}
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 4/6 mac80211: Advertise per-peer NoAck policy support

In reply to Tamizh chelvam

From: Vasanthakumar Thiagarajan <[email protected]>

This enables per-peer NoAck handling in mac80211 when the functionality is not offloaded to the drivers.

---
 net/mac80211/main.c |    4 ++++
 1 file changed, 4 insertions(+)
net/mac80211/main.c +4 -0
index 83e71e6..698cf56 100644
@@ -597,6 +597,10 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
 
 	wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_RRM);
 
+	if (!ops->set_noack_tid_bitmap)
+		wiphy_ext_feature_set(wiphy,
+				      NL80211_EXT_FEATURE_PER_STA_NOACK_MAP);
+
 	wiphy->bss_priv_size = sizeof(struct ieee80211_bss);
 
 	local = wiphy_priv(wiphy);
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 5/6 ath10k: Add wmi command support for station specific TID config

In reply to Tamizh chelvam

This patch adds WMI interface to support station specific TID configuration like setting noack policy. Host needs to send station's MAC address, ack policy and TID info to target through WMI_10_4_PER_PEER_PER_TID_CONFIG_CMDID.

WMI_SERVICE_PEER_TID_CONFIGS_SUPPORT flag is added to advertise this support.

Testing:
* Tested HW: QCA9888
* Tested FW: 10.4-3.5.1-00052

---
 drivers/net/wireless/ath/ath10k/wmi-ops.h | 19 ++++++++++++
 drivers/net/wireless/ath/ath10k/wmi.c     | 29 ++++++++++++++++++
 drivers/net/wireless/ath/ath10k/wmi.h     | 50 +++++++++++++++++++++++++++++++
 3 files changed, 98 insertions(+)
drivers/net/wireless/ath/ath10k/wmi-ops.h +19 -0
index 7978a77..65be00e 100644
@@ -219,6 +219,8 @@ struct wmi_ops {
 	struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value);
 	struct sk_buff *(*gen_pdev_get_tpc_table_cmdid)(struct ath10k *ar,
 							u32 param);
+	struct sk_buff *(*gen_per_peer_per_tid_cfg)(struct ath10k *ar,
+				const struct wmi_per_peer_per_tid_cfg_arg *arg);
 
 };
 
@@ -1576,4 +1578,21 @@ struct wmi_ops {
 				   ar->wmi.cmd->radar_found_cmdid);
 }
 
+static inline int
+ath10k_wmi_set_per_peer_per_tid_cfg(struct ath10k *ar,
+				const struct wmi_per_peer_per_tid_cfg_arg *arg)
+{
+	struct sk_buff *skb;
+
+	if (!ar->wmi.ops->gen_per_peer_per_tid_cfg)
+		return -EOPNOTSUPP;
+
+	skb = ar->wmi.ops->gen_per_peer_per_tid_cfg(ar, arg);
+	if (IS_ERR(skb))
+		return PTR_ERR(skb);
+
+	return ath10k_wmi_cmd_send(ar, skb,
+				   ar->wmi.cmd->per_peer_per_tid_config_cmdid);
+}
+
 #endif
drivers/net/wireless/ath/ath10k/wmi.c +29 -0
index 25e8fa7..14fdc94 100644
@@ -750,6 +750,7 @@
 	.tdls_peer_update_cmdid = WMI_10_4_TDLS_PEER_UPDATE_CMDID,
 	.tdls_set_offchan_mode_cmdid = WMI_10_4_TDLS_SET_OFFCHAN_MODE_CMDID,
 	.radar_found_cmdid = WMI_10_4_RADAR_FOUND_CMDID,
+	.per_peer_per_tid_config_cmdid = WMI_10_4_PER_PEER_PER_TID_CONFIG_CMDID,
 };
 
 /* MAIN WMI VDEV param map */
@@ -8744,6 +8745,33 @@ static u32 ath10k_wmi_prepare_peer_qos(u8 uapsd_queues, u8 sp)
 }
 
 static struct sk_buff *
+ath10k_wmi_10_4_gen_per_peer_per_tid_cfg(struct ath10k *ar,
+				const struct wmi_per_peer_per_tid_cfg_arg *arg)
+{
+	struct wmi_peer_per_tid_cfg_cmd *cmd;
+	struct sk_buff *skb;
+
+	skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
+	if (!skb)
+		return ERR_PTR(-ENOMEM);
+
+	memset(skb->data, 0, sizeof(*cmd));
+
+	cmd = (struct wmi_peer_per_tid_cfg_cmd *)skb->data;
+	cmd->vdev_id = cpu_to_le32(arg->vdev_id);
+	ether_addr_copy(cmd->peer_macaddr.addr, arg->peer_macaddr.addr);
+	cmd->tid = cpu_to_le32(arg->tid);
+	cmd->ack_policy = cpu_to_le32(arg->ack_policy);
+	cmd->aggr_control = cpu_to_le32(arg->aggr_control);
+	cmd->rate_control = cpu_to_le32(arg->rate_ctrl);
+
+	ath10k_dbg(ar, ATH10K_DBG_WMI,
+		   "wmi noack tid %d vdev id %d ack_policy %d aggr %u rate %u mac_addr %pM\n",
+		   arg->tid, arg->vdev_id, arg->ack_policy, arg->aggr_control, arg->rate_ctrl, arg->peer_macaddr.addr);
+	return skb;
+}
+
+static struct sk_buff *
 ath10k_wmi_op_gen_echo(struct ath10k *ar, u32 value)
 {
 	struct wmi_echo_cmd *cmd;
@@ -9128,6 +9156,7 @@ static u32 ath10k_wmi_prepare_peer_qos(u8 uapsd_queues, u8 sp)
 	.gen_pdev_get_tpc_table_cmdid =
 			ath10k_wmi_10_4_op_gen_pdev_get_tpc_table_cmdid,
 	.gen_radar_found = ath10k_wmi_10_4_gen_radar_found,
+	.gen_per_peer_per_tid_cfg = ath10k_wmi_10_4_gen_per_peer_per_tid_cfg,
 
 	/* shared with 10.2 */
 	.pull_echo_ev = ath10k_wmi_op_pull_echo_ev,
drivers/net/wireless/ath/ath10k/wmi.h +50 -0

86 lines not on this page · raw message

Signature · 1 line
1.9.1
#6 lore raw

PATCH 6/6 ath10k: Add support for station specific noack TID policy

In reply to Tamizh chelvam

This patch add ops for set_noack_tid_bitmap to support station specific noack policy functionality for a TID. TID will be parsed from noack_map parameter and pass to target with station's mac address and the ack policy, and the value is stored in arsta.

Suppose if the station entry is not mentioned in the command, the configuration will be applied for all the connected stations in the vif which have default value(-1) in the arsta structure. And this will be applied for newly connecting station as well.

ATH10K_SKB_F_NOACK_TID skb cb flag introduced to avoid setting IEEE80211_TX_STAT_ACK flag in the tx completion.

WMI_SERVICE_PEER_TID_CONFIGS_SUPPORT flag is added to advertise this command support

Testing:
* Tested HW: QCA9888
* Tested FW: 10.4-3.5.1-00052

---
 drivers/net/wireless/ath/ath10k/core.h |  11 +++
 drivers/net/wireless/ath/ath10k/mac.c  | 172 ++++++++++++++++++++++++++++++++-
 drivers/net/wireless/ath/ath10k/txrx.c |  12 ++-
 3 files changed, 188 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath10k/core.h +11 -0
index 0424180..418eb19 100644
@@ -90,6 +90,9 @@
 /* The magic used by QCA spec */
 #define ATH10K_SMBIOS_BDF_EXT_MAGIC "BDF_"
 
+/* Number of TID target accepts from host */
+#define ATH10K_MAX_TIDS	0x8
+
 struct ath10k;
 
 static inline const char *ath10k_bus_str(enum ath10k_bus bus)
@@ -116,6 +119,7 @@ enum ath10k_skb_flags {
 	ATH10K_SKB_F_DELIVER_CAB = BIT(2),
 	ATH10K_SKB_F_MGMT = BIT(3),
 	ATH10K_SKB_F_QOS = BIT(4),
+	ATH10K_SKB_F_NOACK_TID = BIT(5),
 };
 
 struct ath10k_skb_cb {
@@ -498,6 +502,10 @@ struct ath10k_sta {
 	u64 rx_duration;
 	struct ath10k_htt_tx_stats *tx_stats;
 
+	/* TID bitmap for station's NoAck policy, protected by conf_mutex */
+	int noack_map;
+	struct work_struct noack_map_wk;
+
 #ifdef CONFIG_MAC80211_DEBUGFS
 	/* protected by conf_mutex */
 	bool aggr_mode;
@@ -573,6 +581,9 @@ struct ath10k_vif {
 	struct work_struct ap_csa_work;
 	struct delayed_work connection_loss_work;
 	struct cfg80211_bitrate_mask bitrate_mask;
+
+	/* TID bitmap for station's NoAck policy, protected by conf_mutex */
+	int noack_map;
 };
 
 struct ath10k_vif_iter {
drivers/net/wireless/ath/ath10k/mac.c +168 -4

256 lines not on this page · raw message

drivers/net/wireless/ath/ath10k/txrx.c +9 -3
index 23606b6..3b385d4 100644
@@ -61,6 +61,7 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt,
 	struct ath10k_skb_cb *skb_cb;
 	struct ath10k_txq *artxq;
 	struct sk_buff *msdu;
+	u8 flags;
 
 	ath10k_dbg(ar, ATH10K_DBG_HTT,
 		   "htt tx completion msdu_id %u status %d\n",
@@ -89,6 +90,8 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt,
 		artxq->num_fw_queued--;
 	}
 
+	flags = skb_cb->flags;
+
 	ath10k_htt_tx_free_msdu_id(htt, tx_done->msdu_id);
 	ath10k_htt_tx_dec_pending(htt);
 	if (htt->num_pending_tx == 0)
@@ -104,18 +107,21 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt,
 	memset(&info->status, 0, sizeof(info->status));
 	trace_ath10k_txrx_tx_unref(ar, tx_done->msdu_id);
 
-	if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
+	if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) &&
+	    !(flags & ATH10K_SKB_F_NOACK_TID))
 		info->flags |= IEEE80211_TX_STAT_ACK;
 
 	if (tx_done->status == HTT_TX_COMPL_STATE_NOACK)
 		info->flags &= ~IEEE80211_TX_STAT_ACK;
 
 	if ((tx_done->status == HTT_TX_COMPL_STATE_ACK) &&
-	    (info->flags & IEEE80211_TX_CTL_NO_ACK))
+	    ((info->flags & IEEE80211_TX_CTL_NO_ACK) ||
+	    (flags & ATH10K_SKB_F_NOACK_TID)))
 		info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED;
 
 	if (tx_done->status == HTT_TX_COMPL_STATE_DISCARD) {
-		if (info->flags & IEEE80211_TX_CTL_NO_ACK)
+		if ((info->flags & IEEE80211_TX_CTL_NO_ACK) ||
+		    (flags & ATH10K_SKB_F_NOACK_TID))
 			info->flags &= ~IEEE80211_TX_STAT_NOACK_TRANSMITTED;
 		else
 			info->flags &= ~IEEE80211_TX_STAT_ACK;
Signature · 1 line
1.9.1
maintainer
#7 lore raw
In reply to Tamizh chelvam

Hi,

Quoted 5 lines

Adds infrastructure for driver to offload NoAck functionality, driver like ath10k could make use of it. Also extends the current ndev wide NoAck policy to per-station, with sta level NoAck policy configuration userspace could selectively turn off/on Noack based on various connection parameters of the station.

So ... we have this, but we also have

[PATCH 0/4] cfg80211/mac80211: Add support for TID specific configuration

which you were involved in.

Unless you can cite a good reason not to, I think it would make sense to combine the two and make "noack" just another attribute in the TID configuration.

johannes