diff --git a/core/hdd/inc/wlan_hdd_lro.h b/core/hdd/inc/wlan_hdd_lro.h index 192337814175..5de60c741b86 100644 --- a/core/hdd/inc/wlan_hdd_lro.h +++ b/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__ */ diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 78757f58e854..37f67f1d64bb 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/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; }; diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c index b9bc5ee5b683..916f1929b5d5 100644 --- a/core/hdd/src/wlan_hdd_lro.c +++ b/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); +} diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index d7e14b3bace0..9869ceac02cb 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/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)) {