From: Jussi Kivilinna <jussi.kivilinna@iki.fi>
To: linux-wireless@vger.kernel.org
Cc: Chaoming Li <chaoming_li@realsil.com.cn>,
"John W. Linville" <linville@tuxdriver.com>,
Larry Finger <Larry.Finger@lwfinger.net>
Subject: [PATCH 2/4] rtlwifi: usb: remove extra skb copy on RX path
Date: Sun, 17 Mar 2013 11:59:18 +0200 [thread overview]
Message-ID: <20130317095918.24983.57848.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20130317095831.24983.97107.stgit@localhost6.localdomain6>
RX path has extra copying of packets, that can be avoided.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
---
drivers/net/wireless/rtlwifi/usb.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index 146d2b4..8563818 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -513,22 +513,11 @@ static void _rtl_usb_rx_process_noagg(struct ieee80211_hw *hw,
if (unicast)
rtlpriv->link_info.num_rx_inperiod++;
}
- if (likely(rtl_action_proc(hw, skb, false))) {
- struct sk_buff *uskb = NULL;
- u8 *pdata;
-
- uskb = dev_alloc_skb(skb->len + 128);
- if (uskb) { /* drop packet on allocation failure */
- memcpy(IEEE80211_SKB_RXCB(uskb), &rx_status,
- sizeof(rx_status));
- pdata = (u8 *)skb_put(uskb, skb->len);
- memcpy(pdata, skb->data, skb->len);
- ieee80211_rx_irqsafe(hw, uskb);
- }
- dev_kfree_skb_any(skb);
- } else {
+
+ if (likely(rtl_action_proc(hw, skb, false)))
+ ieee80211_rx_irqsafe(hw, skb);
+ else
dev_kfree_skb_any(skb);
- }
}
}
next prev parent reply other threads:[~2013-03-17 9:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-17 9:59 [PATCH 0/4] rtlwifi: usb: improve RX performance and lower CPU usage Jussi Kivilinna
2013-03-17 9:59 ` [PATCH 1/4] rtlwifi: usb: use usb_alloc_coherent for RX buffers Jussi Kivilinna
2013-03-17 9:59 ` Jussi Kivilinna [this message]
2013-03-17 9:59 ` [PATCH 3/4] rtlwifi: usb: defer rx processing to tasklet Jussi Kivilinna
2013-03-17 9:59 ` [PATCH 4/4] rtlwifi: usb: add NET_IP_ALIGN padding to RX skb when needed Jussi Kivilinna
2013-04-03 17:16 ` [PATCH 0/4] rtlwifi: usb: improve RX performance and lower CPU usage Jussi Kivilinna
2013-04-03 17:32 ` John W. Linville
2013-04-03 19:19 ` Jussi Kivilinna
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=20130317095918.24983.57848.stgit@localhost6.localdomain6 \
--to=jussi.kivilinna@iki.fi \
--cc=Larry.Finger@lwfinger.net \
--cc=chaoming_li@realsil.com.cn \
--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