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

Commit 38dea860 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 63a1982b on remote branch

Change-Id: I324c701ce8590d80b7593cbce3a25a64fa76ad68
parents ccfb0efc 63a1982b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -552,7 +552,7 @@ cfg_store_print(struct wlan_objmgr_psoc *psoc)

#undef __CFG_INI
#define __CFG_INI(id, mtype, ctype, name, min, max, fallback, desc, def...) \
	cfg_nofl_debug("%s %u", name, *(ctype *)&store->values.id##_internal);
	cfg_nofl_debug("%s %d", name, *(ctype *)&store->values.id##_internal);

#undef __CFG_INI_STRING
#define __CFG_INI_STRING(id, mtype, ctype, name, min_len, max_len, ...) \
@@ -620,7 +620,7 @@ cfg_ini_config_print(struct wlan_objmgr_psoc *psoc, uint8_t *buf,
#undef __CFG_INI
#define __CFG_INI(id, mtype, ctype, name, min, max, fallback, desc, def...) \
	do { \
		len = qdf_scnprintf(buf, buflen, "%s %u\n", name, \
		len = qdf_scnprintf(buf, buflen, "%s %d\n", name, \
				    *(ctype *)&store->values.id##_internal); \
		buf += len; \
		buflen -= len; \
+1 −0
Original line number Diff line number Diff line
@@ -293,6 +293,7 @@ enum cdp_host_txrx_stats {
	TXRX_SOC_INTERRUPT_STATS = 12,
	TXRX_SOC_FSE_STATS = 13,
	TXRX_HAL_REG_WRITE_STATS = 14,
	TXRX_SOC_REO_HW_DESC_DUMP = 15,
	TXRX_HOST_STATS_MAX,
};

+13 −3
Original line number Diff line number Diff line
@@ -396,6 +396,7 @@ const int dp_stats_mapping_table[][STATS_TYPE_MAX] = {
	{TXRX_FW_STATS_INVALID, TXRX_SOC_INTERRUPT_STATS},
	{TXRX_FW_STATS_INVALID, TXRX_SOC_FSE_STATS},
	{TXRX_FW_STATS_INVALID, TXRX_HAL_REG_WRITE_STATS},
	{TXRX_FW_STATS_INVALID, TXRX_SOC_REO_HW_DESC_DUMP},
	{HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT, TXRX_HOST_STATS_INVALID}
};

@@ -5537,7 +5538,6 @@ static QDF_STATUS dp_vdev_attach_wifi3(struct cdp_soc_t *cdp_soc,
	qdf_spinlock_create(&vdev->peer_list_lock);
	TAILQ_INIT(&vdev->peer_list);
	dp_peer_multipass_list_init(vdev);

	if ((soc->intr_mode == DP_INTR_POLL) &&
	    wlan_cfg_get_num_contexts(soc->wlan_cfg_ctx) != 0) {
		if ((pdev->vdev_count == 0) ||
@@ -5574,14 +5574,19 @@ static QDF_STATUS dp_vdev_attach_wifi3(struct cdp_soc_t *cdp_soc,
		vdev->ap_bridge_enabled = true;
	else
		vdev->ap_bridge_enabled = false;

	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
		  "%s: wlan_cfg_ap_bridge_enabled %d",
		  __func__, vdev->ap_bridge_enabled);

	dp_tx_vdev_attach(vdev);

	if (pdev->vdev_count == 1)
		dp_lro_hash_setup(soc, pdev);
	if (!pdev->is_lro_hash_configured) {
		if (QDF_IS_STATUS_SUCCESS(dp_lro_hash_setup(soc, pdev)))
			pdev->is_lro_hash_configured = true;
		else
			dp_err("LRO hash setup failure!");
	}

	dp_info("Created vdev %pK ("QDF_MAC_ADDR_FMT")", vdev,
		QDF_MAC_ADDR_REF(vdev->mac_addr.raw));
@@ -5836,6 +5841,7 @@ static QDF_STATUS dp_vdev_detach_wifi3(struct cdp_soc_t *cdp_soc,
	if (vdev->opmode != wlan_op_mode_monitor)
		dp_vdev_pdev_list_remove(soc, pdev, vdev);

	pdev->vdev_count--;
	/* release reference taken above for find */
	dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_CDP);

@@ -8238,6 +8244,10 @@ dp_print_host_stats(struct dp_vdev *vdev,
		hal_dump_reg_write_stats(pdev->soc->hal_soc);
		hal_dump_reg_write_srng_stats(pdev->soc->hal_soc);
		break;
	case TXRX_SOC_REO_HW_DESC_DUMP:
		dp_get_rx_reo_queue_info((struct cdp_soc_t *)pdev->soc,
					 vdev->vdev_id);
		break;
	default:
		dp_info("Wrong Input For TxRx Host Stats");
		dp_txrx_stats_help();
+89 −0
Original line number Diff line number Diff line
@@ -2433,6 +2433,7 @@ QDF_STATUS dp_rx_tid_setup_wifi3(struct dp_peer *peer, int tid,
	} else {
		hw_qdesc_vaddr = rx_tid->hw_qdesc_vaddr_unaligned;
	}
	rx_tid->hw_qdesc_vaddr_aligned = hw_qdesc_vaddr;

	/* TODO: Ensure that sec_type is set before ADDBA is received.
	 * Currently this is set based on htt indication
@@ -4365,3 +4366,91 @@ struct dp_peer *dp_sta_vdev_self_peer_ref_n_get(struct dp_soc *soc,
	qdf_spin_unlock_bh(&vdev->peer_list_lock);
	return peer;
}

#ifdef DUMP_REO_QUEUE_INFO_IN_DDR
void dp_dump_rx_reo_queue_info(
	struct dp_soc *soc, void *cb_ctxt, union hal_reo_status *reo_status)
{
	struct dp_rx_tid *rx_tid = (struct dp_rx_tid *)cb_ctxt;

	if (!rx_tid)
		return;

	if (reo_status->fl_cache_status.header.status !=
		HAL_REO_CMD_SUCCESS) {
		dp_err_rl("Rx tid REO HW desc flush failed(%d)",
			  reo_status->rx_queue_status.header.status);
		return;
	}
	qdf_spin_lock_bh(&rx_tid->tid_lock);
	hal_dump_rx_reo_queue_desc(rx_tid->hw_qdesc_vaddr_aligned);
	qdf_spin_unlock_bh(&rx_tid->tid_lock);
}

void dp_send_cache_flush_for_rx_tid(
	struct dp_soc *soc, struct dp_peer *peer)
{
	int i;
	struct dp_rx_tid *rx_tid;
	struct hal_reo_cmd_params params;

	if (!peer) {
		dp_err_rl("Peer is NULL");
		return;
	}

	for (i = 0; i < DP_MAX_TIDS; i++) {
		rx_tid = &peer->rx_tid[i];
		if (!rx_tid)
			continue;
		qdf_spin_lock_bh(&rx_tid->tid_lock);
		if (rx_tid->hw_qdesc_vaddr_aligned) {
			qdf_mem_zero(&params, sizeof(params));
			params.std.need_status = 1;
			params.std.addr_lo =
				rx_tid->hw_qdesc_paddr & 0xffffffff;
			params.std.addr_hi =
				(uint64_t)(rx_tid->hw_qdesc_paddr) >> 32;
			params.u.fl_cache_params.flush_no_inval = 0;
			if (QDF_STATUS_SUCCESS !=
				dp_reo_send_cmd(
					soc, CMD_FLUSH_CACHE,
					&params, dp_dump_rx_reo_queue_info,
					(void *)rx_tid)) {
				dp_err_rl("cache flush send failed tid %d",
					  rx_tid->tid);
				qdf_spin_unlock_bh(&rx_tid->tid_lock);
				break;
			}
		}
		qdf_spin_unlock_bh(&rx_tid->tid_lock);
	}
}

void dp_get_rx_reo_queue_info(
	struct cdp_soc_t *soc_hdl, uint8_t vdev_id)
{
	struct dp_soc *soc = (struct dp_soc *)soc_hdl;
	struct dp_vdev *vdev = dp_vdev_get_ref_by_id(soc, vdev_id,
						     DP_MOD_ID_GENERIC_STATS);
	struct dp_peer *peer = NULL;

	if (!vdev) {
		dp_err_rl("vdev is null for vdev_id: %u", vdev_id);
		goto failed;
	}

	peer = dp_vdev_bss_peer_ref_n_get(soc, vdev, DP_MOD_ID_GENERIC_STATS);

	if (!peer) {
		dp_err_rl("Peer is NULL");
		goto failed;
	}
	dp_send_cache_flush_for_rx_tid(soc, peer);
failed:
	if (peer)
		dp_peer_unref_delete(peer, DP_MOD_ID_GENERIC_STATS);
	if (vdev)
		dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_GENERIC_STATS);
}
#endif /* DUMP_REO_QUEUE_INFO_IN_DDR */
+93 −0
Original line number Diff line number Diff line
@@ -22,6 +22,10 @@
#include <qdf_lock.h>
#include "dp_types.h"

#ifdef DUMP_REO_QUEUE_INFO_IN_DDR
#include "hal_reo.h"
#endif

#define DP_INVALID_PEER_ID 0xffff

#define DP_FW_PEER_STATS_CMP_TIMEOUT_MSEC 5000
@@ -843,4 +847,93 @@ static inline void dp_peer_delete_ast_entries(struct dp_soc *soc,
{
}
#endif

#ifdef FEATURE_MEC
/**
 * dp_peer_mec_spinlock_create() - Create the MEC spinlock
 * @soc: SoC handle
 *
 * Return: none
 */
void dp_peer_mec_spinlock_create(struct dp_soc *soc);

/**
 * dp_peer_mec_spinlock_destroy() - Destroy the MEC spinlock
 * @soc: SoC handle
 *
 * Return: none
 */
void dp_peer_mec_spinlock_destroy(struct dp_soc *soc);

/**
 * dp_peer_mec_flush_entries() - Delete all mec entries in table
 * @soc: Datapath SOC
 *
 * Return: None
 */
void dp_peer_mec_flush_entries(struct dp_soc *soc);
#else
static inline void dp_peer_mec_spinlock_create(struct dp_soc *soc)
{
}

static inline void dp_peer_mec_spinlock_destroy(struct dp_soc *soc)
{
}

static inline void dp_peer_mec_flush_entries(struct dp_soc *soc)
{
}
#endif

#ifdef DUMP_REO_QUEUE_INFO_IN_DDR
/**
 * dp_send_cache_flush_for_rx_tid() - Send cache flush cmd to REO per tid
 * @soc : dp_soc handle
 * @peer: peer
 *
 * This function is used to send cache flush cmd to reo and
 * to register the callback to handle the dumping of the reo
 * queue stas from DDR
 *
 * Return: none
 */
void dp_send_cache_flush_for_rx_tid(
	struct dp_soc *soc, struct dp_peer *peer);

/**
 * dp_get_rx_reo_queue_info() - Handler to get rx tid info
 * @soc : cdp_soc_t handle
 * @vdev_id: vdev id
 *
 * Handler to get rx tid info from DDR after h/w cache is
 * invalidated first using the cache flush cmd.
 *
 * Return: none
 */
void dp_get_rx_reo_queue_info(
	struct cdp_soc_t *soc_hdl, uint8_t vdev_id);

/**
 * dp_dump_rx_reo_queue_info() - Callback function to dump reo queue stats
 * @soc : dp_soc handle
 * @cb_ctxt - callback context
 * @reo_status: vdev id
 *
 * This is the callback function registered after sending the reo cmd
 * to flush the h/w cache and invalidate it. In the callback the reo
 * queue desc info is dumped from DDR.
 *
 * Return: none
 */
void dp_dump_rx_reo_queue_info(
	struct dp_soc *soc, void *cb_ctxt, union hal_reo_status *reo_status);

#else /* DUMP_REO_QUEUE_INFO_IN_DDR */

static inline void dp_get_rx_reo_queue_info(
	struct cdp_soc_t *soc_hdl, uint8_t vdev_id)
{
}
#endif /* DUMP_REO_QUEUE_INFO_IN_DDR */
#endif /* _DP_PEER_H_ */
Loading