diff --git a/Kbuild b/Kbuild index e03db916c805..3955984360fd 100644 --- a/Kbuild +++ b/Kbuild @@ -3406,7 +3406,7 @@ cppflags-$(CONFIG_WLAN_DP_PENDING_MEM_FLUSH) += -DWLAN_DP_PENDING_MEM_FLUSH cppflags-$(CONFIG_WLAN_SUPPORT_DATA_STALL) += -DWLAN_SUPPORT_DATA_STALL cppflags-$(CONFIG_WLAN_SUPPORT_TXRX_HL_BUNDLE) += -DWLAN_SUPPORT_TXRX_HL_BUNDLE cppflags-$(CONFIG_QCN7605_PCIE_SHADOW_REG_SUPPORT) += -DQCN7605_PCIE_SHADOW_REG_SUPPORT -cppflags-$(CONFIG_SEND_ICMP_PKT_TO_FW) += -DWLAN_DP_FEATURE_SEND_ICMP_TO_FW +cppflags-$(CONFIG_MARK_ICMP_REQ_TO_FW) += -DWLAN_DP_FEATURE_MARK_ICMP_REQ_TO_FW ifdef CONFIG_MAX_LOGS_PER_SEC ccflags-y += -DWLAN_MAX_LOGS_PER_SEC=$(CONFIG_MAX_LOGS_PER_SEC) diff --git a/configs/default_defconfig b/configs/default_defconfig index 70c4889d0d54..6ebea1f00aa2 100644 --- a/configs/default_defconfig +++ b/configs/default_defconfig @@ -472,7 +472,7 @@ endif #CONFIG_HELIUMPLUS ifeq ($(CONFIG_LITHIUM), y) CONFIG_RX_DEFRAG_DO_NOT_REINJECT := y -CONFIG_SEND_ICMP_PKT_TO_FW := y +CONFIG_MARK_ICMP_REQ_TO_FW := y # # Enable VERBOSE debug INI mechanism # diff --git a/core/hdd/inc/hdd_dp_cfg.h b/core/hdd/inc/hdd_dp_cfg.h index 58d34a18170a..07008ca95f77 100644 --- a/core/hdd/inc/hdd_dp_cfg.h +++ b/core/hdd/inc/hdd_dp_cfg.h @@ -1429,6 +1429,40 @@ WLAN_CFG_WMI_CREDIT_DEFAULT, \ CFG_VALUE_OR_DEFAULT, "WMI HTC CREDIT COUNT") +#define WLAN_CFG_ICMP_REQ_TO_FW_MARK_ALL (-1) +#define WLAN_CFG_ICMP_REQ_TO_FW_MARK_INTERVAL 0 +#define WLAN_CFG_ICMP_REQ_TO_FW_MARK_INTERVAL_MIN (-1) +#define WLAN_CFG_ICMP_REQ_TO_FW_MARK_INTERVAL_MAX 100000 + +/* + * + * icmp_req_to_fw_mark_interval - Interval to mark the ICMP Request packet + * to be sent to FW. + * @Min: -1 + * @Max: 100000 + * @Default: 0 + * + * This ini is used to control DP Software to mark the ICMP request packets + * to be sent to FW at certain interval (in milliseconds). + * The value 0 is used to disable marking of ICMP requests to be sent to FW. + * The value -1 is used to mark all the ICMP requests to be sent to FW. + * Any value greater than zero indicates the time interval (in milliseconds) + * at which ICMP requests are marked to be sent to FW. + * + * Supported modes: All modes + * + * Usage: External + * + * + */ +#define CFG_DP_ICMP_REQ_TO_FW_MARK_INTERVAL \ + CFG_INI_INT("icmp_req_to_fw_mark_interval", \ + WLAN_CFG_ICMP_REQ_TO_FW_MARK_INTERVAL_MIN, \ + WLAN_CFG_ICMP_REQ_TO_FW_MARK_INTERVAL_MAX, \ + WLAN_CFG_ICMP_REQ_TO_FW_MARK_INTERVAL, \ + CFG_VALUE_OR_DEFAULT, \ + "Interval to mark ICMP Request packets to be sent to FW") + #ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL #define CFG_HDD_DP_LEGACY_TX_FLOW \ CFG(CFG_DP_LL_TX_FLOW_LWM) \ @@ -1504,6 +1538,7 @@ CFG(CFG_DP_RX_WAKELOCK_TIMEOUT) \ CFG(CFG_DP_NUM_DP_RX_THREADS) \ CFG(CFG_DP_HTC_WMI_CREDIT_CNT) \ + CFG(CFG_DP_ICMP_REQ_TO_FW_MARK_INTERVAL) \ CFG_MSCS_FEATURE_ALL \ CFG_DP_ENABLE_FASTPATH_ALL \ CFG_HDD_DP_BUS_BANDWIDTH \ diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index b39bf067558b..3790cab4c8cc 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -266,6 +266,7 @@ struct hdd_config { #ifdef FEATURE_CLUB_LL_STATS_AND_GET_STATION uint32_t sta_stats_cache_expiry_time; #endif + int icmp_req_to_fw_mark_interval; }; /** diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index c12eea2752cc..11e0f1a6cda1 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -960,6 +960,52 @@ static void wlan_hdd_fix_broadcast_eapol(struct hdd_adapter *adapter, } #endif /* HANDLE_BROADCAST_EAPOL_TX_FRAME */ +#ifdef WLAN_DP_FEATURE_MARK_ICMP_REQ_TO_FW +/** + * hdd_mark_icmp_req_to_fw() - Mark the ICMP request at a certain time interval + * to be sent to the FW. + * @hdd_ctx: Global hdd context (Caller's responsibility to validate) + * @skb: packet to be transmitted + * + * This func sets the "to_fw" flag in the packet context block, if the + * current packet is an ICMP request packet. This marking is done at a + * specific time interval, unless the INI value indicates to disable/enable + * this for all frames. + * + * Return: none + */ +static void hdd_mark_icmp_req_to_fw(struct hdd_context *hdd_ctx, + struct sk_buff *skb) +{ + uint64_t curr_time, time_delta; + int time_interval_ms = hdd_ctx->config->icmp_req_to_fw_mark_interval; + static uint64_t prev_marked_icmp_time; + + if (!hdd_ctx->config->icmp_req_to_fw_mark_interval) + return; + + if (qdf_nbuf_get_icmp_subtype(skb) != QDF_PROTO_ICMP_REQ) + return; + + /* Mark all ICMP request to be sent to FW */ + if (time_interval_ms == WLAN_CFG_ICMP_REQ_TO_FW_MARK_ALL) + QDF_NBUF_CB_TX_PACKET_TO_FW(skb) = 1; + + curr_time = qdf_get_log_timestamp(); + time_delta = curr_time - prev_marked_icmp_time; + if (time_delta >= (time_interval_ms * + QDF_LOG_TIMESTAMP_CYCLES_PER_10_US * 100)) { + QDF_NBUF_CB_TX_PACKET_TO_FW(skb) = 1; + prev_marked_icmp_time = curr_time; + } +} +#else +static void hdd_mark_icmp_req_to_fw(struct hdd_context *hdd_ctx, + struct sk_buff *skb) +{ +} +#endif + /** * __hdd_hard_start_xmit() - Transmit a frame * @skb: pointer to OS packet (sk_buff) @@ -1052,15 +1098,9 @@ static void __hdd_hard_start_xmit(struct sk_buff *skb, } } else if (QDF_NBUF_CB_GET_PACKET_TYPE(skb) == QDF_NBUF_CB_PACKET_TYPE_ICMP) { - subtype = qdf_nbuf_get_icmp_subtype(skb); - /* - * Mark the ICMP requests to be sent to FW. - * The decision on whether its actually sent to FW - * is done in the DATAPATH layer. - */ - if (subtype == QDF_PROTO_ICMP_REQ) - QDF_NBUF_CB_TX_PACKET_TO_FW(skb) = 1; + hdd_mark_icmp_req_to_fw(hdd_ctx, skb); } + /* track connectivity stats */ if (adapter->pkt_type_bitmap) hdd_tx_rx_collect_connectivity_stats_info(skb, adapter, @@ -3681,6 +3721,8 @@ void hdd_dp_cfg_update(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_DP_RX_WAKELOCK_TIMEOUT); config->num_dp_rx_threads = cfg_get(psoc, CFG_DP_NUM_DP_RX_THREADS); config->cfg_wmi_credit_cnt = cfg_get(psoc, CFG_DP_HTC_WMI_CREDIT_CNT); + config->icmp_req_to_fw_mark_interval = + cfg_get(psoc, CFG_DP_ICMP_REQ_TO_FW_MARK_INTERVAL); hdd_dp_dp_trace_cfg_update(config, psoc); hdd_dp_nud_tracking_cfg_update(config, psoc); }