From db0d42384f34438d18450fcd003d74438985b146 Mon Sep 17 00:00:00 2001 From: Alok Kumar Date: Thu, 8 Nov 2018 19:08:13 +0530 Subject: [PATCH] qcacmn: Add vendor event to update TCP parameters Currently, TCP params are configured through cnss-daemon. Add vendor event to configure TCP params through Wi-Fi HAL. Change-Id: Ifb81b810f0fb830515fb4558d016778083323b5a CRs-Fixed: 2348945 --- os_if/linux/qca_vendor.h | 71 +++++++++++++++++++++++++++++ utils/nlink/inc/wlan_nlink_common.h | 25 ++++++++++ 2 files changed, 96 insertions(+) diff --git a/os_if/linux/qca_vendor.h b/os_if/linux/qca_vendor.h index e5a2455cb035..750386dad521 100644 --- a/os_if/linux/qca_vendor.h +++ b/os_if/linux/qca_vendor.h @@ -469,6 +469,7 @@ enum qca_nl80211_vendor_subcmds { QCA_NL80211_VENDOR_SUBCMD_SET_QDEPTH_THRESH = 166, /* Wi-Fi test configuration subcommand */ QCA_NL80211_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION = 169, + QCA_NL80211_VENDOR_SUBCMD_THROUGHPUT_CHANGE_EVENT = 174, }; enum qca_wlan_vendor_tos { @@ -891,6 +892,7 @@ enum qca_nl80211_vendor_subcmds_index { QCA_NL80211_VENDOR_SUBCMD_HANG_REASON_INDEX, QCA_NL80211_VENDOR_SUBCMD_HTT_STATS_INDEX, QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_INFO_INDEX, + QCA_NL80211_VENDOR_SUBCMD_THROUGHPUT_CHANGE_EVENT_INDEX, }; /** @@ -6343,4 +6345,73 @@ enum qca_wlan_vendor_twt_setup_req_type { QCA_WLAN_VENDOR_TWT_SETUP_DEMAND = 3, }; +/** + * enum qca_wlan_throughput_level - Current throughput level + * + * Indicates the current level of throughput calculated by driver. The driver + * may choose different thresholds to decide whether the throughput level is + * low or medium or high based on variety of parameters like physical link + * capacity of current connection, number of pakcets being dispatched per + * second etc. The throughput level events might not be consistent with the + * actual current throughput value being observed. + * + * @QCA_WLAN_THROUGHPUT_LEVEL_LOW: Low level of throughput + * @QCA_WLAN_THROUGHPUT_LEVEL_MEDIUM: Medium level of throughput + * @QCA_WLAN_THROUGHPUT_LEVEL_HIGH: High level of throughput + */ +enum qca_wlan_throughput_level { + QCA_WLAN_THROUGHPUT_LEVEL_LOW = 0, + QCA_WLAN_THROUGHPUT_LEVEL_MEDIUM = 1, + QCA_WLAN_THROUGHPUT_LEVEL_HIGH = 2, +}; + +/** + * enum qca_wlan_vendor_attr_throughput_change - Vendor subcmd attributes to + * report throughput changes from driver to user space. enum values are used + * for NL attributes sent with + * %QCA_NL80211_VENDOR_SUBCMD_THROUGHPUT_CHANGE_EVENT sub command. + */ +enum qca_wlan_vendor_attr_throughput_change { + QCA_WLAN_VENDOR_ATTR_THROUGHPUT_CHANGE_INVALID = 0, + /* + * Indicates the direction of throughput in which the change is being + * reported. u8 attribute. Value is 0 for TX and 1 for RX. + */ + QCA_WLAN_VENDOR_ATTR_THROUGHPUT_CHANGE_DIRECTION = 1, + + /* + * Indicates the newly observed throughput level. + * qca_wlan_throughput_level describes the possible range of values. + * u8 attribute. + */ + QCA_WLAN_VENDOR_ATTR_THROUGHPUT_CHANGE_THROUGHPUT_LEVEL = 2, + + /* + * Indicates the driver's guidance on the new value to be set to + * kernel's tcp parameter tcp_limit_output_bytes. u32 attribute. Driver + * may optionally include this attribute. + */ + QCA_WLAN_VENDOR_ATTR_THROUGHPUT_CHANGE_TCP_LIMIT_OUTPUT_BYTES = 3, + + /* + * Indicates the driver's guidance on the new value to be set to + * kernel's tcp parameter tcp_adv_win_scale. s8 attribute. Possible + * values are from -31 to 31. Driver may optionally include this + * attribute. + */ + QCA_WLAN_VENDOR_ATTR_THROUGHPUT_CHANGE_TCP_ADV_WIN_SCALE = 4, + + /* + * Indicates the driver's guidance on the new value to be set to + * kernel's tcp parameter tcp_delack_seg. u32 attribute. Driver may + * optionally include this attribute. + */ + QCA_WLAN_VENDOR_ATTR_THROUGHPUT_CHANGE_TCP_DELACK_SEG = 5, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_THROUGHPUT_CHANGE_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_THROUGHPUT_CHANGE_MAX = + QCA_WLAN_VENDOR_ATTR_THROUGHPUT_CHANGE_AFTER_LAST - 1, +}; + #endif diff --git a/utils/nlink/inc/wlan_nlink_common.h b/utils/nlink/inc/wlan_nlink_common.h index f2b5fa2e1ad7..6b43052389f1 100644 --- a/utils/nlink/inc/wlan_nlink_common.h +++ b/utils/nlink/inc/wlan_nlink_common.h @@ -244,8 +244,22 @@ struct wlan_core_minfreq { /* Indication to enable TCP delayed ack in TPUT indication */ #define TCP_DEL_ACK_IND (1 << 0) +#define TCP_DEL_ACK_IND_MASK 0x1 /* Indication to enable TCP advance window scaling in TPUT indication */ #define TCP_ADV_WIN_SCL (1 << 1) +#define TCP_ADV_WIN_SCL_MASK 0x2 + +/* TCP limit output bytes for low and high TPUT */ +#define TCP_LIMIT_OUTPUT_BYTES_LOW 506072 +#define TCP_LIMIT_OUTPUT_BYTES_HI 4048579 + +/* TCP window scale for low and high TPUT */ +#define WIN_SCALE_LOW 2 +#define WIN_SCALE_HI 1 + +/* TCP DEL ACK value for low and high TPUT */ +#define TCP_DEL_ACK_LOW 0 +#define TCP_DEL_ACK_HI 20 /** * struct wlan_rx_tp_data - msg to TCP delayed ack and advance window scaling @@ -258,4 +272,15 @@ struct wlan_rx_tp_data { uint16_t rx_tp_flags; }; +/** + * struct wlan_tx_tp_data - msg to TCP for Tx Dir + * @level: Throughput level. + * @tcp_limit_output: Tcp limit output flag. + * + */ +struct wlan_tx_tp_data { + enum wlan_tp_level level; + bool tcp_limit_output; +}; + #endif /* WLAN_NLINK_COMMON_H__ */