From 7b6cb00b2638fcb3f3bf44f52a7e2b3256211e2c Mon Sep 17 00:00:00 2001 From: Manjunathappa Prakash Date: Mon, 9 Oct 2017 00:40:24 -0700 Subject: [PATCH] qcacld-3.0: Disable LRO capability during concurrency LRO rx jumbo packets cannot be forwarded to other vdev and kernel drops them with warning message: "skbuff: wlan0: received packets cannot be forwarded while LRO is enabled" So disable LRO capability during concurrency. Change-Id: Ib35e1ee5f9c18a846e21ce1eb293e12e17761fa8 CRs-Fixed: 1092193 --- core/cds/inc/cds_sched.h | 2 ++ core/hdd/inc/wlan_hdd_lro.h | 5 +++++ core/hdd/inc/wlan_hdd_main.h | 1 + core/hdd/src/wlan_hdd_lro.c | 28 ++++++++++++++++++++++++---- core/hdd/src/wlan_hdd_main.c | 8 ++++++++ 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/core/cds/inc/cds_sched.h b/core/cds/inc/cds_sched.h index e53887ea36a0..3fe73cd1a801 100644 --- a/core/cds/inc/cds_sched.h +++ b/core/cds/inc/cds_sched.h @@ -174,6 +174,8 @@ struct cds_log_complete { bool recovery_needed; }; +/* forward-declare hdd_context_s as it is used ina function type */ +struct hdd_context_s; typedef struct _cds_context_type { /* Scheduler Context */ cds_sched_context qdf_sched; diff --git a/core/hdd/inc/wlan_hdd_lro.h b/core/hdd/inc/wlan_hdd_lro.h index 244909662d54..192337814175 100644 --- a/core/hdd/inc/wlan_hdd_lro.h +++ b/core/hdd/inc/wlan_hdd_lro.h @@ -50,6 +50,7 @@ int hdd_lro_init(struct hdd_context *hdd_ctx); 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); #else static inline int hdd_lro_init(struct hdd_context *hdd_ctx) { @@ -65,5 +66,9 @@ static inline enum hdd_lro_rx_status hdd_lro_rx(struct hdd_context *hdd_ctx, static inline void hdd_lro_display_stats(struct hdd_context *hdd_ctx) { } + +static inline void hdd_disable_lro_in_concurrency(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 5bd0c7b75736..3758d7dd14e1 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1763,6 +1763,7 @@ struct hdd_context { bool imps_enabled; int user_configured_pkt_filter_rules; bool is_fils_roaming_supported; + qdf_atomic_t disable_lro_in_concurrency; }; /** diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c index 23702c37d883..bf3a94deb8e4 100644 --- a/core/hdd/src/wlan_hdd_lro.c +++ b/core/hdd/src/wlan_hdd_lro.c @@ -86,7 +86,7 @@ int hdd_lro_init(struct hdd_context *hdd_ctx) if ((!hdd_ctx->config->lro_enable) && (hdd_napi_enabled(HDD_NAPI_ANY) == 0)) { hdd_warn("LRO and NAPI are both disabled"); - return 0; + return QDF_STATUS_E_FAILURE; } lro_config.lro_enable = 1; @@ -141,9 +141,13 @@ enum hdd_lro_rx_status hdd_lro_rx(struct hdd_context *hdd_ctx, qdf_lro_ctx_t ctx; enum hdd_lro_rx_status status = HDD_LRO_NO_RX; - if ((adapter->dev->features & NETIF_F_LRO) && - QDF_NBUF_CB_RX_TCP_PROTO(skb) && - !QDF_NBUF_CB_RX_PEER_CACHED_FRM(skb)) { + 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)) + return HDD_LRO_NO_RX; + + { struct qdf_lro_info info; struct net_lro_desc *lro_desc = NULL; struct hif_opaque_softc *hif_hdl = @@ -200,3 +204,19 @@ void hdd_lro_display_stats(struct hdd_context *hdd_ctx) { hdd_debug("LRO stats is broken, will fix it"); } + +/** + * hdd_disable_lro_in_concurrency() - Disable LRO due to concurrency + * @disable: bool value + * + * Return: none + */ +void hdd_disable_lro_in_concurrency(bool disable) +{ + struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + + if (disable) + qdf_atomic_set(&hdd_ctx->disable_lro_in_concurrency, 1); + else + qdf_atomic_set(&hdd_ctx->disable_lro_in_concurrency, 0); +} diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index d66af8c8ace8..2c94a4ee1d15 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9313,6 +9313,7 @@ int hdd_configure_cds(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter) uint32_t num_abg_tx_chains = 0; uint32_t num_11b_tx_chains = 0; uint32_t num_11ag_tx_chains = 0; + struct policy_mgr_dp_cbacks dp_cbs = {0}; if (hdd_ctx->config->sifs_burst_duration) { set_value = (SIFS_BURST_DUR_MULTIPLIER) * @@ -9406,6 +9407,13 @@ int hdd_configure_cds(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter) if (ret) goto cds_disable; + dp_cbs.hdd_disable_lro_in_concurrency = hdd_disable_lro_in_concurrency; + status = policy_mgr_register_dp_cb(hdd_ctx->hdd_psoc, &dp_cbs); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_debug("LRO disbaled, failed to register with policy mgr"); + goto cds_disable; + } + if (hdd_enable_egap(hdd_ctx)) hdd_debug("enhance green ap is not enabled");