mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Enver Ikromov <owner@ph4ntom-rev.uz>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH rtw-next v5 07/10] wifi: rtw89: send injected control frames through the management path
Date: Mon, 16 Nov 2026 02:14:36 +0000	[thread overview]
Message-ID: <0a32e2d1a6d745a88f1a814c5bf145cc@realtek.com> (raw)
In-Reply-To: <20261113235211.1911-8-owner@ph4ntom-rev.uz>


Enver Ikromov <owner@ph4ntom-rev.uz> wrote:
> rtw89_core_get_tx_type() classifies every frame that is neither a
> management nor a null-data frame as data. Injected control frames
> such as a 10-byte ACK or 16-byte RTS therefore go through
> rtw89_core_tx_update_data_info(), which derives a TID and data queue
> from skb->priority and enables AMPDU/QoS related descriptor fields
> that make no sense for them.

Original design is only to send urgent packets via MGMT queue, and
I think no control frame sent vi driver. Instead, firmware/hardware
will sent them.

Did you encounter real problem if CTS/RST goes via AC queue?
I just don't want much conditions in data path.

> 
> Classify injected non-data frames as management frames. Frames
> generated by mac80211 itself, such as BlockAckReq, are not affected.

Did you actually see driver sends control frames generated by mac80211?
If so, when and how?

> 
> In addition, rtw89_core_tx_update_desc_info() reads hdr->seq_ctrl at
> offset 22 for every frame. Control frames have no sequence control
> field and are shorter than 24 bytes, so only read hdr->seq_ctrl from
> non-control frames whose linear header is long enough to carry it.

I think all control frames have no sequence control, just fill seq=0
for them?

> 
> Signed-off-by: Enver Ikromov <owner@ph4ntom-rev.uz>
> ---
>  drivers/net/wireless/realtek/rtw89/core.c | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
> index 54605f7..7003c24 100644
> --- a/drivers/net/wireless/realtek/rtw89/core.c
> +++ b/drivers/net/wireless/realtek/rtw89/core.c
> @@ -637,12 +637,21 @@ static enum rtw89_core_tx_type
>  rtw89_core_get_tx_type(struct rtw89_dev *rtwdev,
>                        struct sk_buff *skb)
>  {
> +       struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
>         struct ieee80211_hdr *hdr = (void *)skb->data;
>         __le16 fc = hdr->frame_control;
> 
>         if (ieee80211_is_mgmt(fc) || ieee80211_is_any_nullfunc(fc))
>                 return RTW89_CORE_TX_TYPE_MGMT;
> 
> +       /* Injected control frames have no QoS/TID and no data payload, so
> +        * send them through the management path. Control frames built by
> +        * mac80211 itself (e.g. BlockAckReq) keep using the data path.
> +        */

The code self-explain it is injection, no need comment.

But I still wonder this is required? Any problem without this?

> +       if (unlikely(info->flags & IEEE80211_TX_CTL_INJECTED) &&
> +           !ieee80211_is_data(fc))
> +               return RTW89_CORE_TX_TYPE_MGMT;
> +
>         return RTW89_CORE_TX_TYPE_DATA;
>  }
> 
> @@ -1299,7 +1308,7 @@ rtw89_core_tx_update_desc_info(struct rtw89_dev *rtwdev,
>         enum btc_pkt_type pkt_type;
>         bool upd_wlan_hdr = false;
>         bool is_bmc;
> -       u16 seq;
> +       u16 seq = 0;
> 
>         desc_info->pkt_size = skb->len;
> 
> @@ -1315,7 +1324,10 @@ rtw89_core_tx_update_desc_info(struct rtw89_dev *rtwdev,
>         else if (tx_req->vif)
>                 desc_info->mlo = ieee80211_vif_is_mld(tx_req->vif);
> 
> -       seq = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4;
> +       /* control frames (e.g. 10-byte ACK/CTS) have no sequence control */
> +       if (!ieee80211_is_ctl(hdr->frame_control) &&
> +           skb_headlen(skb) >= sizeof(struct ieee80211_hdr_3addr))
> +               seq = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4;

If my thought is correct, here can just

	if (ieee80211_is_ctl(hdr->frame_control))
		seq = 0;
	else
		seq = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4;

>         addr_cam = rtw89_get_addr_cam_of(tx_req->rtwvif_link,
>                                          tx_req->rtwsta_link);
>         if (addr_cam->valid && desc_info->mlo)
> --
> 2.56.0.windows.4
> 


  reply	other threads:[~2026-11-16  2:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 23:52 [PATCH rtw-next v5 00/10] wifi: rtw89: monitor mode RX filter and raw frame injection fixes Enver Ikromov
2026-11-13 23:52 ` [PATCH rtw-next v5 01/10] wifi: rtw89: avoid NULL vif dereference in rtw89_ops_tx() Enver Ikromov
2026-11-15  3:23   ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 02/10] wifi: rtw89: handle negative rate index for injected frames Enver Ikromov
2026-11-15  3:38   ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 03/10] wifi: rtw89: fix RX filter configuration for monitor mode Enver Ikromov
2026-11-15  3:48   ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 04/10] wifi: rtw89: protect pure_monitor_mode_vif with RCU Enver Ikromov
2026-11-15  4:00   ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 05/10] wifi: rtw89: use AP self role for monitor interfaces Enver Ikromov
2026-11-15  4:08   ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 06/10] wifi: rtw89: transmit frames from " Enver Ikromov
2026-11-16  1:35   ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 07/10] wifi: rtw89: send injected control frames through the management path Enver Ikromov
2026-11-16  2:14   ` Ping-Ke Shih [this message]
2026-11-13 23:52 ` [PATCH rtw-next v5 08/10] wifi: rtw89: skip host-side TX hooks for injected frames Enver Ikromov
2026-11-16  2:20   ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 09/10] wifi: rtw89: honor ASSIGN_SEQ, retries, and NO_ACK " Enver Ikromov
2026-11-13 23:52 ` [PATCH rtw-next v5 10/10] wifi: rtw89: restore channel when leaving idle on non-chanctx devices Enver Ikromov
2026-11-15  3:12 ` [PATCH rtw-next v5 00/10] wifi: rtw89: monitor mode RX filter and raw frame injection fixes Ping-Ke Shih

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=0a32e2d1a6d745a88f1a814c5bf145cc@realtek.com \
    --to=pkshih@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=owner@ph4ntom-rev.uz \
    /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

all inboxes | Powered by JetHome®