summaryrefslogtreecommitdiff
path: root/umac
diff options
context:
space:
mode:
authorVivek <vchettri@codeaurora.org>2018-02-20 20:14:46 +0530
committersnandini <snandini@codeaurora.org>2018-02-22 07:26:01 -0800
commit5b3912a049a59398aaa559b0f90a4ee7559418db (patch)
tree6b2d46e7a7ed1eb2bf6e991ca328f8e107ddf67f /umac
parentfdaf38b849b96a9014e051cded9810f89e5756cf (diff)
downloadqca-wfi-host-cmn-5b3912a049a59398aaa559b0f90a4ee7559418db.tar.gz
qcacmn: Move mgmt descriptors per pdev for probe response throttling
In the current code, mgmt tx rx descriptors nubfs per pdev, which are in use when driver is unloaded, are tried to be freed in dispatcher_psoc_disable, by iterating through the pdevs which ideally should not be available. And in ideal conditions, there are no pdevs during psoc_disable, there was no attempt to free the nbuf of pdevs mgmt tx rx descriptors in use, which could have resulted in leaks but no assert. In some cases, by the time dispatcher_psoc_disable was called, and pdev count was non zero, we were seeing some issue accessing the pdev or pdev mgmt tx rx context and it was causing assert. The mgmt tx rx descriptors nubfs which are in use when the driver is unloaded, should be freed in dispcatcher pdev close and not in dispatcher psoc close. Change-Id: Ia6ac0b2ceeb017221153dab92bf014481eca2a5b CR's Fixed: 2187890
Diffstat (limited to 'umac')
-rw-r--r--umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h19
-rw-r--r--umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_utils_api.c70
2 files changed, 54 insertions, 35 deletions
diff --git a/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h b/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h
index eb53f3e2e..beada5a05 100644
--- a/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h
+++ b/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h
@@ -854,4 +854,23 @@ QDF_STATUS wlan_mgmt_txrx_psoc_open(struct wlan_objmgr_psoc *psoc);
* Return: QDF_STATUS_SUCCESS - in case of success
*/
QDF_STATUS wlan_mgmt_txrx_psoc_close(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * wlan_mgmt_txrx_pdev_open() - mgmt txrx module pdev open API
+ * @pdev: pdev context
+ *
+ * Return: QDF_STATUS_SUCCESS - in case of success
+ */
+QDF_STATUS wlan_mgmt_txrx_pdev_open(struct wlan_objmgr_pdev *pdev);
+
+
+/**
+ * wlan_mgmt_txrx_pdev_close() - mgmt txrx module pdev close API
+ * @pdev: pdev context
+ *
+ * Return: QDF_STATUS_SUCCESS - in case of success
+ */
+QDF_STATUS wlan_mgmt_txrx_pdev_close(struct wlan_objmgr_pdev *pdev);
#endif
+
+
diff --git a/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_utils_api.c b/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_utils_api.c
index 26bd84332..793660125 100644
--- a/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_utils_api.c
+++ b/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_utils_api.c
@@ -719,54 +719,54 @@ QDF_STATUS wlan_mgmt_txrx_psoc_open(struct wlan_objmgr_psoc *psoc)
QDF_STATUS wlan_mgmt_txrx_psoc_close(struct wlan_objmgr_psoc *psoc)
{
+ return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS wlan_mgmt_txrx_pdev_open(struct wlan_objmgr_pdev *pdev)
+{
+ return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS wlan_mgmt_txrx_pdev_close(struct wlan_objmgr_pdev *pdev)
+{
struct mgmt_txrx_priv_pdev_context *mgmt_txrx_pdev_ctx;
struct mgmt_txrx_desc_elem_t *mgmt_desc;
- uint16_t i;
uint32_t pool_size;
- uint8_t pdev_count, index;
- struct wlan_objmgr_pdev *pdev;
+ uint32_t index;
- if (!psoc) {
- mgmt_txrx_err("psoc context is NULL");
+ if (!pdev) {
+ mgmt_txrx_err("pdev context is NULL");
return QDF_STATUS_E_INVAL;
}
- pdev_count = wlan_psoc_get_pdev_count(psoc);
-
- for (index = 0; index < pdev_count; index++) {
- pdev = psoc->soc_objmgr.wlan_pdev_list[index];
+ mgmt_txrx_pdev_ctx = (struct mgmt_txrx_priv_pdev_context *)
+ wlan_objmgr_pdev_get_comp_private_obj(pdev,
+ WLAN_UMAC_COMP_MGMT_TXRX);
- if (!pdev) {
- mgmt_txrx_err("pdev context is NULL");
- return QDF_STATUS_E_INVAL;
- }
- mgmt_txrx_pdev_ctx = (struct mgmt_txrx_priv_pdev_context *)
- wlan_objmgr_pdev_get_comp_private_obj(pdev,
- WLAN_UMAC_COMP_MGMT_TXRX);
- if (!mgmt_txrx_pdev_ctx) {
- mgmt_txrx_err("mgmt txrx context is NULL");
+ if (!mgmt_txrx_pdev_ctx) {
+ mgmt_txrx_err("mgmt txrx context is NULL");
return QDF_STATUS_E_FAILURE;
- }
+ }
- pool_size = mgmt_txrx_pdev_ctx->mgmt_desc_pool.free_list.max_size;
- if (!pool_size) {
- mgmt_txrx_err("pool size is 0");
- return QDF_STATUS_E_FAILURE;
- }
+ pool_size = mgmt_txrx_pdev_ctx->mgmt_desc_pool.free_list.max_size;
+ if (!pool_size) {
+ mgmt_txrx_err("pool size is 0");
+ return QDF_STATUS_E_FAILURE;
+ }
- for (i = 0; i < pool_size; i++) {
- if (mgmt_txrx_pdev_ctx->mgmt_desc_pool.pool[i].in_use) {
- mgmt_txrx_info(
- "mgmt descriptor with desc id: %d not in freelist",
- i);
- mgmt_desc = &mgmt_txrx_pdev_ctx->mgmt_desc_pool.pool[i];
- qdf_nbuf_free(mgmt_desc->nbuf);
- wlan_objmgr_peer_release_ref(mgmt_desc->peer,
- WLAN_MGMT_SB_ID);
- wlan_mgmt_txrx_desc_put(mgmt_txrx_pdev_ctx, i);
- }
+ for (index = 0; index < pool_size; index++) {
+ if (mgmt_txrx_pdev_ctx->mgmt_desc_pool.pool[index].in_use) {
+ mgmt_txrx_info(
+ "mgmt descriptor with desc id: %d not in freelist",
+ index);
+ mgmt_desc = &mgmt_txrx_pdev_ctx->mgmt_desc_pool.pool[index];
+ qdf_nbuf_free(mgmt_desc->nbuf);
+ wlan_objmgr_peer_release_ref(mgmt_desc->peer,
+ WLAN_MGMT_SB_ID);
+ wlan_mgmt_txrx_desc_put(mgmt_txrx_pdev_ctx, index);
}
}
+
return QDF_STATUS_SUCCESS;
}