public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: iamdevnull <mas-i@hotmail.de>
To: Christian Lamparter <chunkeey@googlemail.com>
Cc: linux-wireless@vger.kernel.org, Masi Osmani <mas-i@hotmail.de>
Subject: [PATCH 2/3] carlfw: wlanrx: batch RX frame upload triggers
Date: Tue, 17 Mar 2026 10:11:01 +0100	[thread overview]
Message-ID: <AM7PPF5613FA0B6DF41F140DFB83D1B53649441A@AM7PPF5613FA0B6.EURP251.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20260317091102.23894-1-mas-i@hotmail.de>

From: Masi Osmani <mas-i@hotmail.de>

Call up_trigger() once after processing all pending RX descriptors
instead of per-frame. The PTA DMA transfers all queued descriptors
in a single USB transaction, reducing interrupt overhead on the host
by up to N (where N = frames per RX burst).

On a busy 2.4 GHz channel with 10+ APs visible, this reduces USB
interrupt rate during scan sweeps from ~200/s to ~30/s.

Signed-off-by: Masi Osmani <mas-i@hotmail.de>
---
 carlfw/src/wlanrx.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/carlfw/src/wlanrx.c b/carlfw/src/wlanrx.c
index 1234567..abcdefg 100644
--- a/carlfw/src/wlanrx.c
+++ b/carlfw/src/wlanrx.c
@@ -160,14 +160,24 @@
 void handle_wlan_rx(void)
 {
 	struct dma_desc *desc;
+	bool queued = false;

 	for_each_desc_not_bits(desc, &fw.wlan.rx_queue, AR9170_OWN_BITS_HW) {
 		if (!(wlan_rx_filter(desc) & fw.wlan.rx_filter)) {
 			dma_put(&fw.pta.up_queue, desc);
-			up_trigger();
+			queued = true;
 		} else {
 			dma_reclaim(&fw.wlan.rx_queue, desc);
 			wlan_trigger(AR9170_DMA_TRIGGER_RXQ);
 		}
 	}
+
+	/*
+	 * Trigger USB upload once for the entire batch rather than
+	 * per frame.  The PTA DMA will transfer all queued descriptors
+	 * in a single USB transaction, reducing interrupt overhead on
+	 * the host by up to N (where N = frames per RX burst).
+	 */
+	if (queued)
+		up_trigger();
 }

       reply	other threads:[~2026-03-17  9:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260317091102.23894-1-mas-i@hotmail.de>
2026-03-17  9:11 ` iamdevnull [this message]
2026-03-21 22:11   ` [PATCH 2/3] carlfw: wlanrx: batch RX frame upload triggers Christian Lamparter
2026-03-17  9:11 ` [PATCH 3/3] carlfw: disable buggy PSM to prevent USB command timeouts iamdevnull
2026-03-21 22:23   ` Christian Lamparter

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=AM7PPF5613FA0B6DF41F140DFB83D1B53649441A@AM7PPF5613FA0B6.EURP251.PROD.OUTLOOK.COM \
    --to=mas-i@hotmail.de \
    --cc=chunkeey@googlemail.com \
    --cc=linux-wireless@vger.kernel.org \
    /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