linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luciano Coelho <coelho@ti.com>
To: Eliad Peller <eliad@wizery.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 34/40] wl12xx: schedule TX packets according to FW packet occupancy
Date: Thu, 11 Aug 2011 14:38:40 +0300	[thread overview]
Message-ID: <1313062720.2407.848.camel@cumari> (raw)
In-Reply-To: <1312881233-9366-35-git-send-email-eliad@wizery.com>

On Tue, 2011-08-09 at 12:13 +0300, Eliad Peller wrote: 
> +static struct sk_buff_head *wl1271_select_queue(struct wl1271 *wl,
> +						struct sk_buff_head *queues)
> +{
> +	int i, q = -1;
> +	u32 min_pkts = 0xffffffff;
> +
> +	/*
> +	 * Find a non-empty ac where:
> +	 * 1. There are packets to transmit
> +	 * 2. The FW has the least allocated blocks
> +	 */
> +	for (i = 0; i < NUM_TX_QUEUES; i++)
> +		if (!skb_queue_empty(&queues[i]) &&
> +		    (wl->tx_allocated_pkts[i] < min_pkts)) {
> +			q = i;
> +			min_pkts = wl->tx_allocated_pkts[q];
> +		}
> +
> +	if (q == -1)
> +		return NULL;
> +
> +	return &queues[q];
> +}

This is a nice algorithm, but now, if all queues have the same number of
allocated packets in the FW, we'll start with BE, because the enum is
like this:

enum conf_tx_ac {
CONF_TX_AC_BE = 0,         /* best effort / legacy */
CONF_TX_AC_BK = 1,         /* background */
CONF_TX_AC_VI = 2,         /* video */
CONF_TX_AC_VO = 3,         /* voice */
CONF_TX_AC_CTS2SELF = 4,   /* fictitious AC, follows AC_VO */
CONF_TX_AC_ANY_TID = 0x1f
};

...and you select the first queue in case two or more are similarly
full.

Maybe you could make the for loop go backwards instead? Or changing the
< to <= in the comparison would also work.

Another option would be to fix the enum so that it goes from higher prio
to lower prio.  If the firmware doesn't care about the actual order of
the queues and actually respects our ac_conf, this would probably be the
best solution, because we could even get rid of wl1271_tx_get_queue()
and wl1271_tx_get_mac80211_queue().

Now something else came to my mind.  Could it also happen that the other
queues would still be starved? Let's say we keep getting packets
continuously for the first queue we choose exactly at the interval it
takes the FW to empty that queue.  Meanwhile, we're getting some packets
for other queues.  In this case, we would keep selecting the same AC
because all the queues would be empty and we would keep choosing the
first one.

Maybe we should still once in a while check the other queues?

Or am I missing something again?

