Commit f498f6ab authored by Johannes Berg's avatar Johannes Berg

wifi: mac80211: rework ack_frame_id handling a bit

Take one more free bit to indicate it's IDR vs. internal
usage, to be able to carve out some bits here for other
internal usage, other than IDR handling with a full ACK
SKB, that is.
Reviewed-by: default avatarBenjamin Berg <benjamin.berg@intel.com>
Reviewed-by: default avatarIlan Peer <ilan.peer@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 0499bead
...@@ -1115,7 +1115,9 @@ ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *rate) ...@@ -1115,7 +1115,9 @@ ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *rate)
* not valid if the interface is an MLD since we won't know which * not valid if the interface is an MLD since we won't know which
* link the frame will be transmitted on * link the frame will be transmitted on
* @hw_queue: HW queue to put the frame on, skb_get_queue_mapping() gives the AC * @hw_queue: HW queue to put the frame on, skb_get_queue_mapping() gives the AC
* @ack_frame_id: internal frame ID for TX status, used internally * @status_data: internal data for TX status handling, assigned privately,
* see also &enum ieee80211_status_data for the internal documentation
* @status_data_idr: indicates status data is IDR allocated ID for ack frame
* @tx_time_est: TX time estimate in units of 4us, used internally * @tx_time_est: TX time estimate in units of 4us, used internally
* @control: union part for control data * @control: union part for control data
* @control.rates: TX rates array to try * @control.rates: TX rates array to try
...@@ -1155,10 +1157,11 @@ struct ieee80211_tx_info { ...@@ -1155,10 +1157,11 @@ struct ieee80211_tx_info {
/* common information */ /* common information */
u32 flags; u32 flags;
u32 band:3, u32 band:3,
ack_frame_id:13, status_data_idr:1,
status_data:13,
hw_queue:4, hw_queue:4,
tx_time_est:10; tx_time_est:10;
/* 2 free bits */ /* 1 free bit */
union { union {
struct { struct {
......
...@@ -4034,7 +4034,8 @@ int ieee80211_attach_ack_skb(struct ieee80211_local *local, struct sk_buff *skb, ...@@ -4034,7 +4034,8 @@ int ieee80211_attach_ack_skb(struct ieee80211_local *local, struct sk_buff *skb,
return -ENOMEM; return -ENOMEM;
} }
IEEE80211_SKB_CB(skb)->ack_frame_id = id; IEEE80211_SKB_CB(skb)->status_data_idr = 1;
IEEE80211_SKB_CB(skb)->status_data = id;
*cookie = ieee80211_mgmt_tx_cookie(local); *cookie = ieee80211_mgmt_tx_cookie(local);
IEEE80211_SKB_CB(ack_skb)->ack.cookie = *cookie; IEEE80211_SKB_CB(ack_skb)->ack.cookie = *cookie;
......
...@@ -85,6 +85,11 @@ extern const u8 ieee80211_ac_to_qos_mask[IEEE80211_NUM_ACS]; ...@@ -85,6 +85,11 @@ extern const u8 ieee80211_ac_to_qos_mask[IEEE80211_NUM_ACS];
#define IEEE80211_MAX_NAN_INSTANCE_ID 255 #define IEEE80211_MAX_NAN_INSTANCE_ID 255
enum ieee80211_status_data {
IEEE80211_STATUS_TYPE_MASK = 0x00f,
IEEE80211_STATUS_TYPE_INVALID = 0,
IEEE80211_STATUS_SUBDATA_MASK = 0xff0,
};
/* /*
* Keep a station's queues on the active list for deficit accounting purposes * Keep a station's queues on the active list for deficit accounting purposes
......
...@@ -633,7 +633,7 @@ static void ieee80211_report_ack_skb(struct ieee80211_local *local, ...@@ -633,7 +633,7 @@ static void ieee80211_report_ack_skb(struct ieee80211_local *local,
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&local->ack_status_lock, flags); spin_lock_irqsave(&local->ack_status_lock, flags);
skb = idr_remove(&local->ack_status_frames, info->ack_frame_id); skb = idr_remove(&local->ack_status_frames, info->status_data);
spin_unlock_irqrestore(&local->ack_status_lock, flags); spin_unlock_irqrestore(&local->ack_status_lock, flags);
if (!skb) if (!skb)
...@@ -759,7 +759,7 @@ static void ieee80211_report_used_skb(struct ieee80211_local *local, ...@@ -759,7 +759,7 @@ static void ieee80211_report_used_skb(struct ieee80211_local *local,
} }
rcu_read_unlock(); rcu_read_unlock();
} else if (info->ack_frame_id) { } else if (info->status_data_idr) {
ieee80211_report_ack_skb(local, skb, acked, dropped, ieee80211_report_ack_skb(local, skb, acked, dropped,
ack_hwtstamp); ack_hwtstamp);
} }
......
...@@ -2942,7 +2942,10 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, ...@@ -2942,7 +2942,10 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
info->flags = info_flags; info->flags = info_flags;
info->ack_frame_id = info_id; if (info_id) {
info->status_data = info_id;
info->status_data_idr = 1;
}
info->band = band; info->band = band;
if (likely(!cookie)) { if (likely(!cookie)) {
...@@ -4639,9 +4642,12 @@ static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata, ...@@ -4639,9 +4642,12 @@ static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata,
} }
if (unlikely(skb->sk && if (unlikely(skb->sk &&
skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)) skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)) {
info->ack_frame_id = ieee80211_store_ack_skb(local, skb, info->status_data = ieee80211_store_ack_skb(local, skb,
&info->flags, NULL); &info->flags, NULL);
if (info->status_data)
info->status_data_idr = 1;
}
dev_sw_netstats_tx_add(dev, skbs, len); dev_sw_netstats_tx_add(dev, skbs, len);
sta->deflink.tx_stats.packets[queue] += skbs; sta->deflink.tx_stats.packets[queue] += skbs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment