Kaynağa Gözat

qcacmn: SOC config for HW vdev stats in BE architecture

Add configuration at SOC level for hw vdev stats in BE architecture.

Following config parameters are added:
    vdev_stats_hw_offload: option to enable/disable hw vdev stats
    hw_vdev_stats_timer: timer duration for hw vdev stats

Change-Id: I8cbd2b6a7378d8a9e7de920a3a6fdff0cf7785fe
CRs-Fixed: 3067843
Harsh Kumar Bijlani 4 yıl önce
ebeveyn
işleme
f76548dd04

+ 4 - 0
dp/inc/cdp_txrx_cmn_struct.h

@@ -1270,6 +1270,7 @@ enum cdp_pdev_param_type {
  * @cdp_psoc_param_en_rate_stats: set rate stats enable/disable
  * @cdp_psoc_param_en_nss_cfg: set nss cfg
  * @cdp_ipa_enabled : set ipa mode
+ * @cdp_psoc_param_vdev_stats_hw_offload: Configure HW vdev stats offload
  */
 typedef union cdp_config_param_t {
 	/* peer params */
@@ -1347,6 +1348,7 @@ typedef union cdp_config_param_t {
 
 	bool cdp_skip_bar_update;
 	bool cdp_ipa_enabled;
+	bool cdp_psoc_param_vdev_stats_hw_offload;
 } cdp_config_param_type;
 
 /**
@@ -1472,6 +1474,7 @@ enum cdp_vdev_param_type {
  * @CDP_SET_PREFERRED_HW_MODE: set preferred hw mode
  * @CDP_CFG_PEER_EXT_STATS: Peer extended stats mode.
  * @CDP_IPA_ENABLE : set IPA enable mode.
+ * @CDP_SET_VDEV_STATS_HW_OFFLOAD: HW Vdev stats enable/disable
  */
 enum cdp_psoc_param_type {
 	CDP_ENABLE_RATE_STATS,
@@ -1479,6 +1482,7 @@ enum cdp_psoc_param_type {
 	CDP_SET_PREFERRED_HW_MODE,
 	CDP_CFG_PEER_EXT_STATS,
 	CDP_IPA_ENABLE,
+	CDP_SET_VDEV_STATS_HW_OFFLOAD,
 };
 
 #define TXRX_FW_STATS_TXSTATS                     1

+ 6 - 0
dp/wifi3.0/dp_main.c

@@ -9348,6 +9348,12 @@ dp_set_psoc_param(struct cdp_soc_t *cdp_soc,
 	case CDP_IPA_ENABLE:
 		soc->wlan_cfg_ctx->ipa_enabled = val.cdp_ipa_enabled;
 		break;
+#ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
+	case CDP_SET_VDEV_STATS_HW_OFFLOAD:
+		wlan_cfg_ctx->vdev_stats_hw_offload_config =
+				val.cdp_psoc_param_vdev_stats_hw_offload;
+		break;
+#endif
 	default:
 		break;
 	}

+ 24 - 1
wlan_cfg/cfg_dp.h

@@ -1201,6 +1201,28 @@
 		CFG_INI_BOOL("delay_mon_replenish", \
 		true, "Delay Monitor Replenish")
 
+#ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
+#define WLAN_CFG_INT_VDEV_STATS_HW_OFFLOAD_TIMER_MIN 500
+#define WLAN_CFG_INT_VDEV_STATS_HW_OFFLOAD_TIMER_MAX 2000
+#define WLAN_CFG_INT_VDEV_STATS_HW_OFFLOAD_TIMER 500
+
+#define CFG_DP_VDEV_STATS_HW_OFFLOAD_CONFIG \
+		CFG_INI_BOOL("vdev_stats_hw_offload_config", \
+		false, "Offload vdev stats to HW")
+#define CFG_DP_VDEV_STATS_HW_OFFLOAD_TIMER \
+		CFG_INI_UINT("vdev_stats_hw_offload_timer", \
+		WLAN_CFG_INT_VDEV_STATS_HW_OFFLOAD_TIMER_MIN, \
+		WLAN_CFG_INT_VDEV_STATS_HW_OFFLOAD_TIMER_MAX, \
+		WLAN_CFG_INT_VDEV_STATS_HW_OFFLOAD_TIMER, \
+		CFG_VALUE_OR_DEFAULT, \
+		"vdev stats hw offload timer duration")
+#define CFG_DP_VDEV_STATS_HW_OFFLOAD \
+	CFG(CFG_DP_VDEV_STATS_HW_OFFLOAD_CONFIG) \
+	CFG(CFG_DP_VDEV_STATS_HW_OFFLOAD_TIMER)
+#else
+#define CFG_DP_VDEV_STATS_HW_OFFLOAD
+#endif
+
 /*
  * <ini>
  * ghw_cc_enable - enable HW cookie conversion by register
@@ -1540,5 +1562,6 @@
 		CFG_DP_IPA_TX_RING_CFG \
 		CFG_DP_PPE_CONFIG \
 		CFG_DP_IPA_TX_ALT_RING_CFG \
-		CFG_DP_MLO_CONFIG
+		CFG_DP_MLO_CONFIG \
+		CFG_DP_VDEV_STATS_HW_OFFLOAD
 #endif /* _CFG_DP_H_ */

+ 51 - 0
wlan_cfg/wlan_cfg.c

@@ -1781,6 +1781,32 @@ wlan_soc_mlo_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
 }
 #endif
 
+#ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
+/**
+ * wlan_soc_vdev_hw_stats_cfg_attach() - Update hw vdev stats config in dp soc
+ *  cfg context
+ * @psoc - Object manager psoc
+ * @wlan_cfg_ctx - dp soc cfg ctx
+ *
+ * Return: None
+ */
+static void
+wlan_soc_vdev_hw_stats_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
+				  struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
+{
+	wlan_cfg_ctx->vdev_stats_hw_offload_config = cfg_get(psoc,
+					CFG_DP_VDEV_STATS_HW_OFFLOAD_CONFIG);
+	wlan_cfg_ctx->vdev_stats_hw_offload_timer = cfg_get(psoc,
+					CFG_DP_VDEV_STATS_HW_OFFLOAD_TIMER);
+}
+#else
+static void
+wlan_soc_vdev_hw_stats_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
+				  struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
+{
+}
+#endif
+
 /**
  * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration
  * @psoc - Object manager psoc
@@ -1971,6 +1997,7 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
 	wlan_soc_hw_cc_cfg_attach(psoc, wlan_cfg_ctx);
 	wlan_soc_ppe_cfg_attach(psoc, wlan_cfg_ctx);
 	wlan_soc_mlo_cfg_attach(psoc, wlan_cfg_ctx);
+	wlan_soc_vdev_hw_stats_cfg_attach(psoc, wlan_cfg_ctx);
 #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
 	wlan_cfg_ctx->pkt_capture_mode = cfg_get(psoc, CFG_PKT_CAPTURE_MODE) &
 						 PKT_CAPTURE_MODE_DATA_ONLY;
@@ -3102,3 +3129,27 @@ wlan_cfg_mlo_lmac_peer_id_msb_get_by_chip_id(struct wlan_cfg_dp_soc_ctxt *cfg,
 	return cfg->lmac_peer_id_msb[chip_id];
 }
 #endif
+
+#ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
+bool
+wlan_cfg_get_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg)
+{
+	return cfg->vdev_stats_hw_offload_config;
+}
+
+int wlan_cfg_get_vdev_stats_hw_offload_timer(struct wlan_cfg_dp_soc_ctxt *cfg)
+{
+	return cfg->vdev_stats_hw_offload_timer;
+}
+#else
+bool
+wlan_cfg_get_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg)
+{
+	return false;
+}
+
+int wlan_cfg_get_vdev_stats_hw_offload_timer(struct wlan_cfg_dp_soc_ctxt *cfg)
+{
+	return 0;
+}
+#endif

+ 24 - 0
wlan_cfg/wlan_cfg.h

@@ -244,6 +244,8 @@ struct wlan_srng_cfg {
  * @mlo_chip_rx_ring_map: map of chip_id to rx ring map
  * @mlo_chip_default_rx_ring_id: default rx_ring of chip when hash is not found
  * @lmac_peer_id_msb: value used for hash based routing
+ * @vdev_stats_hw_offload_config: HW vdev stats config
+ * @vdev_stats_hw_offload_timer: HW vdev stats timer duration
  */
 struct wlan_cfg_dp_soc_ctxt {
 	int num_int_ctxts;
@@ -397,6 +399,10 @@ struct wlan_cfg_dp_soc_ctxt {
 	uint8_t mlo_chip_default_rx_ring_id[WLAN_MAX_MLO_CHIPS];
 	uint8_t lmac_peer_id_msb[WLAN_MAX_MLO_CHIPS];
 #endif
+#ifdef QCA_VDEV_STATS_HW_OFFLOAD_SUPPORT
+	bool vdev_stats_hw_offload_config;
+	int vdev_stats_hw_offload_timer;
+#endif
 };
 
 /**
@@ -1948,6 +1954,24 @@ void
 wlan_cfg_set_rx_rel_ring_id(struct wlan_cfg_dp_soc_ctxt *cfg,
 			    uint8_t wbm2sw_ring_id);
 
+/**
+ * wlan_cfg_get_vdev_stats_hw_offload_config() - Get hw vdev stats offload
+ *						 config
+ * @cfg: config context
+ *
+ * Return: value of hw vdev stats config
+ */
+bool
+wlan_cfg_get_vdev_stats_hw_offload_config(struct wlan_cfg_dp_soc_ctxt *cfg);
+
+/**
+ * wlan_cfg_get_vdev_stats_hw_offload_timer()- Get hw vdev stats timer duration
+ * @cfg: config context
+ *
+ * Return: value of hw vdev stats timer duration
+ */
+int wlan_cfg_get_vdev_stats_hw_offload_timer(struct wlan_cfg_dp_soc_ctxt *cfg);
+
 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
 /**
  * wlan_cfg_mlo_rx_ring_map_get_by_chip_id() - get rx ring map