All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: use more bits for ack_frame_id
@ 2020-01-15 11:25 Johannes Berg
  2020-01-15 11:42 ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2020-01-15 11:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: toke, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

It turns out that this wasn't a good idea, I hit a test failure in
hwsim due to this. That particular failure was easily worked around,
but it raised questions: if an AP needs to, for example, send action
frames to each connected station, the current limit is nowhere near
enough (especially if those stations are sleeping and the frames are
queued for a while.)

Shuffle around some bits to make more room for ack_frame_id to allow
up to 8192 queued up frames, that's enough for queueing 4 frames to
each connected station, even at the maximum of 2007 stations on a
single AP.

We take the bits from band (which currently only 2 but I leave 3 in
case we add another band) and from the hw_queue, which can only need
4 since it has a limit of 16 queues.

Fixes: 6912daed05e1 ("mac80211: Shrink the size of ack_frame_id to make room for tx_time_est")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/net/mac80211.h | 11 +++++------
 net/mac80211/cfg.c     |  2 +-
 net/mac80211/tx.c      |  2 +-
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 6d4ea71523d2..64a249445c86 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1007,12 +1007,11 @@ ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *rate)
 struct ieee80211_tx_info {
 	/* common information */
 	u32 flags;
-	u8 band;
-
-	u8 hw_queue;
-
-	u16 ack_frame_id:6;
-	u16 tx_time_est:10;
+	u32 band:3,
+	    ack_frame_id:13,
+	    hw_queue:4,
+	    tx_time_est:10;
+	/* 2 free bits */
 
 	union {
 		struct {
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index a11bd1669c13..5715c4606cff 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3431,7 +3431,7 @@ int ieee80211_attach_ack_skb(struct ieee80211_local *local, struct sk_buff *skb,
 
 	spin_lock_irqsave(&local->ack_status_lock, spin_flags);
 	id = idr_alloc(&local->ack_status_frames, ack_skb,
-		       1, 0x40, GFP_ATOMIC);
+		       1, 0x2000, GFP_ATOMIC);
 	spin_unlock_irqrestore(&local->ack_status_lock, spin_flags);
 
 	if (id < 0) {
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 4296d9d71311..4520cda6f523 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2443,7 +2443,7 @@ static int ieee80211_store_ack_skb(struct ieee80211_local *local,
 
 		spin_lock_irqsave(&local->ack_status_lock, flags);
 		id = idr_alloc(&local->ack_status_frames, ack_skb,
-			       1, 0x40, GFP_ATOMIC);
+			       1, 0x2000, GFP_ATOMIC);
 		spin_unlock_irqrestore(&local->ack_status_lock, flags);
 
 		if (id >= 0) {
-- 
2.24.1


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

* Re: [PATCH] mac80211: use more bits for ack_frame_id
  2020-01-15 11:25 [PATCH] mac80211: use more bits for ack_frame_id Johannes Berg
@ 2020-01-15 11:42 ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 2+ messages in thread
From: Toke Høiland-Jørgensen @ 2020-01-15 11:42 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless; +Cc: Johannes Berg

Johannes Berg <johannes@sipsolutions.net> writes:

> From: Johannes Berg <johannes.berg@intel.com>
>
> It turns out that this wasn't a good idea, I hit a test failure in
> hwsim due to this. That particular failure was easily worked around,
> but it raised questions: if an AP needs to, for example, send action
> frames to each connected station, the current limit is nowhere near
> enough (especially if those stations are sleeping and the frames are
> queued for a while.)
>
> Shuffle around some bits to make more room for ack_frame_id to allow
> up to 8192 queued up frames, that's enough for queueing 4 frames to
> each connected station, even at the maximum of 2007 stations on a
> single AP.
>
> We take the bits from band (which currently only 2 but I leave 3 in
> case we add another band) and from the hw_queue, which can only need
> 4 since it has a limit of 16 queues.
>
> Fixes: 6912daed05e1 ("mac80211: Shrink the size of ack_frame_id to make room for tx_time_est")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Fair enough :)

Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>


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

end of thread, other threads:[~2020-01-15 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 11:25 [PATCH] mac80211: use more bits for ack_frame_id Johannes Berg
2020-01-15 11:42 ` Toke Høiland-Jørgensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.