Explorar el Código

qcacld-3.0: Add ultra high bandwidth voting for dbs mode

Add a new SNOC/DDR voting slot for DBS mode. In DBS KPI tests,
more hardware resources are needed for both HW MAC0/1.
This change adds a new logic to vote more DDR frequency when
it's in DBS mode and the overall throughput is larger than a
pre-defined threshold.

Change-Id: I14a318b417a39714865de0617c9943c1a5e04ae6
CRs-fixed: 3064197
Yu Tian hace 3 años
padre
commit
9a91fcdc37

+ 48 - 1
core/hdd/inc/hdd_dp_cfg.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -413,6 +414,29 @@
 #endif
 
 #ifdef WLAN_FEATURE_DP_BUS_BANDWIDTH
+/*
+ * <ini>
+ * gBusBandwidthUltraHighThreshold - bus bandwidth ultra high threshold
+ *
+ * @Min: 0
+ * @Max: 4294967295UL
+ * @Default: 12000
+ *
+ * This ini specifies the bus bandwidth very high threshold
+ *
+ * Usage: Internal
+ *
+ * </ini>
+ */
+#define CFG_DP_BUS_BANDWIDTH_ULTRA_HIGH_THRESHOLD \
+		CFG_INI_UINT( \
+		"gBusBandwidthUltraHighThreshold", \
+		0, \
+		4294967295UL, \
+		12000, \
+		CFG_VALUE_OR_DEFAULT, \
+		"Bus bandwidth ultra high threshold")
+
 /*
  * <ini>
  * gBusBandwidthVeryHighThreshold - bus bandwidth very high threshold
@@ -435,7 +459,28 @@
 		9000, \
 		CFG_VALUE_OR_DEFAULT, \
 		"Bus bandwidth very high threshold")
-
+/*
+ * <ini>
+ * gBusBandwidthDBSThreshold - bus bandwidth for DBS mode threshold
+ *
+ * @Min: 0
+ * @Max: 4294967295UL
+ * @Default: 6000
+ *
+ * This ini specifies the bus bandwidth high threshold
+ *
+ * Usage: Internal
+ *
+ * </ini>
+ */
+#define CFG_DP_BUS_BANDWIDTH_DBS_THRESHOLD \
+		CFG_INI_UINT( \
+		"gBusBandwidthDBSThreshold", \
+		0, \
+		4294967295UL, \
+		6000, \
+		CFG_VALUE_OR_DEFAULT, \
+		"Bus bandwidth DBS mode threshold")
 /*
  * <ini>
  * gBusBandwidthHighThreshold - bus bandwidth high threshold
@@ -1480,7 +1525,9 @@
 
 #ifdef WLAN_FEATURE_DP_BUS_BANDWIDTH
 #define CFG_HDD_DP_BUS_BANDWIDTH \
+	CFG(CFG_DP_BUS_BANDWIDTH_ULTRA_HIGH_THRESHOLD) \
 	CFG(CFG_DP_BUS_BANDWIDTH_VERY_HIGH_THRESHOLD) \
+	CFG(CFG_DP_BUS_BANDWIDTH_DBS_THRESHOLD) \
 	CFG(CFG_DP_BUS_BANDWIDTH_HIGH_THRESHOLD) \
 	CFG(CFG_DP_BUS_BANDWIDTH_MEDIUM_THRESHOLD) \
 	CFG(CFG_DP_BUS_BANDWIDTH_LOW_THRESHOLD) \

+ 5 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -154,8 +155,12 @@ struct hdd_config {
 	uint32_t rx_hp_oos_update_limit;
 	uint64_t rx_softirq_max_yield_duration_ns;
 #ifdef WLAN_FEATURE_DP_BUS_BANDWIDTH
+	/* bandwidth threshold for ultra high bandwidth */
+	uint32_t bus_bw_ultra_high_threshold;
 	/* bandwidth threshold for very high bandwidth */
 	uint32_t bus_bw_very_high_threshold;
+	/* bandwidth threshold for DBS mode bandwidth */
+	uint32_t bus_bw_dbs_threshold;
 	/* bandwidth threshold for high bandwidth */
 	uint32_t bus_bw_high_threshold;
 	/* bandwidth threshold for medium bandwidth */

