From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 3/4] mac80211: make TX LED handling independent of fragmentation
Date: Wed, 16 Nov 2011 15:28:57 +0100 [thread overview]
Message-ID: <20111116142911.206008880@sipsolutions.net> (raw)
In-Reply-To: 20111116142854.518391560@sipsolutions.net
From: Johannes Berg <johannes.berg@intel.com>
This just prepares for passing the entire fragment
list to the driver. No significant changes, but the
TX throughput is calculated slightly differently
now and we blink only once for each MSDU.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/tx.c | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
--- a/net/mac80211/tx.c 2011-11-16 15:16:45.000000000 +0100
+++ b/net/mac80211/tx.c 2011-11-16 15:17:19.000000000 +0100
@@ -1207,18 +1207,23 @@ ieee80211_tx_prepare(struct ieee80211_su
* Returns false if the frame couldn't be transmitted but was queued instead.
*/
static bool __ieee80211_tx(struct ieee80211_local *local,
- struct sk_buff_head *skbs,
+ struct sk_buff_head *skbs, int led_len,
struct sta_info *sta, bool txpending)
{
struct sk_buff *skb, *tmp;
struct ieee80211_tx_info *info;
struct ieee80211_sub_if_data *sdata;
unsigned long flags;
- int len;
+ __le16 fc;
+
+ if (WARN_ON(skb_queue_empty(skbs)))
+ return true;
+
+ skb = skb_peek(skbs);
+ fc = ((struct ieee80211_hdr *)skb->data)->frame_control;
skb_queue_walk_safe(skbs, skb, tmp) {
int q = skb_get_queue_mapping(skb);
- __le16 fc;
spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
if (local->queue_stop_reasons[q] ||
@@ -1241,8 +1246,6 @@ static bool __ieee80211_tx(struct ieee80
info = IEEE80211_SKB_CB(skb);
- len = skb->len;
-
sdata = vif_to_sdata(info->control.vif);
switch (sdata->vif.type) {
@@ -1263,15 +1266,13 @@ static bool __ieee80211_tx(struct ieee80
else
info->control.sta = NULL;
- fc = ((struct ieee80211_hdr *)skb->data)->frame_control;
-
__skb_unlink(skb, skbs);
drv_tx(local, skb);
-
- ieee80211_tpt_led_trig_tx(local, fc, len);
- ieee80211_led_tx(local, 1);
}
+ ieee80211_tpt_led_trig_tx(local, fc, led_len);
+ ieee80211_led_tx(local, 1);
+
WARN_ON(!skb_queue_empty(skbs));
return true;
@@ -1341,6 +1342,7 @@ static bool ieee80211_tx(struct ieee8021
ieee80211_tx_result res_prepare;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
bool result = true;
+ int led_len;
if (unlikely(skb->len < 10)) {
dev_kfree_skb(skb);
@@ -1350,6 +1352,7 @@ static bool ieee80211_tx(struct ieee8021
rcu_read_lock();
/* initialises tx */
+ led_len = skb->len;
res_prepare = ieee80211_tx_prepare(sdata, &tx, skb);
if (unlikely(res_prepare == TX_DROP)) {
@@ -1363,7 +1366,8 @@ static bool ieee80211_tx(struct ieee8021
info->band = tx.channel->band;
if (!invoke_tx_handlers(&tx))
- result = __ieee80211_tx(local, &tx.skbs, tx.sta, txpending);
+ result = __ieee80211_tx(local, &tx.skbs, led_len,
+ tx.sta, txpending);
out:
rcu_read_unlock();
return result;
@@ -2119,7 +2123,7 @@ static bool ieee80211_tx_pending_skb(str
hdr = (struct ieee80211_hdr *)skb->data;
sta = sta_info_get(sdata, hdr->addr1);
- result = __ieee80211_tx(local, &skbs, sta, true);
+ result = __ieee80211_tx(local, &skbs, skb->len, sta, true);
}
return result;
next prev parent reply other threads:[~2011-11-16 14:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-16 14:28 [PATCH 0/4] submit fragmented packets to drivers at once Johannes Berg
2011-11-16 14:28 ` [PATCH 1/4] mac80211: use skb list for fragments Johannes Berg
2011-11-16 14:28 ` [PATCH 2/4] mac80211: move fragment flag adjustment Johannes Berg
2011-11-16 14:28 ` Johannes Berg [this message]
2011-11-16 14:28 ` [PATCH 4/4] mac80211: transmit fragment list to drivers Johannes Berg
2011-11-16 14:40 ` Ivo Van Doorn
2011-11-16 14:42 ` Johannes Berg
2011-11-16 14:46 ` Ivo Van Doorn
2011-11-16 15:02 ` [PATCH v2 " Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111116142911.206008880@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).