From: Felix Fietkau <nbd@nbd.name>
To: Vivek Chettri <vchettri@qti.qualcomm.com>,
Bhagavathi Perumal S <bhagavathi.pillai@oss.qualcomm.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "johannes@sipsolutions.net" <johannes@sipsolutions.net>,
"ripan.deuri@oss.qualcomm.com" <ripan.deuri@oss.qualcomm.com>,
"vivek.chettri@oss.qualcomm.com" <vivek.chettri@oss.qualcomm.com>
Subject: Re: [RFC PATCH 00/15] wifi: SCS and MSCS
Date: Sun, 13 Sep 2026 23:19:18 +0200 [thread overview]
Message-ID: <43012c2f-3623-4211-b2de-de53e39df2e9@nbd.name> (raw)
In-Reply-To: <CH0PR02MB8168357184D7A6354A24A338F1BC2@CH0PR02MB8168.namprd02.prod.outlook.com>
Hi Vivek,
On 13.09.26 21:23, Vivek Chettri wrote:
> The preference for reusing existing packet-classification infrastructure is driven by the need to have a centralized policy management and policy framework that operates across both software and hardware-offloaded forwarding paths, rather than introducing a separate classifier within the WLAN stack.
>
> 1. Centralized QoS and Policy Management
>
> A centralized policy management framework provides the following advantages:
>
> • A centralized policy database enables end-to-end QoS policy enforcement across
> different forwarding paths, improving manageability and policy visibility
> throughout the system.
>
> • SCS/MSCS policies represent only one source of policy management.
> Administrators may also configure firewall, QoS, or other policies that must
> coexist with negotiated WLAN policies.
>
> • Centralized policy management provides clear visibility into the interaction
> between administrator-defined policies and dynamically negotiated SCS/MSCS
> policies, making conflicts easier to detect and manage.
>
> • Implementing packet prioritization independently within mac80211 can introduce
> policy conflicts or ambiguous precedence when administrator-defined QoS
> policies overlap with SCS/MSCS-derived priorities.
>
> • A common policy framework helps ensure consistent behavior across software
> forwarding, bridging, routing, and hardware-offloaded data paths.
I don't think any of this really conflicts with my proposal.
A full end-to-end policy framework seems out of scope for direct
implementation in hostapd anyway, so it should be an external component.
hostapd should allow deferring management and policy decisions of
client-requested SCS/MSCS exchanges to external components anyway to
support things like EasyMesh well.
Having this separation would help if you intend to push flow
classification for things like wired upstream links, which hostapd
should not worry about at all.
In such a scenario, a custom implementation could choose to omit passing
full classifiers to mac80211.
That said, for most common use cases, including standalone APs and
simpler EasyMesh implementations, I believe that using the mac80211
support that I added is the right choice due to the lower complexity and
overhead.
> 2. Policy Framework: Considerations and Challenges
>
> A policy framework should help ensure consistent behavior across software
> forwarding, bridging, routing, and hardware-offloaded data paths.
>
> The policy framework can be realized using either nftables or tc-flower.
> Both approaches provide a persistent and centralized repository for traffic
> classification and policy enforcement, but differ in integration complexity,
> feature scope, and deployment model.
>
> Common Capabilities: nftables and tc-flower
>
> • Both nftables and tc-flower maintain centralized rule databases for traffic
> classification and policy enforcement.
>
> • For software-forwarded traffic, both solutions require flow lookups against
> installed rules and therefore have broadly comparable classification
> overhead.
>
> • Both mechanisms can serve as the policy enforcement layer for
> SCS/MSCS-derived traffic policies.
>
> Advantages of nftables
>
> • nftables provides a unified framework for firewalling, traffic
> classification, and QoS policy marking.
>
> • nftables can support both software and hardware-accelerated forwarding
> paths and can be extended to additional offload scenarios with minimal
> architectural changes.
>
> • Existing support for nftables-based policy handling in hostapd reduces
> integration effort and leverages infrastructure that is already available
> and upstream-ready.
>
> The implementation is done using libmnl, which avoids licensing
> incompatibility between hostapd (BSD-3-Clause) and libnftnl (GPLv2).
> This approach was also reviewed with Jouni.
>
> • Using nftables allows SCS/MSCS policies to be integrated into a broader,
> system-wide policy framework rather than introducing a WLAN-specific
> policy engine.
>
> • Using nftables can also facilitate scalability by allowing these rules to
> be applied at software acceleration decision-making stages. For example,
> the NFT rule can be cleanly integrated into NFT flow tables as well.
>
> Challenges with a tc-flower-based Approach
>
> • A tc-flower solution would require substantial additional implementation
> for rule programming from hostapd.
>
> • tc-flower typically requires qdisc configuration (at a minimum, a clsact
> pseudo qdisc) before classification rules can be installed and enforced.
Most of these points are very abstract and in my opinion gloss over a
lot of implementation complexity. I'd argue that just because nftables
is used to enable offloading in some setups doesn't mean that it handles
the different policy aspects of SCS and especially MSCS well, or
provides good ways to deal with runtime changes to existing flows.
I get the impression that your proposal is designed to handle the needs
of a single Qualcomm implementation of an out-of-tree policy framework
service well, while neglecting in-tree kernel offload mechanisms, as
well as standalone AP implementations by pushing extra complexity there.
Let me give you a specific example. On OpenWrt, Ethernet -> WLAN bridge
hw flow acceleration works by having a user space daemon that replicates
the bridge state, measures L2 flows via eBPF and programs no-sw
tc-flower offload rules for L2 flows.
On the MTK driver side, the offload core uses the programmed L2 rules to
trigger actual hw forwarding.
Only for routing/NAT flow offload does nftables get used.
The kernel side is fully implemented in upstream kernels without any
out-of-tree subsystems.
The forwarding from Ethernet to WLAN works because the kernel code can
resolve the hardware path via dev_fill_forward_path and query the
relevant metadata (which happens by calling into the WLAN driver through
mac80211).
In the series that I've built on top of this one (but not yet posted),
the offload core driver can additionally query the classifier result for
a flow at the point where it enables actual offloading (the trigger is
PPS threshold exceeded). This works because mac80211 has the active
classifiers, allowing the WLAN driver to provide them to the offload
core driver.
This design allows transparently respecting the SCS/MSCS classifier for
hw offloaded flows regardless of which API was used to trigger offload
(tc or nftables).
Additionally, the user space components handling the offload for both
approches do not have to worry about SCS/MSCS in any way.
I don't see how your hostapd programmed nftables rules approach would
handle the same properly.
> 3. Summary
>
> • The primary role of SCS/MSCS handling within the WLAN subsystem should be
> to negotiate and manage QoS policies between the AP and STA.
>
> • Packet classification and policy enforcement should be delegated to a
> centralized policy framework such as nftables, which is already designed
> to manage system-wide traffic policies.
>
> • The WLAN driver remains responsible for mapping classified traffic to the
> appropriate transmission priorities and ensuring the negotiated QoS
> behavior is achieved across the data path.
>
> Also, what is the plan for supporting repeaters and backend devices?
Not sure what you mean by backend devices. For repeaters I would use a
software component (preferably outside of hostapd/wpa_supplicant but
interacting with both), which acts as a repeater for SCS policies
requested by local clients (pushing them to the upstream AP) and tells
hostapd to install local descriptors where local classification is needed.
If you have concerns about specific scenarios, please describe them to me.
Thanks,
- Felix
prev parent reply other threads:[~2026-09-13 21:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 8:45 [RFC PATCH 00/15] wifi: SCS and MSCS Felix Fietkau
2026-09-02 8:45 ` [RFC PATCH 01/15] wifi: cfg80211: add the TCLAS element parsers Felix Fietkau
2026-09-02 8:45 ` [RFC PATCH 02/15] wifi: cfg80211: add the flow parser and the MSCS key Felix Fietkau
2026-09-02 8:45 ` [RFC PATCH 03/15] wifi: cfg80211: add the SCS evaluator Felix Fietkau
2026-09-02 8:45 ` [RFC PATCH 04/15] wifi: cfg80211: add SCS and MSCS request validation Felix Fietkau
2026-09-02 8:46 ` [RFC PATCH 05/15] wifi: cfg80211: add set_scs and set_mscs driver ops Felix Fietkau
2026-09-02 8:46 ` [RFC PATCH 06/15] wifi: cfg80211: add SCS and MSCS configuration commands Felix Fietkau
2026-09-02 8:46 ` [RFC PATCH 07/15] wifi: cfg80211: add KUnit tests for the SCS classifier Felix Fietkau
2026-09-02 8:46 ` [RFC PATCH 08/15] wifi: mac80211: add SCS and MSCS rule storage Felix Fietkau
2026-09-02 8:46 ` [RFC PATCH 09/15] wifi: mac80211: classify transmitted MSDUs with SCS Felix Fietkau
2026-09-02 8:46 ` [RFC PATCH 10/15] wifi: mac80211: learn MSCS flows on receive Felix Fietkau
2026-09-02 8:46 ` [RFC PATCH 11/15] wifi: mac80211: apply MSCS on transmit Felix Fietkau
2026-09-02 8:46 ` [RFC PATCH 12/15] wifi: mac80211: add the sta_set_scs driver op Felix Fietkau
2026-09-02 8:46 ` [RFC PATCH 13/15] wifi: mac80211: add SCS and MSCS debugfs files Felix Fietkau
2026-09-02 8:46 ` [RFC PATCH 14/15] wifi: mac80211_hwsim: support SCS and MSCS Felix Fietkau
2026-09-02 8:46 ` [RFC PATCH 15/15] wifi: mt76: mt7996: apply the SCS traffic description Felix Fietkau
[not found] ` <4c3aee64-d289-4648-9520-edb6518b3d13@oss.qualcomm.com>
2026-09-09 13:55 ` [RFC PATCH 00/15] wifi: SCS and MSCS Felix Fietkau
2026-09-13 19:23 ` Vivek Chettri
2026-09-13 21:19 ` Felix Fietkau [this message]
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=43012c2f-3623-4211-b2de-de53e39df2e9@nbd.name \
--to=nbd@nbd.name \
--cc=bhagavathi.pillai@oss.qualcomm.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=ripan.deuri@oss.qualcomm.com \
--cc=vchettri@qti.qualcomm.com \
--cc=vivek.chettri@oss.qualcomm.com \
/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