diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index 8b0f85d801..b05fe27cdb 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -1013,6 +1013,8 @@ int htt_h2t_rx_ring_cfg(struct htt_soc *htt_soc, int pdev_id, uint32_t htt_ring_type, htt_ring_id; uint32_t tlv_filter; uint8_t *htt_logger_bufp; + struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx = soc->dp_soc->wlan_cfg_ctx; + uint32_t mon_drop_th = wlan_cfg_get_mon_drop_thresh(wlan_cfg_ctx); htt_msg = qdf_nbuf_alloc(soc->osdev, HTT_MSG_BUF_SIZE(HTT_RX_RING_SELECTION_CFG_SZ), @@ -1101,6 +1103,13 @@ int htt_h2t_rx_ring_cfg(struct htt_soc *htt_soc, int pdev_id, HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(*msg_word, htt_tlv_filter->offset_valid); + if (mon_drop_th > 0) + HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(*msg_word, + 1); + else + HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(*msg_word, + 0); + /* word 1 */ msg_word++; *msg_word = 0; @@ -1664,8 +1673,17 @@ int htt_h2t_rx_ring_cfg(struct htt_soc *htt_soc, int pdev_id, *msg_word = 0; HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(*msg_word, htt_tlv_filter->rx_attn_offset); + msg_word++; + *msg_word = 0; + } else { + msg_word += 4; + *msg_word = 0; } + if (mon_drop_th > 0) + HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(*msg_word, + mon_drop_th); + /* "response_required" field should be set if a HTT response message is * required after setting up the ring. */ diff --git a/wlan_cfg/cfg_dp.h b/wlan_cfg/cfg_dp.h index 781acee179..9c990d0aaa 100644 --- a/wlan_cfg/cfg_dp.h +++ b/wlan_cfg/cfg_dp.h @@ -277,6 +277,10 @@ #define WLAN_CFG_RXDMA_ERR_DST_RING_SIZE_MIN 1024 #define WLAN_CFG_RXDMA_ERR_DST_RING_SIZE_MAX 8192 +#define WLAN_CFG_RXDMA_MONITOR_RX_DROP_THRESH_SIZE 32 +#define WLAN_CFG_RXDMA_MONITOR_RX_DROP_THRESH_SIZE_MIN 0 +#define WLAN_CFG_RXDMA_MONITOR_RX_DROP_THRESH_SIZE_MAX 256 + /** * Allocate as many RX descriptors as buffers in the SW2RXDMA * ring. This value may need to be tuned later. @@ -744,6 +748,13 @@ CFG_INI_BOOL("dp_rx_monitor_protocol_flow_tag_enable", true, \ "Enable/Disable Rx Protocol & Flow tags in Monitor mode") +#define CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD \ + CFG_INI_UINT("mon_drop_thresh", \ + WLAN_CFG_RXDMA_MONITOR_RX_DROP_THRESH_SIZE_MIN, \ + WLAN_CFG_RXDMA_MONITOR_RX_DROP_THRESH_SIZE_MAX, \ + WLAN_CFG_RXDMA_MONITOR_RX_DROP_THRESH_SIZE, \ + CFG_VALUE_OR_DEFAULT, "RXDMA monitor rx drop theshold") + #define CFG_DP \ CFG(CFG_DP_HTT_PACKET_TYPE) \ CFG(CFG_DP_INT_BATCH_THRESHOLD_OTHER) \ @@ -813,6 +824,6 @@ CFG(CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE) \ CFG(CFG_DP_RX_FLOW_TAG_ENABLE) \ CFG(CFG_DP_RX_FLOW_SEARCH_TABLE_PER_PDEV) \ - CFG(CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE) - + CFG(CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE) \ + CFG(CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD) #endif /* _CFG_DP_H_ */ diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index b578463554..09e4915e21 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -440,7 +440,8 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc) cfg_get(psoc, CFG_DP_RX_FLOW_SEARCH_TABLE_SIZE); wlan_cfg_ctx->is_rx_mon_protocol_flow_tag_enabled = cfg_get(psoc, CFG_DP_RX_MON_PROTOCOL_FLOW_TAG_ENABLE); - + wlan_cfg_ctx->mon_drop_thresh = + cfg_get(psoc, CFG_DP_RXDMA_MONITOR_RX_DROP_THRESHOLD); return wlan_cfg_ctx; } @@ -479,6 +480,11 @@ void wlan_cfg_pdev_detach(struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx) qdf_mem_free(wlan_cfg_ctx); } +int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg) +{ + return cfg->mon_drop_thresh; +} + void wlan_cfg_set_num_contexts(struct wlan_cfg_dp_soc_ctxt *cfg, int num) { cfg->num_int_ctxts = num; diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index 1d0b6a21b4..250b872683 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -252,6 +252,7 @@ struct wlan_cfg_dp_soc_ctxt { int tx_desc_limit_2; int tx_device_limit; int tx_sw_internode_queue; + int mon_drop_thresh; #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT uint32_t tx_comp_loop_pkt_limit; uint32_t rx_reap_loop_pkt_limit; @@ -344,6 +345,7 @@ void wlan_cfg_set_rxbuf_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context, void wlan_cfg_set_max_peer_id(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val); void wlan_cfg_set_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg, uint32_t val); int wlan_cfg_get_max_ast_idx(struct wlan_cfg_dp_soc_ctxt *cfg); +int wlan_cfg_get_mon_drop_thresh(struct wlan_cfg_dp_soc_ctxt *cfg); int wlan_cfg_set_rx_err_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context, int mask); int wlan_cfg_set_rx_wbm_rel_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,