[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250814071058.3062453-1-vineeth.karumanchi@amd.com>
Date: Thu, 14 Aug 2025 12:40:56 +0530
From: Vineeth Karumanchi <vineeth.karumanchi@....com>
To: <git@....com>, <nicolas.ferre@...rochip.com>, <claudiu.beznea@...on.dev>,
<andrew+netdev@...n.ch>, <davem@...emloft.net>, <edumazet@...gle.com>,
<kuba@...nel.org>, <pabeni@...hat.com>
CC: <vineeth.karumanchi@....com>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH v2 net-next 0/2] net: macb: Add TAPRIO traffic scheduling support
Implement Time-Aware Traffic Scheduling (TAPRIO) offload support
for Cadence MACB/GEM ethernet controllers to enable IEEE 802.1Qbv
compliant time-sensitive networking (TSN) capabilities.
Key features implemented:
- Complete TAPRIO qdisc offload infrastructure with TC_SETUP_QDISC_TAPRIO
- Hardware-accelerated time-based gate control for multiple queues
- Enhanced Scheduled Traffic (ENST) register configuration and management
- Gate state scheduling with configurable start times, on/off intervals
- Support for cycle-time based traffic scheduling with validation
- Hardware capability detection via MACB_CAPS_QBV flag
- Robust error handling and parameter validation
- Queue-specific timing register programming
(ENST_START_TIME, ENST_ON_TIME, ENST_OFF_TIME)
Changes include:
- Add enst_ns_to_hw_units(): Converts nanoseconds to hardware units
- Add enst_max_hw_interval(): Returns max interval for given speed
- Add macb_taprio_setup_replace() for TAPRIO configuration
- Add macb_taprio_destroy() for cleanup and reset
- Add macb_setup_tc() as TC offload entry point
- Enable NETIF_F_HW_TC feature for QBV-capable hardware
- Add ENST register offsets to queue configuration
The implementation validates timing constraints against hardware limits,
supports per-queue gate mask configuration, and provides comprehensive
logging for debugging and monitoring. Hardware registers are programmed
atomically with proper locking to ensure consistent state.
Tested on Xilinx Versal platforms with QBV-capable MACB controllers.
Signed-off-by: Vineeth Karumanchi <vineeth.karumanchi@....com>
---
v2:
- Merged patches as per the suggestion
- Removed GEM_ENST_DISABLE_QUEUE() and GEM_ENST_ENABLE_QUEUE()
- Renamed queue_enst_config/macb_queue_enst_config,
reordered elements to reduce padding
- Moved queue->ENST_* params outside of if (hw_q) block for clarity
- Cleaned up extra spaces and fixed indentation
- Removed redundant num_queues check in macb_taprio_setup_replace()
- leveraged scope_guard as per netdev coding style
- Eliminated redundant ENST_CONTROL register read for ENST state
- Used bp->queue_mask to generate ENST control mask
- Applied standard queue iteration logic in macb_taprio_destroy()
- Added HW offload support check in macb_taprio_setup()
- Added runtime state check in macb_taprio_setup()
- Resolved 32 bit compilation issue and clang errors
- Fixed CAPS syntax and resolved related clang error
- Wrapped capability lines to stay within 80-column limit
v1: https://lore.kernel.org/netdev/20250722154111.1871292-1-vineeth.karumanchi@amd.com/
---
Vineeth Karumanchi (2):
net: macb: Add TAPRIO traffic scheduling support
net: macb: Add capability-based QBV detection and Versal support
drivers/net/ethernet/cadence/macb.h | 67 +++++++
drivers/net/ethernet/cadence/macb_main.c | 232 ++++++++++++++++++++++-
2 files changed, 297 insertions(+), 2 deletions(-)
--
2.34.1
Powered by blists - more mailing lists