-- 
Cheers,
Luca.


  reply	other threads:[~2011-08-11 11:38 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-09  9:13 [PATCH 00/40] wl12xx: move to wl12xx-fw-3 Eliad Peller
2011-08-09  9:13 ` [PATCH 01/40] wl12xx: Revert "wl12xx: schedule TX packets according to FW occupancy" Eliad Peller
2011-08-09 11:54   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 02/40] wl12xx: Use a single fw for both STA and AP roles Eliad Peller
2011-08-09 11:59   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 03/40] wl12xx: use 1 spare block in all cases Eliad Peller
2011-08-09 12:03   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 04/40] wl12xx: temporarily disable 11n and advanced ap functions Eliad Peller
2011-08-09 12:49   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 05/40] wl12xx: remove rx filtering stuff Eliad Peller
2011-08-09 13:19   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 06/40] wl12xx: wl12xx-fw-3 - Update fw status struct Eliad Peller
2011-08-09 13:37   ` Luciano Coelho
2011-08-09 19:12   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 07/40] wl12xx: wl12xx-fw-3 - update acx commands Eliad Peller
2011-08-09 19:29   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 08/40] wl12xx: wl12xx-fw-3 - update commands & events Eliad Peller
2011-08-10  9:19   ` Luciano Coelho
2011-08-10  9:53     ` Eliad Peller
2011-08-10 10:26       ` Luciano Coelho
2011-08-10 10:24     ` Eliad Peller
2011-08-10 10:27       ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 09/40] wl12xx: enable/disable role on interface add/remove Eliad Peller
2011-08-10 11:32   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 10/40] wl12xx: add device role commands Eliad Peller
2011-08-10 11:54   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 11/40] wl12xx: wl12xx-fw-3 - update scan cmd api Eliad Peller
2011-08-09  9:13 ` [PATCH 12/40] wl12xx: wl12xx-fw-3 - rx/tx changes Eliad Peller
2011-08-09  9:13 ` [PATCH 13/40] wl12xx: wl12xx-fw-3 - change max/default template size Eliad Peller
2011-08-09  9:13 ` [PATCH 14/40] wl12xx: use wl1271_acx_beacon_filter_opt for both sta and ap Eliad Peller
2011-08-09  9:13 ` [PATCH 15/40] wl12xx: add set_rate_mgmt_params acx Eliad Peller
2011-08-10 12:31   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 16/40] wl12xx: add system_hlid Eliad Peller
2011-08-10 12:48   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 17/40] wl12xx: add ROC/CROC commands Eliad Peller
2011-08-10 12:57   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 18/40] wl12xx: replace dummy_join with " Eliad Peller
2011-08-10 14:31   ` Luciano Coelho
2011-08-11 11:03     ` Eliad Peller
2011-08-09  9:13 ` [PATCH 19/40] wl12xx: handle dummy packet event also in ap mode Eliad Peller
2011-08-09  9:13 ` [PATCH 20/40] wl12xx: update BT coex configuration params Eliad Peller
2011-08-10 15:16   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 21/40] wl12xx: fix session counter Eliad Peller
2011-08-10 15:20   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 22/40] wl12xx: use dynamic hlids for AP-mode Eliad Peller
2011-08-10 19:39   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 23/40] wl12xx: re-enable block ack session support Eliad Peller
2011-08-10 19:54   ` Luciano Coelho
2011-08-15  9:34   ` Levi, Shahar
2011-08-09  9:13 ` [PATCH 24/40] wl12xx: call wl1271_cmd_set_peer_state() in AP mode Eliad Peller
2011-08-09  9:13 ` [PATCH 25/40] wl12xx: don't remove key if hlid was already deleted Eliad Peller
2011-08-09  9:13 ` [PATCH 26/40] wl12xx: add wl1271_cmd_role_start_ibss() Eliad Peller
2011-08-11  7:15   ` Luciano Coelho
2011-08-09  9:13 ` [PATCH 27/40] wl12xx: support IBSS vif type Eliad Peller
2011-08-09  9:13 ` [PATCH 28/40] wl12xx: AP-mode - set STA HT capabilities when adding a STA Eliad Peller
2011-08-09  9:13 ` [PATCH 29/40] wl12xx: AP-mode - configure STA HT rates on join Eliad Peller
2011-08-09  9:13 ` [PATCH 30/40] wl12xx: AP-mode - configure HT rate support to the FW Eliad Peller
2011-08-10 20:30   ` Luciano Coelho
2011-08-11  4:39     ` Arik Nemtsov
2011-08-09  9:13 ` [PATCH 31/40] wl12xx: use ap_bcast_hlid for recorded keys Eliad Peller
2011-08-09  9:13 ` [PATCH 32/40] wl12xx: don't remove key if hlid was already deleted Eliad Peller
2011-08-09  9:13 ` [PATCH 33/40] wl12xx: track freed packets in FW by AC Eliad Peller
2011-08-11  9:17   ` Luciano Coelho
2011-08-11  9:41     ` Eliad Peller
2011-08-11 16:11       ` Arik Nemtsov
2011-08-09  9:13 ` [PATCH 34/40] wl12xx: schedule TX packets according to FW packet occupancy Eliad Peller
2011-08-11 11:38   ` Luciano Coelho [this message]
2011-08-11 20:54     ` Arik Nemtsov
2011-08-09  9:13 ` [PATCH 35/40] wl12xx: handle wrap-around overflow in released Tx blocks FW counter Eliad Peller
2011-08-09  9:13 ` [PATCH 36/40] wl12xx: enable AP advanced functionality Eliad Peller
2011-08-09  9:13 ` [PATCH 37/40] wl12xx: don't wait for disconnection event Eliad Peller
2011-08-11 11:53   ` Luciano Coelho
2011-08-11 12:30     ` Eliad Peller
2011-08-09  9:13 ` [PATCH 38/40] wl12xx: set the AP-started flag only after setting keys Eliad Peller
2011-08-09  9:13 ` [PATCH 39/40] wl12xx: AP-mode - prevent Tx to stale/invalid stations Eliad Peller
2011-08-09  9:13 ` [PATCH 40/40] wl12xx: fix tx_queue_count spurious increment Eliad Peller
2011-08-11 11:57 ` [PATCH 00/40] wl12xx: move to wl12xx-fw-3 Luciano Coelho
2011-08-11 12:31   ` Eliad Peller

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=1313062720.2407.848.camel@cumari \
    --to=coelho@ti.com \
    --cc=eliad@wizery.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;
as well as URLs for NNTP newsgroup(s).