* [PATCH] wifi: ath9k: adjust ath9k_rx_prepare() and simplify ath9k_rx_tasklet()
@ 2025-01-17 8:48 Dmitry Antipov
2025-01-20 9:48 ` Toke Høiland-Jørgensen
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Antipov @ 2025-01-17 8:48 UTC (permalink / raw)
To: Toke Høiland-Jørgensen
Cc: Kalle Valo, linux-wireless, Dmitry Antipov
Adjust 'ath9k_rx_prepare()' to fill skb control buffer directly rather
than using temporary 'struct ieee80211_rx_status' in 'ath9k_rx_tasklet()',
thus making both temporary and 'memcpy()' redundant. Compile tested only.
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index ce9c04e418b8..acbcb37150eb 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -969,13 +969,12 @@ static void rx_status_htc_to_ath(struct ath_rx_status *rx_stats,
}
static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
- struct ath9k_htc_rxbuf *rxbuf,
- struct ieee80211_rx_status *rx_status)
-
+ struct ath9k_htc_rxbuf *rxbuf)
{
struct ieee80211_hdr *hdr;
struct ieee80211_hw *hw = priv->hw;
struct sk_buff *skb = rxbuf->skb;
+ struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
struct ath_common *common = ath9k_hw_common(priv->ah);
struct ath_hw *ah = common->ah;
struct ath_htc_rx_status *rxstatus;
@@ -1081,7 +1080,6 @@ void ath9k_rx_tasklet(struct tasklet_struct *t)
{
struct ath9k_htc_priv *priv = from_tasklet(priv, t, rx_tasklet);
struct ath9k_htc_rxbuf *rxbuf = NULL, *tmp_buf = NULL;
- struct ieee80211_rx_status rx_status;
struct sk_buff *skb;
unsigned long flags;
struct ieee80211_hdr *hdr;
@@ -1103,13 +1101,11 @@ void ath9k_rx_tasklet(struct tasklet_struct *t)
if (!rxbuf->skb)
goto requeue;
- if (!ath9k_rx_prepare(priv, rxbuf, &rx_status)) {
+ if (!ath9k_rx_prepare(priv, rxbuf)) {
dev_kfree_skb_any(rxbuf->skb);
goto requeue;
}
- memcpy(IEEE80211_SKB_RXCB(rxbuf->skb), &rx_status,
- sizeof(struct ieee80211_rx_status));
skb = rxbuf->skb;
hdr = (struct ieee80211_hdr *) skb->data;
--
2.48.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] wifi: ath9k: adjust ath9k_rx_prepare() and simplify ath9k_rx_tasklet()
2025-01-17 8:48 [PATCH] wifi: ath9k: adjust ath9k_rx_prepare() and simplify ath9k_rx_tasklet() Dmitry Antipov
@ 2025-01-20 9:48 ` Toke Høiland-Jørgensen
0 siblings, 0 replies; 2+ messages in thread
From: Toke Høiland-Jørgensen @ 2025-01-20 9:48 UTC (permalink / raw)
To: Dmitry Antipov; +Cc: Kalle Valo, linux-wireless, Dmitry Antipov
Dmitry Antipov <dmantipov@yandex.ru> writes:
> Adjust 'ath9k_rx_prepare()' to fill skb control buffer directly rather
> than using temporary 'struct ieee80211_rx_status' in 'ath9k_rx_tasklet()',
> thus making both temporary and 'memcpy()' redundant. Compile tested
> only.
Hmm, so the existing code follows the "perform checks, then write data"
pattern, which is generally good practice. I don't think saving a
48-byte memcpy() is worth it to deviate from this pattern. Certainly not
without testing :)
-Toke
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-20 9:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17 8:48 [PATCH] wifi: ath9k: adjust ath9k_rx_prepare() and simplify ath9k_rx_tasklet() Dmitry Antipov
2025-01-20 9:48 ` Toke Høiland-Jørgensen
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).