Advertisement
Guest User

650-Shrink-the-size-of-ack_frame_id-for-tx_time_est.patch

a guest
Nov 28th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.79 KB | None | 0 0
  1. From 6912daed05e1370af5253aea6f2116805c0e57f8 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@redhat.com>
  3. Date: Wed, 23 Oct 2019 11:59:00 +0200
  4. Subject: [PATCH] mac80211: Shrink the size of ack_frame_id to make room for
  5.  tx_time_est
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9.  
  10. To implement airtime queue limiting, we need to keep a running account of
  11. the estimated airtime of all skbs queued into the device. Do to this
  12. correctly, we need to store the airtime estimate into the skb so we can
  13. decrease the outstanding balance when the skb is freed. This means that the
  14. time estimate must be stored somewhere that will survive for the lifetime
  15. of the skb.
  16.  
  17. To get this, decrease the size of the ack_frame_id field to 6 bits, and
  18. lower the size of the ID space accordingly. This leaves 10 bits for use for
  19. tx_time_est, which is enough to store a maximum of 4096 us, if we shift the
  20. values so they become units of 4us.
  21.  
  22. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
  23. Link: https://lore.kernel.org/r/157182474063.150713.16132669599100802716.stgit@toke.dk
  24. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  25. ---
  26. include/net/mac80211.h | 4 +++-
  27.  net/mac80211/cfg.c     | 2 +-
  28.  net/mac80211/tx.c      | 2 +-
  29.  3 files changed, 5 insertions(+), 3 deletions(-)
  30.  
  31. --- a/include/net/mac80211.h
  32. +++ b/include/net/mac80211.h
  33. @@ -961,6 +961,7 @@ ieee80211_rate_get_vht_nss(const struct
  34.   * @band: the band to transmit on (use for checking for races)
  35.   * @hw_queue: HW queue to put the frame on, skb_get_queue_mapping() gives the AC
  36.   * @ack_frame_id: internal frame ID for TX status, used internally
  37. + * @tx_time_est: TX time estimate in units of 4us, used internally
  38.   * @control: union part for control data
  39.   * @control.rates: TX rates array to try
  40.   * @control.rts_cts_rate_idx: rate for RTS or CTS
  41. @@ -1001,7 +1002,8 @@ struct ieee80211_tx_info {
  42.  
  43.     u8 hw_queue;
  44.  
  45. -   u16 ack_frame_id;
  46. +   u16 ack_frame_id:6;
  47. +   u16 tx_time_est:10;
  48.  
  49.     union {
  50.         struct {
  51. --- a/net/mac80211/cfg.c
  52. +++ b/net/mac80211/cfg.c
  53. @@ -3437,7 +3437,7 @@ int ieee80211_attach_ack_skb(struct ieee
  54.  
  55.     spin_lock_irqsave(&local->ack_status_lock, spin_flags);
  56.     id = idr_alloc(&local->ack_status_frames, ack_skb,
  57. -              1, 0x10000, GFP_ATOMIC);
  58. +              1, 0x40, GFP_ATOMIC);
  59.     spin_unlock_irqrestore(&local->ack_status_lock, spin_flags);
  60.  
  61.     if (id < 0) {
  62. --- a/net/mac80211/tx.c
  63. +++ b/net/mac80211/tx.c
  64. @@ -2731,7 +2731,7 @@ static struct sk_buff *ieee80211_build_h
  65.  
  66.             spin_lock_irqsave(&local->ack_status_lock, flags);
  67.             id = idr_alloc(&local->ack_status_frames, ack_skb,
  68. -                      1, 0x10000, GFP_ATOMIC);
  69. +                      1, 0x40, GFP_ATOMIC);
  70.             spin_unlock_irqrestore(&local->ack_status_lock, flags);
  71.  
  72.             if (id >= 0) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement