Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Nicolas Escande" <nico.escande@gmail.com>
To: "Zhi-Jun You" <hujy652@gmail.com>, <jjohnson@kernel.org>
Cc: <linux-wireless@vger.kernel.org>, <ath10k@lists.infradead.org>
Subject: Re: [RFC PATCH] wifi: ath10k: support flush_sta method
Date: Wed, 06 Aug 2025 16:42:48 +0200	[thread overview]
Message-ID: <DBVFA7TPXKHU.33YF5JEOR1ZLT@gmail.com> (raw)
In-Reply-To: <20250806070005.1429-1-hujy652@gmail.com>

On Wed Aug 6, 2025 at 9:00 AM CEST, Zhi-Jun You wrote:
> When a STA is marked as no longer authorized, if the driver doesn't
> implement flush_sta(), mac80211 calls ieee80211_flush_queues() to
> flush hardware queues to avoid sending unencrypted frames.
>
> This has became a problem for ath10k because ieee80211_flush_queues()
> will stop all traffic and call ath10k_flush, which waits until the
> whole HW queue is empty. In a busy environment this will trigger a
> timeout warning and stalls other STAs.
>
> Fix this by implementing flush_sta method using WMI command to flush
> frames of a specific STA.
> Flushed frames will be marked as discard in tx complete indication.
>
> ops->flush_sta will be set to NULL if htt.disable_tx_comp is set to
> true.
>
> Tested-on: QCA9984 hw1.0 PCI 10.4-3.9.0.2-00157
>
> Signed-off-by: Zhi-Jun You <hujy652@gmail.com>
> ---
>  drivers/net/wireless/ath/ath10k/mac.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
> index 24dd794e31ea..6959f20334a7 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -8135,6 +8135,20 @@ static void ath10k_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
>  	mutex_unlock(&ar->conf_mutex);
>  }
>  
> +static void ath10k_mac_op_flush_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
> +			     struct ieee80211_sta *sta)
> +{
> +	struct ath10k_vif *arvif = (void *)vif->drv_priv;
> +	struct ath10k *ar = hw->priv;
> +	u32 bitmap = 0xFFFFFFFF;
> +	int ret = 0;
> +
> +	ret = ath10k_wmi_peer_flush(ar, arvif->vdev_id, sta->addr, bitmap);
> +	if (ret)
> +		ath10k_warn(ar, "failed to flush sta (sta %pM)\n",
> +			    sta->addr);

Hello,

Just to be sure, you have seen real improvements from this ?
Because I remember trying this exact WMI command two years ago and I couldn't be
sure it was actually doing something. That's one of the reasons why we ended up
doing the per peer frame accounting as posted by remi here
https://lore.kernel.org/linux-wireless/17d26d6a3e80ff03939ee7935fdc07f979b61a4f.1732293922.git.repk@triplefau.lt/

Thanks

  parent reply	other threads:[~2025-08-06 14:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06  7:00 [RFC PATCH] wifi: ath10k: support flush_sta method Zhi-Jun You
2025-08-06 14:23 ` Jeff Johnson
2025-08-06 15:51   ` Zhi-Jun You
2025-08-06 19:18     ` Nicolas Escande
2025-08-06 14:42 ` Nicolas Escande [this message]
2025-08-06 16:27   ` Zhi-Jun You
2025-08-12 14:02 ` Maurer, Florian

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=DBVFA7TPXKHU.33YF5JEOR1ZLT@gmail.com \
    --to=nico.escande@gmail.com \
    --cc=ath10k@lists.infradead.org \
    --cc=hujy652@gmail.com \
    --cc=jjohnson@kernel.org \
    --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