Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce5c847e authored by gaurank kathpalia's avatar gaurank kathpalia Committed by Gerrit - the friendly Code Review server
Browse files

qcacmn: Fix memory allocation latency in beacon process

Currently if the number of APs in the STA environment
are many, then the STA will receive many beacons, whose
beacon process path can take long time, in the kernel
work queue, hence the other processes have to wait
for them to complete, and may get timeout, if the
the time to process the beaocns is larger than their
process timeout.

Fix is to :-
1. Add rate limit to failure conditions of memory
not allocated
2. Make memory allocation in path of beacon process
atomic.

Change-Id: I0b15fd4924bb7d696a33adeb1875f1f9c277db18
CRs-Fixed: 2360624
parent 5d61ede9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -809,9 +809,10 @@ static QDF_STATUS wlan_mgmt_txrx_rx_handler_list_copy(
	struct mgmt_rx_handler *rx_handler_node;

	while (rx_handler) {
		rx_handler_node = qdf_mem_malloc(sizeof(*rx_handler_node));
		rx_handler_node =
				qdf_mem_malloc_atomic(sizeof(*rx_handler_node));
		if (!rx_handler_node) {
			mgmt_txrx_err("Couldn't allocate memory for rx handler node");
			mgmt_txrx_err_rl("Couldn't allocate memory for rx handler node");
			return QDF_STATUS_E_NOMEM;
		}

+2 −0
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@
	p2p_logl(QDF_TRACE_LEVEL_ERROR, format, ## args)
#define p2p_alert(format, args ...) \
	p2p_logl(QDF_TRACE_LEVEL_FATAL, format, ## args)
#define p2p_debug_rl(params...) \
	QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_P2P, params)

struct scheduler_msg;
struct p2p_tx_cnf;
+4 −4
Original line number Diff line number Diff line
@@ -211,17 +211,17 @@ QDF_STATUS tgt_p2p_mgmt_frame_rx_cb(struct wlan_objmgr_psoc *psoc,
		vdev_id = wlan_vdev_get_id(vdev);
	}

	rx_mgmt_event = qdf_mem_malloc(sizeof(*rx_mgmt_event));
	rx_mgmt_event = qdf_mem_malloc_atomic(sizeof(*rx_mgmt_event));
	if (!rx_mgmt_event) {
		p2p_err("Failed to allocate rx mgmt event");
		p2p_debug_rl("Failed to allocate rx mgmt event");
		qdf_nbuf_free(buf);
		return QDF_STATUS_E_NOMEM;
	}

	rx_mgmt = qdf_mem_malloc(sizeof(*rx_mgmt) +
	rx_mgmt = qdf_mem_malloc_atomic(sizeof(*rx_mgmt) +
			mgmt_rx_params->buf_len);
	if (!rx_mgmt) {
		p2p_err("Failed to allocate rx mgmt frame");
		p2p_debug_rl("Failed to allocate rx mgmt frame");
		qdf_nbuf_free(buf);
		return QDF_STATUS_E_NOMEM;
	}
+2 −2
Original line number Diff line number Diff line
@@ -272,14 +272,14 @@ QDF_STATUS tgt_scan_bcn_probe_rx_callback(struct wlan_objmgr_psoc *psoc,
	bcn = qdf_mem_malloc(sizeof(*bcn));

	if (!bcn) {
		scm_err("Failed to allocate memory for bcn");
		scm_debug_rl("Failed to allocate memory for bcn");
		status = QDF_STATUS_E_NOMEM;
		goto free;
	}
	bcn->rx_data =
		qdf_mem_malloc(sizeof(*rx_param));
	if (!bcn->rx_data) {
		scm_err("Failed to allocate memory for rx_data");
		scm_debug_rl("Failed to allocate memory for rx_data");
		status = QDF_STATUS_E_NOMEM;
		goto free;
	}
+2 −1
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@
#define TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE     1000
#define TDLS_SCAN_REJECT_MAX            5


#define tdls_log(level, args...) \
	QDF_TRACE(QDF_MODULE_ID_TDLS, level, ## args)
#define tdls_logfl(level, format, args...) \
@@ -73,6 +72,8 @@
	tdls_logfl(QDF_TRACE_LEVEL_ERROR, format, ## args)
#define tdls_alert(format, args...) \
	tdls_logfl(QDF_TRACE_LEVEL_FATAL, format, ## args)
#define tdls_debug_rl(params...) \
	QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_TDLS, params)

#define TDLS_IS_LINK_CONNECTED(peer)  \
	((TDLS_LINK_CONNECTED == (peer)->link_status) || \
Loading