Browse Source

qcacld-3.0: Enable/Disable LRO for low throughput based on rx packet count

It is observed that LRO is affecting the throughput in low TPUT noisy
scenario as by its nature LRO suppresses the TCP acks.

Change-Id: I9f74418b53492ae12934fc09277aafa0c002ae0b
CRs-Fixed: 2056706
Poddar, Siddarth 7 years ago
parent
commit
47c2340287

+ 15 - 0
core/hdd/inc/wlan_hdd_lro.h

@@ -51,6 +51,16 @@ enum hdd_lro_rx_status hdd_lro_rx(struct hdd_context *hdd_ctx,
 	 struct hdd_adapter *adapter, struct sk_buff *skb);
 void hdd_lro_display_stats(struct hdd_context *hdd_ctx);
 void hdd_disable_lro_in_concurrency(bool);
+/**
+ * hdd_disable_lro_for_low_tput() - enable/disable LRO based on tput
+ * hdd_ctx: hdd context
+ * disable: boolean to enable/disable LRO
+ *
+ * This API enables/disables LRO based on tput.
+ *
+ * Return: void
+ */
+void hdd_disable_lro_for_low_tput(struct hdd_context *hdd_ctx, bool disable);
 #else
 static inline int hdd_lro_init(struct hdd_context *hdd_ctx)
 {
@@ -70,5 +80,10 @@ static inline void hdd_lro_display_stats(struct hdd_context *hdd_ctx)
 static inline void hdd_disable_lro_in_concurrency(bool disable)
 {
 }
+
+static inline void
+hdd_disable_lro_for_low_tput(struct hdd_context *hdd_ctx, bool disable)
+{
+}
 #endif /* FEATURE_LRO */
 #endif /* __WLAN_HDD_LRO_H__ */

+ 1 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -1719,6 +1719,7 @@ struct hdd_context {
 	int user_configured_pkt_filter_rules;
 	bool is_fils_roaming_supported;
 	qdf_atomic_t disable_lro_in_concurrency;
+	qdf_atomic_t disable_lro_in_low_tput;
 	bool en_tcp_delack_no_lro;
 };
 

+ 10 - 1
core/hdd/src/wlan_hdd_lro.c

@@ -148,7 +148,8 @@ enum hdd_lro_rx_status hdd_lro_rx(struct hdd_context *hdd_ctx,
 	if (((adapter->dev->features & NETIF_F_LRO) != NETIF_F_LRO) ||
 		!QDF_NBUF_CB_RX_TCP_PROTO(skb) ||
 		QDF_NBUF_CB_RX_PEER_CACHED_FRM(skb) ||
-		qdf_atomic_read(&hdd_ctx->disable_lro_in_concurrency))
+		qdf_atomic_read(&hdd_ctx->disable_lro_in_concurrency) ||
+		qdf_atomic_read(&hdd_ctx->disable_lro_in_low_tput))
 		return HDD_LRO_NO_RX;
 
 	{
@@ -237,3 +238,11 @@ void hdd_disable_lro_in_concurrency(bool disable)
 		qdf_atomic_set(&hdd_ctx->disable_lro_in_concurrency, 0);
 	}
 }
+
+void hdd_disable_lro_for_low_tput(struct hdd_context *hdd_ctx, bool disable)
+{
+	if (disable)
+		qdf_atomic_set(&hdd_ctx->disable_lro_in_low_tput, 1);
+	else
+		qdf_atomic_set(&hdd_ctx->disable_lro_in_low_tput, 0);
+}

+ 5 - 0
core/hdd/src/wlan_hdd_main.c

@@ -6406,6 +6406,11 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
 
 	hdd_ctx->prev_rx = rx_packets;
 
+	if (temp_rx < hdd_ctx->config->busBandwidthLowThreshold)
+		hdd_disable_lro_for_low_tput(hdd_ctx, true);
+	else
+		hdd_disable_lro_for_low_tput(hdd_ctx, false);
+
 	if (temp_rx > hdd_ctx->config->tcpDelackThresholdHigh) {
 		if ((hdd_ctx->cur_rx_level != WLAN_SVC_TP_HIGH) &&
 		   (++hdd_ctx->rx_high_ind_cnt == delack_timer_cnt)) {