From 1c37fb9ccc113225377fee6c97f7c4fbc332cc2b Mon Sep 17 00:00:00 2001 From: hangtian Date: Wed, 10 Apr 2019 11:15:20 +0800 Subject: [PATCH] qcacld-3.0: Memory optimize for QCS403 platform Memory optimize for QCS403 platform, 1x1 chip. Reduce CE1 htt data dest ring buffer from 512 to 256, reduce CE2 wmi dest ring buffer from 128 to 64, reduce CE9 & CE10 desg ring buffer from 512 to 64, disable CE11 pktlog. Note: this change only affect specific WLAN build config for extremely saving memory, for debug purose, there is another build selecting default WLAN config for reference HW. Change-Id: I868e74b09cdb11df3dccaa3f9e051da55724983d CRs-Fixed: 2432631 --- Kbuild | 3 +++ configs/qcs40x.snoc.perf_defconfig | 3 ++- core/dp/ol/inc/ol_cfg.h | 7 +++++++ core/dp/txrx/ol_cfg.c | 2 +- core/hdd/src/wlan_hdd_driver_ops.c | 18 ++++++++++++++++++ 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Kbuild b/Kbuild index 94de5cfab8b4..271696cdc92f 100644 --- a/Kbuild +++ b/Kbuild @@ -2145,6 +2145,9 @@ cppflags-$(CONFIG_FEATURE_BECN_STATS) += -DWLAN_FEATURE_BEACON_RECEPTION_STATS #Set RX_PERFORMANCE cppflags-$(CONFIG_RX_PERFORMANCE) += -DRX_PERFORMANCE +#Set QCS403_MEM_OPTIMIZE +cppflags-$(CONFIG_QCS403_MEM_OPTIMIZE) += -DQCS403_MEM_OPTIMIZE + #Enable OL debug and wmi unified functions cppflags-$(CONFIG_ATH_PERF_PWR_OFFLOAD) += -DATH_PERF_PWR_OFFLOAD diff --git a/configs/qcs40x.snoc.perf_defconfig b/configs/qcs40x.snoc.perf_defconfig index a4bef9ec6f60..0229172188e0 100644 --- a/configs/qcs40x.snoc.perf_defconfig +++ b/configs/qcs40x.snoc.perf_defconfig @@ -62,6 +62,7 @@ CONFIG_FEATURE_MONITOR_MODE_SUPPORT := n CONFIG_DESC_DUP_DETECT_DEBUG := n CONFIG_DEBUG_RX_RING_BUFFER := n CONFIG_RX_PERFORMANCE := y +CONFIG_QCS403_MEM_OPTIMIZE := y ifeq ($(CONFIG_INET_LRO), y) CONFIG_WLAN_LRO := y @@ -87,7 +88,7 @@ CONFIG_FEATURE_TSO_DEBUG := y CONFIG_MPC_UT_FRAMEWORK := n CONFIG_FEATURE_EPPING := n CONFIG_WLAN_NAPI_DEBUG := n -CONFIG_REMOVE_PKT_LOG := n +CONFIG_REMOVE_PKT_LOG := y CONFIG_FEATURE_STATS_EXT := y CONFIG_FEATURE_HTC_CREDIT_HISTORY := y CONFIG_TRACE_RECORD_FEATURE := y diff --git a/core/dp/ol/inc/ol_cfg.h b/core/dp/ol/inc/ol_cfg.h index f35a836a80f0..d46130668b81 100644 --- a/core/dp/ol/inc/ol_cfg.h +++ b/core/dp/ol/inc/ol_cfg.h @@ -42,6 +42,13 @@ enum wlan_frm_fmt { wlan_frm_fmt_802_3, }; +/* Max throughput */ +#ifdef QCS403_MEM_OPTIMIZE +#define MAX_THROUGHPUT 400 +#else +#define MAX_THROUGHPUT 800 +#endif + /* Throttle period Different level Duty Cycle values*/ #define THROTTLE_DUTY_CYCLE_LEVEL0 (0) #define THROTTLE_DUTY_CYCLE_LEVEL1 (50) diff --git a/core/dp/txrx/ol_cfg.c b/core/dp/txrx/ol_cfg.c index bc5f970ecb32..6458e9236464 100644 --- a/core/dp/txrx/ol_cfg.c +++ b/core/dp/txrx/ol_cfg.c @@ -127,7 +127,7 @@ struct cdp_cfg *ol_pdev_cfg_attach(qdf_device_t osdev, void *pcfg_param) cfg_ctx->max_vdev = CFG_TGT_NUM_VDEV; cfg_ctx->pn_rx_fwd_check = 1; cfg_ctx->frame_type = wlan_frm_fmt_802_3; - cfg_ctx->max_thruput_mbps = 800; + cfg_ctx->max_thruput_mbps = MAX_THROUGHPUT; cfg_ctx->max_nbuf_frags = 1; cfg_ctx->vow_config = vow_config; cfg_ctx->target_tx_credit = CFG_TGT_NUM_MSDU_DESC; diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 01ed925a8bd3..83a96a9f6fd4 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -150,6 +150,22 @@ static void hdd_hif_init_driver_state_callbacks(void *data, cbk->is_target_ready = hdd_is_target_ready; } +/** + * hdd_hif_set_attribute() - API to set CE attribute if memory is limited + * @hif_ctx: hif context + * + * Return: None + */ +#ifdef QCS403_MEM_OPTIMIZE +static void hdd_hif_set_attribute(struct hif_opaque_softc *hif_ctx) +{ + hif_set_attribute(hif_ctx, HIF_LOWDESC_CE_NO_PKTLOG_CFG); +} +#else +static void hdd_hif_set_attribute(struct hif_opaque_softc *hif_ctx) +{} +#endif + /** * hdd_init_cds_hif_context() - API to set CDS HIF Context * @hif: HIF Context @@ -237,6 +253,8 @@ int hdd_hif_open(struct device *dev, void *bdev, const struct hif_bus_id *bid, goto err_hif_close; } + hdd_hif_set_attribute(hif_ctx); + status = hif_enable(hif_ctx, dev, bdev, bid, bus_type, (reinit == true) ? HIF_ENABLE_TYPE_REINIT : HIF_ENABLE_TYPE_PROBE);