+ 27 - 12
core/hdd/src/wlan_hdd_bus_bandwidth.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -34,22 +35,28 @@
 static bus_bw_table_type bus_bw_table_default = {
 	[QCA_WLAN_802_11_MODE_11B] = {BUS_BW_LEVEL_NONE, BUS_BW_LEVEL_1,
 				      BUS_BW_LEVEL_2, BUS_BW_LEVEL_3,
-				      BUS_BW_LEVEL_4, BUS_BW_LEVEL_6},
+				      BUS_BW_LEVEL_4, BUS_BW_LEVEL_6,
+				      BUS_BW_LEVEL_7},
 	[QCA_WLAN_802_11_MODE_11G] = {BUS_BW_LEVEL_NONE, BUS_BW_LEVEL_5,
 				      BUS_BW_LEVEL_5, BUS_BW_LEVEL_5,
-				      BUS_BW_LEVEL_5, BUS_BW_LEVEL_5},
+				      BUS_BW_LEVEL_5, BUS_BW_LEVEL_5,
+				      BUS_BW_LEVEL_5},
 	[QCA_WLAN_802_11_MODE_11A] = {BUS_BW_LEVEL_NONE, BUS_BW_LEVEL_5,
 				      BUS_BW_LEVEL_5, BUS_BW_LEVEL_5,
-				      BUS_BW_LEVEL_5, BUS_BW_LEVEL_5},
+				      BUS_BW_LEVEL_5, BUS_BW_LEVEL_5,
+				      BUS_BW_LEVEL_5},
 	[QCA_WLAN_802_11_MODE_11N] = {BUS_BW_LEVEL_NONE, BUS_BW_LEVEL_1,
 				      BUS_BW_LEVEL_2, BUS_BW_LEVEL_3,
-				      BUS_BW_LEVEL_4, BUS_BW_LEVEL_6},
+				      BUS_BW_LEVEL_4, BUS_BW_LEVEL_6,
+				      BUS_BW_LEVEL_7},
 	[QCA_WLAN_802_11_MODE_11AC] = {BUS_BW_LEVEL_NONE, BUS_BW_LEVEL_1,
 				       BUS_BW_LEVEL_2, BUS_BW_LEVEL_3,
-				       BUS_BW_LEVEL_4, BUS_BW_LEVEL_6},
+				       BUS_BW_LEVEL_4, BUS_BW_LEVEL_6,
+				       BUS_BW_LEVEL_7},
 	[QCA_WLAN_802_11_MODE_11AX] = {BUS_BW_LEVEL_NONE, BUS_BW_LEVEL_1,
 				       BUS_BW_LEVEL_2, BUS_BW_LEVEL_3,
-				       BUS_BW_LEVEL_4, BUS_BW_LEVEL_6},
+				       BUS_BW_LEVEL_4, BUS_BW_LEVEL_6,
+				       BUS_BW_LEVEL_7},
 };
 
 /**
@@ -60,22 +67,28 @@ static bus_bw_table_type bus_bw_table_default = {
 static bus_bw_table_type bus_bw_table_low_latency = {
 	[QCA_WLAN_802_11_MODE_11B] = {BUS_BW_LEVEL_NONE, BUS_BW_LEVEL_6,
 				      BUS_BW_LEVEL_6, BUS_BW_LEVEL_6,
-				      BUS_BW_LEVEL_6, BUS_BW_LEVEL_6},
+				      BUS_BW_LEVEL_6, BUS_BW_LEVEL_6,
+				      BUS_BW_LEVEL_6},
 	[QCA_WLAN_802_11_MODE_11G] = {BUS_BW_LEVEL_NONE, BUS_BW_LEVEL_6,
 				      BUS_BW_LEVEL_6, BUS_BW_LEVEL_6,
-				      BUS_BW_LEVEL_6, BUS_BW_LEVEL_6},
+				      BUS_BW_LEVEL_6, BUS_BW_LEVEL_6,
+				      BUS_BW_LEVEL_6},
 	[QCA_WLAN_802_11_MODE_11A] = {BUS_BW_LEVEL_NONE, BUS_BW_LEVEL_6,
 				      BUS_BW_LEVEL_6, BUS_BW_LEVEL_6,
-				      BUS_BW_LEVEL_6, BUS_BW_LEVEL_6},
+				      BUS_BW_LEVEL_6, BUS_BW_LEVEL_6,
+				      BUS_BW_LEVEL_6},
 	[QCA_WLAN_802_11_MODE_11N] = {BUS_BW_LEVEL_NONE, BUS_BW_LEVEL_6,
 				      BUS_BW_LEVEL_6, BUS_BW_LEVEL_6,
-				      BUS_BW_LEVEL_6, BUS_BW_LEVEL_6},
+				      BUS_BW_LEVEL_6, BUS_BW_LEVEL_6,
+				      BUS_BW_LEVEL_6},
 	[QCA_WLAN_802_11_MODE_11AC] = {BUS_BW_LEVEL_NONE, BUS_BW_LEVEL_6,
 				       BUS_BW_LEVEL_6, BUS_BW_LEVEL_6,
-				       BUS_BW_LEVEL_6, BUS_BW_LEVEL_6},
+				       BUS_BW_LEVEL_6, BUS_BW_LEVEL_6,
+				       BUS_BW_LEVEL_6},
 	[QCA_WLAN_802_11_MODE_11AX] = {BUS_BW_LEVEL_NONE, BUS_BW_LEVEL_6,
 				       BUS_BW_LEVEL_6, BUS_BW_LEVEL_6,
-				       BUS_BW_LEVEL_6, BUS_BW_LEVEL_6},
+				       BUS_BW_LEVEL_6, BUS_BW_LEVEL_6,
+				       BUS_BW_LEVEL_6},
 };
 
 /**
@@ -101,6 +114,8 @@ bbm_convert_to_pld_bus_lvl(enum bus_bw_level vote_lvl)
 		return PLD_BUS_WIDTH_LOW_LATENCY;
 	case BUS_BW_LEVEL_6:
 		return PLD_BUS_WIDTH_VERY_HIGH;
+	case BUS_BW_LEVEL_7:
+		return PLD_BUS_WIDTH_ULTRA_HIGH;
 	case BUS_BW_LEVEL_NONE:
 	default:
 		return PLD_BUS_WIDTH_NONE;

+ 5 - 0
core/hdd/src/wlan_hdd_bus_bandwidth.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -36,6 +37,7 @@
  * @BUS_BW_LEVEL_4: vote for level-4 bus bandwidth
  * @BUS_BW_LEVEL_5: vote for level-5 bus bandwidth
  * @BUS_BW_LEVEL_6: vote for level-6 bus bandwidth
+ * @BUS_BW_LEVEL_7: vote for level-7 bus bandwidth
  */
 enum bus_bw_level {
 	BUS_BW_LEVEL_NONE,
@@ -45,6 +47,7 @@ enum bus_bw_level {
 	BUS_BW_LEVEL_4,
 	BUS_BW_LEVEL_5,
 	BUS_BW_LEVEL_6,
+	BUS_BW_LEVEL_7,
 	BUS_BW_LEVEL_MAX,
 };
 
@@ -59,6 +62,7 @@ enum bus_bw_level {
  * @TPUT_LEVEL_MEDIUM: medium throughtput level
  * @TPUT_LEVEL_HIGH: high throughput level
  * @TPUT_LEVEL_VERY_HIGH: very high throughput level
+ * @TPUT_LEVEL_ULTRA_HIGH: ultra high throughput level
  */
 enum tput_level {
 	TPUT_LEVEL_NONE,
@@ -67,6 +71,7 @@ enum tput_level {
 	TPUT_LEVEL_MEDIUM,
 	TPUT_LEVEL_HIGH,
 	TPUT_LEVEL_VERY_HIGH,
+	TPUT_LEVEL_ULTRA_HIGH,
 	TPUT_LEVEL_MAX,
 };
 

+ 18 - 2
core/hdd/src/wlan_hdd_main.c

@@ -10109,6 +10109,9 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
 	if (hdd_ctx->high_bus_bw_request) {
 		next_vote_level = PLD_BUS_WIDTH_VERY_HIGH;
 		tput_level = TPUT_LEVEL_VERY_HIGH;
+	} else if (total_pkts > hdd_ctx->config->bus_bw_ultra_high_threshold) {
+		next_vote_level = PLD_BUS_WIDTH_ULTRA_HIGH;
+		tput_level = TPUT_LEVEL_ULTRA_HIGH;
 	} else if (total_pkts > hdd_ctx->config->bus_bw_very_high_threshold) {
 		next_vote_level = PLD_BUS_WIDTH_VERY_HIGH;
 		tput_level = TPUT_LEVEL_VERY_HIGH;
@@ -10126,6 +10129,18 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
 		tput_level = TPUT_LEVEL_IDLE;
 	}
 
+	/*
+	 * DBS mode requires more DDR/SNOC resources, vote to ultra high
+	 * only when TPUT can reach VHT80 KPI and IPA is disabled,
+	 * for other cases, follow general voting logic
+	 */
+	if (!ucfg_ipa_is_fw_wdi_activated(hdd_ctx->pdev) &&
+	    policy_mgr_is_current_hwmode_dbs(hdd_ctx->psoc) &&
+	    (total_pkts > hdd_ctx->config->bus_bw_dbs_threshold)) {
+		next_vote_level = PLD_BUS_WIDTH_ULTRA_HIGH;
+		tput_level = TPUT_LEVEL_ULTRA_HIGH;
+	}
+
 	param.policy = BBM_TPUT_POLICY;
 	param.policy_info.tput_level = tput_level;
 	hdd_bbm_apply_independent_policy(hdd_ctx, &param);
@@ -10927,11 +10942,12 @@ void wlan_hdd_display_tx_rx_histogram(struct hdd_context *hdd_ctx)
 #ifdef WLAN_FEATURE_DP_BUS_BANDWIDTH
 	hdd_nofl_debug("BW compute Interval: %d ms",
 		       hdd_ctx->config->bus_bw_compute_interval);
-	hdd_nofl_debug("BW TH - Very High: %d High: %d Med: %d Low: %d",
+	hdd_nofl_debug("BW TH - Very High: %d High: %d Med: %d Low: %d DBS: %d",
 		       hdd_ctx->config->bus_bw_very_high_threshold,
 		       hdd_ctx->config->bus_bw_high_threshold,
 		       hdd_ctx->config->bus_bw_medium_threshold,
-		       hdd_ctx->config->bus_bw_low_threshold);
+		       hdd_ctx->config->bus_bw_low_threshold,
+		       hdd_ctx->config->bus_bw_dbs_threshold);
 	hdd_nofl_debug("Enable TCP DEL ACK: %d",
 		       hdd_ctx->en_tcp_delack_no_lro);
 	hdd_nofl_debug("TCP DEL High TH: %d TCP DEL Low TH: %d",

+ 4 - 0
core/hdd/src/wlan_hdd_tx_rx.c

@@ -3617,8 +3617,12 @@ static inline void hdd_ini_mscs_params(struct hdd_config *config,
 static void hdd_ini_bus_bandwidth(struct hdd_config *config,
 				  struct wlan_objmgr_psoc *psoc)
 {
+	config->bus_bw_ultra_high_threshold =
+		cfg_get(psoc, CFG_DP_BUS_BANDWIDTH_ULTRA_HIGH_THRESHOLD);
 	config->bus_bw_very_high_threshold =
 		cfg_get(psoc, CFG_DP_BUS_BANDWIDTH_VERY_HIGH_THRESHOLD);
+	config->bus_bw_dbs_threshold =
+		cfg_get(psoc, CFG_DP_BUS_BANDWIDTH_DBS_THRESHOLD);
 	config->bus_bw_high_threshold =
 		cfg_get(psoc, CFG_DP_BUS_BANDWIDTH_HIGH_THRESHOLD);
 	config->bus_bw_medium_threshold =

+ 3 - 0
core/pld/inc/pld_common.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -85,6 +86,7 @@ enum pld_bus_type {
  * @PLD_BUS_WIDTH_MEDIUM: vote for medium bus bandwidth
  * @PLD_BUS_WIDTH_HIGH: vote for high bus bandwidth
  * @PLD_BUS_WIDTH_VERY_HIGH: vote for very high bus bandwidth
+ * @PLD_BUS_WIDTH_ULTRA_HIGH: vote for ultra high bus bandwidth
  * @PLD_BUS_WIDTH_LOW_LATENCY: vote for low latency bus bandwidth
  */
 enum pld_bus_width_type {
@@ -94,6 +96,7 @@ enum pld_bus_width_type {
 	PLD_BUS_WIDTH_MEDIUM,
 	PLD_BUS_WIDTH_HIGH,
 	PLD_BUS_WIDTH_VERY_HIGH,
+	PLD_BUS_WIDTH_ULTRA_HIGH,
 	PLD_BUS_WIDTH_LOW_LATENCY,
 };