From dfd3c33d444632f653e6bdd8075d05486cb59bf3 Mon Sep 17 00:00:00 2001 From: Tiger Yu Date: Wed, 18 Nov 2020 17:19:46 +0800 Subject: [PATCH] qcacld-3.0: Enable TSO/SG feature by the FEATURE_TSO/dp_sg_support The hdd_set_netdev_flags enable the TSO feature regardless of the FEATURE_TSO, which will cause the performance regression issue on the non-tso supported chip. Enable TSO feature based on the FEATURE_TSO, and enable the SG feature separately by ini dp_sg_support for legacy chip to fix it. Change-Id: I0fcb189069f0aa2069ae8427ad96a8db25a91a2f CRs-Fixed: 2812953 --- core/cds/src/cds_api.c | 1 + core/dp/ol/inc/ol_cfg.h | 1 + core/dp/txrx/ol_cfg.c | 1 + core/dp/txrx/ol_txrx.c | 3 +++ core/hdd/src/wlan_hdd_main.c | 12 ++++++++++-- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 37ce2f4c1112..1b8f870cd70f 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -460,6 +460,7 @@ static void cds_cdp_cfg_attach(struct wlan_objmgr_psoc *psoc) cfg_get(psoc, CFG_DP_CE_CLASSIFY_ENABLE); cdp_cfg.tso_enable = cfg_get(psoc, CFG_DP_TSO); cdp_cfg.lro_enable = cfg_get(psoc, CFG_DP_LRO); + cdp_cfg.sg_enable = cfg_get(psoc, CFG_DP_SG); cdp_cfg.enable_data_stall_detection = cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION); cdp_cfg.gro_enable = cfg_get(psoc, CFG_DP_GRO); diff --git a/core/dp/ol/inc/ol_cfg.h b/core/dp/ol/inc/ol_cfg.h index 88b9374aac1a..d393655197d3 100644 --- a/core/dp/ol/inc/ol_cfg.h +++ b/core/dp/ol/inc/ol_cfg.h @@ -111,6 +111,7 @@ struct txrx_pdev_cfg_t { bool gro_enable; bool tso_enable; bool lro_enable; + bool sg_enable; bool enable_data_stall_detection; bool enable_flow_steering; bool disable_intra_bss_fwd; diff --git a/core/dp/txrx/ol_cfg.c b/core/dp/txrx/ol_cfg.c index 9df6b0bae340..31ac0dd93ef5 100644 --- a/core/dp/txrx/ol_cfg.c +++ b/core/dp/txrx/ol_cfg.c @@ -208,6 +208,7 @@ struct cdp_cfg *ol_pdev_cfg_attach(qdf_device_t osdev, void *pcfg_param) cfg_ctx->gro_enable = cfg_param->gro_enable; cfg_ctx->tso_enable = cfg_param->tso_enable; cfg_ctx->lro_enable = cfg_param->lro_enable; + cfg_ctx->sg_enable = cfg_param->sg_enable; cfg_ctx->enable_data_stall_detection = cfg_param->enable_data_stall_detection; cfg_ctx->enable_flow_steering = cfg_param->enable_flow_steering; diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 63ecc632689e..44136dd6768a 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -5887,6 +5887,9 @@ static uint32_t ol_txrx_get_cfg(struct cdp_soc_t *soc_hdl, enum cdp_dp_cfg cfg) case cfg_dp_lro_enable: value = cfg_ctx->lro_enable; break; + case cfg_dp_sg_enable: + value = cfg_ctx->sg_enable; + break; case cfg_dp_gro_enable: value = cfg_ctx->gro_enable; break; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 038a9c540e58..8c960fe00a99 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -215,6 +215,12 @@ #define MAX_NET_DEV_REF_LEAK_ITERATIONS 10 #define NET_DEV_REF_LEAK_ITERATION_SLEEP_TIME_MS 10 +#ifdef FEATURE_TSO +#define TSO_FEATURE_FLAGS (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG) +#else +#define TSO_FEATURE_FLAGS 0 +#endif + int wlan_start_ret_val; static DECLARE_COMPLETION(wlan_start_comp); static qdf_atomic_t wlan_hdd_state_fops_ref; @@ -7148,8 +7154,10 @@ void hdd_set_netdev_flags(struct hdd_adapter *adapter) (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); if (cdp_cfg_get(soc, cfg_dp_tso_enable) && enable_csum) - adapter->dev->features |= - (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG); + adapter->dev->features |= TSO_FEATURE_FLAGS; + + if (cdp_cfg_get(soc, cfg_dp_sg_enable)) + adapter->dev->features |= NETIF_F_SG; adapter->dev->features |= NETIF_F_RXCSUM; temp = (uint64_t)adapter->dev->features;