From 5c94f027a1ad29a0eefbf723175be451d4f7a01b Mon Sep 17 00:00:00 2001 From: Yu Tian Date: Fri, 12 Nov 2021 11:12:34 +0800 Subject: [PATCH] qcacld-3.0: Add an ini control to disable Dynamic GRO feature Dynamic GRO feature is enabled by default and aimed for specific customers. Add an ini control to allow other customers to config this feature enable/disable. Change-Id: I83edd69d0e30d5944f0724ed8350328abff619bb CRs-Fixed: 3070912 --- core/cds/src/cds_api.c | 12 ++++++++++-- core/hdd/inc/wlan_hdd_main.h | 2 ++ core/hdd/src/wlan_hdd_tx_rx.c | 6 ++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 017e73941636..816562e2043a 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -424,6 +424,7 @@ static void cds_cdp_cfg_attach(struct wlan_objmgr_psoc *psoc) struct txrx_pdev_cfg_param_t cdp_cfg = {0}; void *soc = cds_get_context(QDF_MODULE_ID_SOC); struct hdd_context *hdd_ctx = gp_cds_context->hdd_context; + uint32_t gro_bit_set; cdp_cfg.is_full_reorder_offload = cfg_get(psoc, CFG_DP_REORDER_OFFLOAD_SUPPORT); @@ -450,7 +451,9 @@ static void cds_cdp_cfg_attach(struct wlan_objmgr_psoc *psoc) cdp_cfg.lro_enable = cfg_get(psoc, CFG_DP_LRO); 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); + gro_bit_set = cfg_get(psoc, CFG_DP_GRO); + if (gro_bit_set & DP_GRO_ENABLE_BIT_SET) + cdp_cfg.gro_enable = true; cdp_cfg.enable_flow_steering = cfg_get(psoc, CFG_DP_FLOW_STEERING_ENABLED); cdp_cfg.disable_intra_bss_fwd = @@ -955,6 +958,11 @@ QDF_STATUS cds_dp_open(struct wlan_objmgr_psoc *psoc) cds_debug("CDS successfully Opened"); + if (cdp_cfg_get(gp_cds_context->dp_soc, cfg_dp_force_gro_enable)) + hdd_ctx->dp_agg_param.force_gro_enable = true; + else + hdd_ctx->dp_agg_param.force_gro_enable = false; + return 0; intr_close: diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index e127c4726ebb..b981fb806c7a 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1861,6 +1861,7 @@ struct hdd_adapter_ops_history { * @country_change_work: work for updating vdev when country changes * @rx_aggregation: rx aggregation enable or disable state * @gro_force_flush: gro force flushed indication flag + * @force_gro_enable: force GRO enable or disable flag * @current_pcie_gen_speed: current pcie gen speed * @pm_qos_req: pm_qos request for all cpu cores * @qos_cpu_mask: voted cpu core mask @@ -2201,6 +2202,7 @@ struct hdd_context { struct { qdf_atomic_t rx_aggregation; uint8_t gro_force_flush[DP_MAX_RX_THREADS]; + bool force_gro_enable; } dp_agg_param; int current_pcie_gen_speed; qdf_workqueue_t *adapter_ops_wq; diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index b59c6ecacc34..defe0c9bb390 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -2311,8 +2312,9 @@ QDF_STATUS hdd_rx_deliver_to_stack(struct hdd_adapter *adapter, bool skb_receive_offload_ok = false; uint8_t rx_ctx_id = QDF_NBUF_CB_RX_CTX_ID(skb); - /* rx_ctx_id is already verified for out-of-range */ - hdd_rx_check_qdisc_for_adapter(adapter, rx_ctx_id); + if (!hdd_ctx->dp_agg_param.force_gro_enable) + /* rx_ctx_id is already verified for out-of-range */ + hdd_rx_check_qdisc_for_adapter(adapter, rx_ctx_id); if (QDF_NBUF_CB_RX_TCP_PROTO(skb) && !QDF_NBUF_CB_RX_PEER_CACHED_FRM(skb))