From: Mor Bar-Gabay <morx.bar.gabay@intel.com>
To: "Abdul Rahim, Faizal" <faizal.abdul.rahim@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: <intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Simon Horman <horms@kernel.org>,
Faizal Rahim <faizal.abdul.rahim@linux.intel.com>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
Chwee-Lin Choong <chwee.lin.choong@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v3 5/7] igc: add private flag to reverse TX queue priority in TSN mode
Date: Thu, 29 May 2025 10:23:23 +0300 [thread overview]
Message-ID: <12318cdb-afa9-4fdb-b6d7-6568b31c1817@intel.com> (raw)
In-Reply-To: <20250519071911.2748406-6-faizal.abdul.rahim@intel.com>
On 19/05/2025 10:19, Abdul Rahim, Faizal wrote:
> From: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
>
> By default, igc assigns TX hw queue 0 the highest priority and queue 3
> the lowest. This is opposite of most NICs, where TX hw queue 3 has the
> highest priority and queue 0 the lowest.
>
> mqprio in igc already uses TX arbitration unconditionally to reverse TX
> queue priority when mqprio is enabled. The TX arbitration logic does not
> require a private flag, because mqprio was added recently and no known
> users depend on the default queue ordering, which differs from the typical
> convention.
>
> taprio does not use TX arbitration, so it inherits the default igc TX
> queue priority order. This causes tc command inconsistencies when
> configuring frame preemption with taprio compared to mqprio in igc.
> Other tc command inconsistencies and configuration issues already exist
> when using taprio on igc compared to other network controllers. These
> issues are described in a later section.
>
> To harmonize TX queue priority behavior between taprio and mqprio, and
> to fix these issues without breaking long-standing taprio use cases,
> this patch adds a new private flag, called reverse-tsn-txq-prio, to
> reverse the TX queue priority. It makes queue 3 the highest and queue 0
> the lowest, reusing the TX arbitration logic already used by mqprio.
>
> Users must set the private flag when enabling frame preemption with
> taprio to follow the standard convention. Doing so promotes adoption of
> the correct priority model for new features while preserving
> compatibility with legacy configurations.
>
> This new private flag addresses:
>
> 1. Non-standard socket → tc → TX hw queue mapping for taprio in igc
>
> Without the private flag:
> - taprio maps (socket → tc → TX hardware queue) differently on igc
> compared to other network controllers
> - On igc, mqprio maps tc differently from taprio, since mqprio already
> uses TX arbitration
>
> The following examples compare taprio configuration on igc and other
> network controllers:
> a) On other NICs (TX hw queue 3 is highest priority):
> taprio num_tc 4 map 0 1 2 3 .... \
> queues 1@0 1@1 1@2 1@3
>
> Mapping translates to:
> socket 0 → tc 0 → queue 0
> socket 3 → tc 3 → queue 3
>
> This is the normal mapping that respects the standard convention:
> higher socket number → higher tc -> higher priority TX hw queue
>
> b) On igc (TX hw queue 0 is highest priority by default):
> taprio num_tc 4 map 3 2 1 0 .... \
> queues 1@0 1@1 1@2 1@3
>
> Mapping translates to:
> socket 0 → tc 3 → queue 3
> socket 3 → tc 0 → queue 0
>
> This igc tc mapping example is based on Intel's TSN validation test
> case, where a higher socket priority maps to a higher priority queue.
> It respects the mapping:
> higher socket number -> higher priority TX hw queue
> but breaks the expected ordering:
> higher tc -> higher priority TX hw queue
> as defined in [Ref1]. This custom mapping complicates common taprio
> setup across NICs.
>
> 2. Non-standard frame preemption mapping for taprio in igc
>
> Without the private flag:
> - Compared to other network controllers, taprio on igc must flip the
> expected fp sequence, since express traffic is expected to map to the
> highest priority queue and preemptible traffic to lower ones
> - On igc, frame preemption configuration for mqprio differs from taprio,
> since mqprio already uses TX arbitration
>
> The following examples compare taprio frame preemption configuration on
> igc and other network controllers:
> a) On other NICs (TX hw queue 3 is highest priority):
> taprio num_tc 4 map ..... \
> queues 1@0 1@1 1@2 1@3 \
> fp P P P E
>
> Mapping translates to:
> tc0, tc1, tc2 → preemptible → queue 0, 1, 2
> tc3 → express → queue 3
>
> This is the normal mapping that respects the standard convention:
> higher tc -> express traffic -> higher priority TX hw queue
> lower tc -> preemptible traffic -> lower priority TX hw queue
>
> b) On igc (TX hw queue 0 is highest priority by default):
> taprio num_tc 4 map ...... \
> queues 1@0 1@1 1@2 1@3 \
> fp E P P P
>
> Mapping translates to:
> tc0 → express → queue 0
> tc1, tc2, tc3 → preemptible → queue 1, 2, 3
>
> This inversion respects the mapping of:
> express traffic -> higher priority TX hw queue
> but breaks the expected ordering:
> higher tc -> express traffic
> as defined in [Ref1] where higher tc indicates higher priority. In
> this case, the lower tc0 is assigned to express traffic. This custom
> mapping further complicates common preemption setup across NICs.
>
> Tests were performed on taprio with the following combinations, where
> two apps send traffic simultaneously on different queues:
>
> Private Flag Traffic Sent By Traffic Sent By
> ----------------------------------------------------------------
> enabled iperf3 (queue 3) iperf3 (queue 0)
> disabled iperf3 (queue 0) iperf3 (queue 3)
> enabled iperf3 (queue 3) real-time app (queue 0)
> disabled iperf3 (queue 0) real-time app (queue 3)
> enabled real-time app (queue 3) iperf3 (queue 0)
> disabled real-time app (queue 0) iperf3 (queue 3)
> enabled real-time app (queue 3) real-time app (queue 0)
> disabled real-time app (queue 0) real-time app (queue 3)
>
> Private flag is controlled with:
> ethtool --set-priv-flags enp1s0 reverse-tsn-txq-prio <on|off>
>
> [Ref1]
> IEEE 802.1Q clause 8.6.8 Transmission selection:
> "For a given Port and traffic class, frames are selected from the
> corresponding queue for transmission if and only if:
> ...
> b) For each queue corresponding to a numerically higher value of traffic
> class supported by the Port, the operation of the transmission selection
> algorithm supported by that queue determines that there is no frame
> available for transmission."
>
> Reviewed-by: Simon Horman <horms@kernel.org>
> Signed-off-by: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
> ---
> drivers/net/ethernet/intel/igc/igc.h | 1 +
> drivers/net/ethernet/intel/igc/igc_ethtool.c | 12 ++++++++++--
> drivers/net/ethernet/intel/igc/igc_main.c | 3 ++-
> drivers/net/ethernet/intel/igc/igc_tsn.c | 3 ++-
> 4 files changed, 15 insertions(+), 4 deletions(-)
>
Tested-by: Mor Bar-Gabay <morx.bar.gabay@intel.com>
next prev parent reply other threads:[~2025-05-29 7:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-19 7:19 [PATCH iwl-next v3 0/7] igc: harmonize queue priority and add preemptible queue support Abdul Rahim, Faizal
2025-05-19 7:19 ` [PATCH iwl-next v3 1/7] igc: move TXDCTL and RXDCTL related macros Abdul Rahim, Faizal
2025-05-29 7:18 ` [Intel-wired-lan] " Mor Bar-Gabay
2025-05-19 7:19 ` [PATCH iwl-next v3 2/7] igc: add DCTL prefix to " Abdul Rahim, Faizal
2025-05-29 7:19 ` [Intel-wired-lan] " Mor Bar-Gabay
2025-05-19 7:19 ` [PATCH iwl-next v3 3/7] igc: refactor TXDCTL macros to use FIELD_PREP and GEN_MASK Abdul Rahim, Faizal
2025-05-29 7:20 ` [Intel-wired-lan] " Mor Bar-Gabay
2025-05-19 7:19 ` [PATCH iwl-next v3 4/7] igc: assign highest TX queue number as highest priority in mqprio Abdul Rahim, Faizal
2025-05-29 7:21 ` [Intel-wired-lan] " Mor Bar-Gabay
2025-05-19 7:19 ` [PATCH iwl-next v3 5/7] igc: add private flag to reverse TX queue priority in TSN mode Abdul Rahim, Faizal
2025-05-29 7:23 ` Mor Bar-Gabay [this message]
2025-05-19 7:19 ` [PATCH iwl-next v3 6/7] igc: add preemptible queue support in taprio Abdul Rahim, Faizal
2025-05-20 8:18 ` Simon Horman
2025-05-29 7:24 ` [Intel-wired-lan] " Mor Bar-Gabay
2025-05-19 7:19 ` [PATCH iwl-next v3 7/7] igc: add preemptible queue support in mqprio Abdul Rahim, Faizal
2025-05-20 8:18 ` Simon Horman
2025-05-29 7:25 ` [Intel-wired-lan] " Mor Bar-Gabay
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=12318cdb-afa9-4fdb-b6d7-6568b31c1817@intel.com \
--to=morx.bar.gabay@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=chwee.lin.choong@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=faizal.abdul.rahim@intel.com \
--cc=faizal.abdul.rahim@linux.intel.com \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=vladimir.oltean@nxp.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;
as well as URLs for NNTP newsgroup(s).