From 1b96745f1de8806e2c500ad781aa09b88fdae7b9 Mon Sep 17 00:00:00 2001 From: Balamurugan Mahalingam Date: Wed, 5 Jun 2024 18:53:21 -0700 Subject: [PATCH] Add a new QCA vendor attribute to set interface offload type Userspace tools can use QCA_WLAN_VENDOR_ATTR_CONFIG_IF_OFFLOAD_TYPE to configure the different below acceleration features (hardware, software) on a per interface basis. 0 - No acceleration Packets are processed through the Linux kernel networking stack. 1 - Software based acceleration: Packets are processed through the shortcut forwarding engine (SFE) to bypass the Linux networking stack for improved throughput performance. This option is applicable for AP, STA, and Mesh mode and available for all radio designs. From the performance aspect, this option consumes more CPU compared to the other two options. Linux traffic control can be further applied with this option to have more control on the traffic flows. 2 - Hybrid acceleration (software and hardware acceleration combined): Packets are processed through both hardware and software in this case. Packet classification is done by the hardware and then the packets are delivered to software along with classification results as meta data. Software can choose to do more classification/QoS based on use cases. This is applicable for AP, STA, and Mesh modes and is available for all radio designs. From the performance aspect, this option consumes relatively less CPU compared to the SFE option above. Linux traffic control rules cannot be applied with this option. 3 - Hardware based acceleration : Packets are processed through special hardware (Direct Switch) rings which can directly forward the packets between ethernet hardware and Wi-Fi hardware with very less software involvement. This is applicable only for AP and STA modes; not applicable for Mesh mode. From the performance aspect, this option consumes very much less CPU compared to the other options. Linux traffic control rules cannot be applied when this option is used. This option is applicable only for specific radio designs. When this option is not available, the default option (SFE) would be configured. Signed-off-by: Balamurugan Mahalingam --- src/common/qca-vendor.h | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/common/qca-vendor.h b/src/common/qca-vendor.h index 3e338cafc..8ca5eadfd 100644 --- a/src/common/qca-vendor.h +++ b/src/common/qca-vendor.h @@ -3624,6 +3624,16 @@ enum qca_wlan_vendor_attr_config { */ QCA_WLAN_VENDOR_ATTR_CONFIG_CONSECUTIVE_TX_NO_ACK_THRESHOLD = 119, + /* 8-bit unsigned value to configure the interface offload type + * + * This attribute is used to configure the interface offload capability. + * User can configure software based acceleration, hardware based + * acceleration, or a combination of both using this option. More + * details on each option is described under the enum definition below. + * Uses enum qca_wlan_intf_offload_type for values. + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_INTF_OFFLOAD_TYPE = 120, + /* keep last */ QCA_WLAN_VENDOR_ATTR_CONFIG_AFTER_LAST, QCA_WLAN_VENDOR_ATTR_CONFIG_MAX = @@ -17759,4 +17769,52 @@ enum qca_wlan_vendor_attr_nss_pkt { QCA_WLAN_VENDOR_ATTR_NSS_PKT_AFTER_LAST - 1, }; +/** + * enum qca_wlan_intf_offload_type - Definition of available values for + * QCA_WLAN_VENDOR_ATTR_CONFIG_INTF_OFFLOAD_TYPE to specify the offload path for + * packets handled through a network device. + * + * There are three offload paths possible for handling packet forwarding between + * Ethernet and Wi-Fi network, and which path to use can be configured on a per + * netdevice level based on use case. Userspace can choose different options + * based on use cases like performance requirements, traffic control features + * and limitations provided in each option. + * + * @QCA_WLAN_VENDOR_ATTR_INTF_OFFLOAD_TYPE_NONE: No acceleration configured. + * Packets are processed through the Linux kernel networking stack. + * + * @QCA_WLAN_VENDOR_ATTR_INTF_OFFLOAD_TYPE_SFE: Packets are processed through + * the shortcut forwarding engine (SFE) to bypass the Linux networking stack + * for improved throughput performance. This option is applicable for AP, STA, + * and Mesh mode and available for all radio designs. From the performance + * aspect, this option consumes more CPU compared to the other two options. + * Linux traffic control can be further applied with this option to have more + * control on the traffic flows. + * + * @QCA_WLAN_VENDOR_ATTR_INTF_OFFLOAD_TYPE_ACTIVE_VP: Packets are processed + * through both hardware and software in this case. Packet classification is + * done by the hardware and then the packets are delivered to software along + * with classification results as meta data. Software can choose to do more + * classification/QoS based on use cases. This is applicable for AP, STA, and + * Mesh modes and this is available for all radio designs. From the performance + * aspect, this option consumes relatively less CPU compared to the SFE option + * above. Linux traffic control rules cannot be applied with this option. + * + * @QCA_WLAN_VENDOR_ATTR_INTF_OFFLOAD_TYPE_PPE_DS: Packets are processed through + * special hardware (Direct Switch) rings which can directly forward the packets + * between Ethernet hardware and Wi-Fi hardware with very little software + * involvement. This is applicable only for AP and STA modes; not applicable + * for Mesh mode. From the performance aspect, this option consumes very much + * less CPU compared to the other options. Linux traffic control rules cannot be + * applied when this option is used. This option is applicable only for + * specific radio designs. When this option is not available, the default option + * (SFE) would be configured. + */ +enum qca_wlan_intf_offload_type { + QCA_WLAN_INTF_OFFLOAD_TYPE_NONE = 0, + QCA_WLAN_INTF_OFFLOAD_TYPE_SFE = 1, + QCA_WLAN_INTF_OFFLOAD_TYPE_ACTIVE_VP = 2, + QCA_WLAN_INTF_OFFLOAD_TYPE_PPE_DS = 3, +}; + #endif /* QCA_VENDOR_H */