qcacmn: Add datapath config event history
Add history to record the config/control events e.g. peer create/delete/unref-delete, vdev attach/detach in datapath. Change-Id: Ic3c8122fca9124e41931ec445946aec5e8863434 CRs-Fixed: 3371899
This commit is contained in:

committed by
Madan Koyyalamudi

parent
b4466310b5
commit
ada0c97d9b
@@ -4400,6 +4400,250 @@ void dp_destroy_direct_link_refill_ring(struct cdp_soc_t *soc_hdl,
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_DP_CFG_EVENT_HISTORY
|
||||
static inline
|
||||
void dp_cfg_event_record(struct dp_soc *soc,
|
||||
enum dp_cfg_event_type event,
|
||||
union dp_cfg_event_desc *cfg_event_desc)
|
||||
{
|
||||
struct dp_cfg_event_history *cfg_event_history =
|
||||
&soc->cfg_event_history;
|
||||
struct dp_cfg_event *entry;
|
||||
uint32_t idx;
|
||||
uint16_t slot;
|
||||
|
||||
dp_get_frag_hist_next_atomic_idx(&cfg_event_history->index, &idx,
|
||||
&slot,
|
||||
DP_CFG_EVT_HIST_SLOT_SHIFT,
|
||||
DP_CFG_EVT_HIST_PER_SLOT_MAX,
|
||||
DP_CFG_EVT_HISTORY_SIZE);
|
||||
|
||||
entry = &cfg_event_history->entry[slot][idx];
|
||||
|
||||
entry->timestamp = qdf_get_log_timestamp();
|
||||
entry->type = event;
|
||||
qdf_mem_copy(&entry->event_desc, cfg_event_desc,
|
||||
sizeof(entry->event_desc));
|
||||
}
|
||||
|
||||
static inline void
|
||||
dp_cfg_event_record_vdev_evt(struct dp_soc *soc, enum dp_cfg_event_type event,
|
||||
struct dp_vdev *vdev)
|
||||
{
|
||||
union dp_cfg_event_desc cfg_evt_desc = {0};
|
||||
struct dp_vdev_attach_detach_desc *vdev_evt =
|
||||
&cfg_evt_desc.vdev_evt;
|
||||
|
||||
if (qdf_unlikely(event != DP_CFG_EVENT_VDEV_ATTACH &&
|
||||
event != DP_CFG_EVENT_VDEV_UNREF_DEL &&
|
||||
event != DP_CFG_EVENT_VDEV_DETACH)) {
|
||||
qdf_assert_always(0);
|
||||
return;
|
||||
}
|
||||
|
||||
vdev_evt->vdev = vdev;
|
||||
vdev_evt->vdev_id = vdev->vdev_id;
|
||||
vdev_evt->ref_count = qdf_atomic_read(&vdev->ref_cnt);
|
||||
vdev_evt->mac_addr = vdev->mac_addr;
|
||||
|
||||
dp_cfg_event_record(soc, event, &cfg_evt_desc);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dp_cfg_event_record_peer_evt(struct dp_soc *soc, enum dp_cfg_event_type event,
|
||||
struct dp_peer *peer, struct dp_vdev *vdev,
|
||||
uint8_t is_reuse)
|
||||
{
|
||||
union dp_cfg_event_desc cfg_evt_desc = {0};
|
||||
struct dp_peer_cmn_ops_desc *peer_evt = &cfg_evt_desc.peer_cmn_evt;
|
||||
|
||||
if (qdf_unlikely(event != DP_CFG_EVENT_PEER_CREATE &&
|
||||
event != DP_CFG_EVENT_PEER_DELETE &&
|
||||
event != DP_CFG_EVENT_PEER_UNREF_DEL)) {
|
||||
qdf_assert_always(0);
|
||||
return;
|
||||
}
|
||||
|
||||
peer_evt->peer = peer;
|
||||
peer_evt->vdev = vdev;
|
||||
peer_evt->vdev_id = vdev->vdev_id;
|
||||
peer_evt->is_reuse = is_reuse;
|
||||
peer_evt->peer_ref_count = qdf_atomic_read(&peer->ref_cnt);
|
||||
peer_evt->vdev_ref_count = qdf_atomic_read(&vdev->ref_cnt);
|
||||
peer_evt->mac_addr = peer->mac_addr;
|
||||
peer_evt->vdev_mac_addr = vdev->mac_addr;
|
||||
|
||||
dp_cfg_event_record(soc, event, &cfg_evt_desc);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dp_cfg_event_record_mlo_link_delink_evt(struct dp_soc *soc,
|
||||
enum dp_cfg_event_type event,
|
||||
struct dp_peer *mld_peer,
|
||||
struct dp_peer *link_peer,
|
||||
uint8_t idx, uint8_t result)
|
||||
{
|
||||
union dp_cfg_event_desc cfg_evt_desc = {0};
|
||||
struct dp_mlo_add_del_link_desc *mlo_link_delink_evt =
|
||||
&cfg_evt_desc.mlo_link_delink_evt;
|
||||
|
||||
if (qdf_unlikely(event != DP_CFG_EVENT_MLO_ADD_LINK &&
|
||||
event != DP_CFG_EVENT_MLO_DEL_LINK)) {
|
||||
qdf_assert_always(0);
|
||||
return;
|
||||
}
|
||||
|
||||
mlo_link_delink_evt->link_peer = link_peer;
|
||||
mlo_link_delink_evt->mld_peer = mld_peer;
|
||||
mlo_link_delink_evt->link_mac_addr = link_peer->mac_addr;
|
||||
mlo_link_delink_evt->mld_mac_addr = mld_peer->mac_addr;
|
||||
mlo_link_delink_evt->num_links = mld_peer->num_links;
|
||||
mlo_link_delink_evt->action_result = result;
|
||||
mlo_link_delink_evt->idx = idx;
|
||||
|
||||
dp_cfg_event_record(soc, event, &cfg_evt_desc);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dp_cfg_event_record_mlo_setup_vdev_update_evt(struct dp_soc *soc,
|
||||
struct dp_peer *mld_peer,
|
||||
struct dp_vdev *prev_vdev,
|
||||
struct dp_vdev *new_vdev)
|
||||
{
|
||||
union dp_cfg_event_desc cfg_evt_desc = {0};
|
||||
struct dp_mlo_setup_vdev_update_desc *vdev_update_evt =
|
||||
&cfg_evt_desc.mlo_setup_vdev_update;
|
||||
|
||||
vdev_update_evt->mld_peer = mld_peer;
|
||||
vdev_update_evt->prev_vdev = prev_vdev;
|
||||
vdev_update_evt->new_vdev = new_vdev;
|
||||
|
||||
dp_cfg_event_record(soc, DP_CFG_EVENT_MLO_SETUP_VDEV_UPDATE,
|
||||
&cfg_evt_desc);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dp_cfg_event_record_peer_map_unmap_evt(struct dp_soc *soc,
|
||||
enum dp_cfg_event_type event,
|
||||
struct dp_peer *peer,
|
||||
uint8_t *mac_addr,
|
||||
uint8_t is_ml_peer,
|
||||
uint16_t peer_id, uint16_t ml_peer_id,
|
||||
uint16_t hw_peer_id, uint8_t vdev_id)
|
||||
{
|
||||
union dp_cfg_event_desc cfg_evt_desc = {0};
|
||||
struct dp_rx_peer_map_unmap_desc *peer_map_unmap_evt =
|
||||
&cfg_evt_desc.peer_map_unmap_evt;
|
||||
|
||||
if (qdf_unlikely(event != DP_CFG_EVENT_PEER_MAP &&
|
||||
event != DP_CFG_EVENT_PEER_UNMAP &&
|
||||
event != DP_CFG_EVENT_MLO_PEER_MAP &&
|
||||
event != DP_CFG_EVENT_MLO_PEER_UNMAP)) {
|
||||
qdf_assert_always(0);
|
||||
return;
|
||||
}
|
||||
|
||||
peer_map_unmap_evt->peer_id = peer_id;
|
||||
peer_map_unmap_evt->ml_peer_id = ml_peer_id;
|
||||
peer_map_unmap_evt->hw_peer_id = hw_peer_id;
|
||||
peer_map_unmap_evt->vdev_id = vdev_id;
|
||||
/* Peer may be NULL at times, but its not an issue. */
|
||||
peer_map_unmap_evt->peer = peer;
|
||||
peer_map_unmap_evt->is_ml_peer = is_ml_peer;
|
||||
qdf_mem_copy(&peer_map_unmap_evt->mac_addr.raw, mac_addr,
|
||||
QDF_MAC_ADDR_SIZE);
|
||||
|
||||
dp_cfg_event_record(soc, event, &cfg_evt_desc);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dp_cfg_event_record_peer_setup_evt(struct dp_soc *soc,
|
||||
enum dp_cfg_event_type event,
|
||||
struct dp_peer *peer,
|
||||
struct dp_vdev *vdev,
|
||||
uint8_t vdev_id,
|
||||
struct cdp_peer_setup_info *peer_setup_info)
|
||||
{
|
||||
union dp_cfg_event_desc cfg_evt_desc = {0};
|
||||
struct dp_peer_setup_desc *peer_setup_evt =
|
||||
&cfg_evt_desc.peer_setup_evt;
|
||||
|
||||
if (qdf_unlikely(event != DP_CFG_EVENT_PEER_SETUP &&
|
||||
event != DP_CFG_EVENT_MLO_SETUP)) {
|
||||
qdf_assert_always(0);
|
||||
return;
|
||||
}
|
||||
|
||||
peer_setup_evt->peer = peer;
|
||||
peer_setup_evt->vdev = vdev;
|
||||
if (vdev)
|
||||
peer_setup_evt->vdev_ref_count = qdf_atomic_read(&vdev->ref_cnt);
|
||||
peer_setup_evt->mac_addr = peer->mac_addr;
|
||||
peer_setup_evt->vdev_id = vdev_id;
|
||||
if (peer_setup_info) {
|
||||
peer_setup_evt->is_first_link = peer_setup_info->is_first_link;
|
||||
peer_setup_evt->is_primary_link = peer_setup_info->is_primary_link;
|
||||
qdf_mem_copy(peer_setup_evt->mld_mac_addr.raw,
|
||||
peer_setup_info->mld_peer_mac,
|
||||
QDF_MAC_ADDR_SIZE);
|
||||
}
|
||||
|
||||
dp_cfg_event_record(soc, event, &cfg_evt_desc);
|
||||
}
|
||||
#else
|
||||
|
||||
static inline void
|
||||
dp_cfg_event_record_vdev_evt(struct dp_soc *soc, enum dp_cfg_event_type event,
|
||||
struct dp_vdev *vdev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
dp_cfg_event_record_peer_evt(struct dp_soc *soc, enum dp_cfg_event_type event,
|
||||
struct dp_peer *peer, struct dp_vdev *vdev,
|
||||
uint8_t is_reuse)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
dp_cfg_event_record_mlo_link_delink_evt(struct dp_soc *soc,
|
||||
enum dp_cfg_event_type event,
|
||||
struct dp_peer *mld_peer,
|
||||
struct dp_peer *link_peer,
|
||||
uint8_t idx, uint8_t result)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
dp_cfg_event_record_mlo_setup_vdev_update_evt(struct dp_soc *soc,
|
||||
struct dp_peer *mld_peer,
|
||||
struct dp_vdev *prev_vdev,
|
||||
struct dp_vdev *new_vdev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
dp_cfg_event_record_peer_map_unmap_evt(struct dp_soc *soc,
|
||||
enum dp_cfg_event_type event,
|
||||
struct dp_peer *peer,
|
||||
uint8_t *mac_addr,
|
||||
uint8_t is_ml_peer,
|
||||
uint16_t peer_id, uint16_t ml_peer_id,
|
||||
uint16_t hw_peer_id, uint8_t vdev_id)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
dp_cfg_event_record_peer_setup_evt(struct dp_soc *soc,
|
||||
enum dp_cfg_event_type event,
|
||||
struct dp_peer *peer,
|
||||
struct dp_vdev *vdev,
|
||||
uint8_t vdev_id,
|
||||
struct cdp_peer_setup_info *peer_setup_info)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* dp_soc_interrupt_detach() - Deregister any allocations done for interrupts
|
||||
* @txrx_soc: DP SOC handle
|
||||
|
@@ -5549,6 +5549,47 @@ static void dp_free_ipa_rx_alt_refill_buf_ring(struct dp_soc *soc,
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_DP_CFG_EVENT_HISTORY
|
||||
|
||||
/**
|
||||
* dp_soc_cfg_history_attach() - Allocate and attach datapath config events
|
||||
* history
|
||||
* @soc: DP soc handle
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static void dp_soc_cfg_history_attach(struct dp_soc *soc)
|
||||
{
|
||||
dp_soc_frag_history_attach(soc, &soc->cfg_event_history,
|
||||
DP_CFG_EVT_HIST_MAX_SLOTS,
|
||||
DP_CFG_EVT_HIST_PER_SLOT_MAX,
|
||||
sizeof(struct dp_cfg_event),
|
||||
true, DP_CFG_EVENT_HIST_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* dp_soc_cfg_history_detach() - Detach and free DP config events history
|
||||
* @soc: DP soc handle
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
static void dp_soc_cfg_history_detach(struct dp_soc *soc)
|
||||
{
|
||||
dp_soc_frag_history_detach(soc, &soc->cfg_event_history,
|
||||
DP_CFG_EVT_HIST_MAX_SLOTS,
|
||||
true, DP_CFG_EVENT_HIST_TYPE);
|
||||
}
|
||||
|
||||
#else
|
||||
static void dp_soc_cfg_history_attach(struct dp_soc *soc)
|
||||
{
|
||||
}
|
||||
|
||||
static void dp_soc_cfg_history_detach(struct dp_soc *soc)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DP_TX_HW_DESC_HISTORY
|
||||
/**
|
||||
* dp_soc_tx_hw_desc_history_attach - Attach TX HW descriptor history
|
||||
@@ -6561,6 +6602,7 @@ static void dp_soc_detach(struct cdp_soc_t *txrx_soc)
|
||||
dp_soc_tx_history_detach(soc);
|
||||
dp_soc_mon_status_ring_history_detach(soc);
|
||||
dp_soc_rx_history_detach(soc);
|
||||
dp_soc_cfg_history_detach(soc);
|
||||
|
||||
if (!dp_monitor_modularized_enable()) {
|
||||
dp_mon_soc_detach_wrapper(soc);
|
||||
@@ -7385,6 +7427,7 @@ static QDF_STATUS dp_vdev_attach_wifi3(struct cdp_soc_t *cdp_soc,
|
||||
dp_err("LRO hash setup failure!");
|
||||
}
|
||||
|
||||
dp_cfg_event_record_vdev_evt(soc, DP_CFG_EVENT_VDEV_ATTACH, vdev);
|
||||
dp_info("Created vdev %pK ("QDF_MAC_ADDR_FMT") vdev_id %d", vdev,
|
||||
QDF_MAC_ADDR_REF(vdev->mac_addr.raw), vdev->vdev_id);
|
||||
DP_STATS_INIT(vdev);
|
||||
@@ -7780,6 +7823,7 @@ static QDF_STATUS dp_vdev_detach_wifi3(struct cdp_soc_t *cdp_soc,
|
||||
TAILQ_INSERT_TAIL(&soc->inactive_vdev_list, vdev, inactive_list_elem);
|
||||
qdf_spin_unlock_bh(&soc->inactive_vdev_list_lock);
|
||||
|
||||
dp_cfg_event_record_vdev_evt(soc, DP_CFG_EVENT_VDEV_DETACH, vdev);
|
||||
dp_info("detach vdev %pK id %d pending refs %d",
|
||||
vdev, vdev->vdev_id, qdf_atomic_read(&vdev->ref_cnt));
|
||||
|
||||
@@ -8097,6 +8141,8 @@ dp_peer_create_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
|
||||
dp_peer_hw_txrx_stats_init(soc, peer->txrx_peer);
|
||||
}
|
||||
|
||||
dp_cfg_event_record_peer_evt(soc, DP_CFG_EVENT_PEER_CREATE,
|
||||
peer, vdev, 1);
|
||||
dp_info("vdev %pK Reused peer %pK ("QDF_MAC_ADDR_FMT
|
||||
") vdev_ref_cnt "
|
||||
"%d peer_ref_cnt: %d",
|
||||
@@ -8189,6 +8235,8 @@ dp_peer_create_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
|
||||
/* Initialize the peer state */
|
||||
peer->state = OL_TXRX_PEER_STATE_DISC;
|
||||
|
||||
dp_cfg_event_record_peer_evt(soc, DP_CFG_EVENT_PEER_CREATE,
|
||||
peer, vdev, 0);
|
||||
dp_info("vdev %pK created peer %pK ("QDF_MAC_ADDR_FMT") vdev_ref_cnt "
|
||||
"%d peer_ref_cnt: %d",
|
||||
vdev, peer, QDF_MAC_ADDR_REF(peer->mac_addr.raw),
|
||||
@@ -8265,6 +8313,8 @@ QDF_STATUS dp_peer_mlo_setup(
|
||||
if (!setup_info || !setup_info->mld_peer_mac)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
dp_cfg_event_record_peer_setup_evt(soc, DP_CFG_EVENT_MLO_SETUP,
|
||||
peer, NULL, vdev_id, setup_info);
|
||||
dp_info("link peer: " QDF_MAC_ADDR_FMT "mld peer: " QDF_MAC_ADDR_FMT
|
||||
"first_link %d, primary_link %d",
|
||||
QDF_MAC_ADDR_REF(peer->mac_addr.raw),
|
||||
@@ -8302,12 +8352,14 @@ QDF_STATUS dp_peer_mlo_setup(
|
||||
|
||||
if (setup_info->is_primary_link &&
|
||||
!setup_info->is_first_link) {
|
||||
struct dp_vdev *prev_vdev;
|
||||
/*
|
||||
* if first link is not the primary link,
|
||||
* then need to change mld_peer->vdev as
|
||||
* primary link dp_vdev is not same one
|
||||
* during mld peer creation.
|
||||
*/
|
||||
prev_vdev = mld_peer->vdev;
|
||||
dp_info("Primary link is not the first link. vdev: %pK,"
|
||||
"vdev_id %d vdev_ref_cnt %d",
|
||||
mld_peer->vdev, vdev_id,
|
||||
@@ -8322,6 +8374,11 @@ QDF_STATUS dp_peer_mlo_setup(
|
||||
mld_peer->vdev = dp_vdev_get_ref_by_id(soc, vdev_id,
|
||||
DP_MOD_ID_CHILD);
|
||||
mld_peer->txrx_peer->vdev = mld_peer->vdev;
|
||||
|
||||
dp_cfg_event_record_mlo_setup_vdev_update_evt(
|
||||
soc, mld_peer, prev_vdev,
|
||||
mld_peer->vdev);
|
||||
|
||||
}
|
||||
|
||||
/* associate mld and link peer */
|
||||
@@ -8542,6 +8599,9 @@ dp_peer_setup_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
|
||||
&reo_dest, &hash_based,
|
||||
&lmac_peer_id_msb);
|
||||
|
||||
dp_cfg_event_record_peer_setup_evt(soc, DP_CFG_EVENT_PEER_SETUP,
|
||||
peer, vdev, vdev->vdev_id,
|
||||
setup_info);
|
||||
dp_info("pdev: %d vdev :%d opmode:%u peer %pK (" QDF_MAC_ADDR_FMT ") "
|
||||
"hash-based-steering:%d default-reo_dest:%u",
|
||||
pdev->pdev_id, vdev->vdev_id,
|
||||
@@ -8990,6 +9050,8 @@ free_vdev:
|
||||
/* delete this peer from the list */
|
||||
qdf_spin_unlock_bh(&soc->inactive_vdev_list_lock);
|
||||
|
||||
dp_cfg_event_record_vdev_evt(soc, DP_CFG_EVENT_VDEV_UNREF_DEL,
|
||||
vdev);
|
||||
dp_info("deleting vdev object %pK ("QDF_MAC_ADDR_FMT")",
|
||||
vdev, QDF_MAC_ADDR_REF(vdev->mac_addr.raw));
|
||||
wlan_minidump_remove(vdev, sizeof(*vdev), soc->ctrl_psoc,
|
||||
@@ -9073,6 +9135,8 @@ void dp_peer_unref_delete(struct dp_peer *peer, enum dp_mod_id mod_id)
|
||||
qdf_spinlock_destroy(&peer->peer_state_lock);
|
||||
|
||||
dp_txrx_peer_detach(soc, peer);
|
||||
dp_cfg_event_record_peer_evt(soc, DP_CFG_EVENT_PEER_UNREF_DEL,
|
||||
peer, vdev, 0);
|
||||
qdf_mem_free(peer);
|
||||
|
||||
/*
|
||||
@@ -9146,6 +9210,8 @@ static QDF_STATUS dp_peer_delete_wifi3(struct cdp_soc_t *soc_hdl,
|
||||
|
||||
peer->valid = 0;
|
||||
|
||||
dp_cfg_event_record_peer_evt(soc, DP_CFG_EVENT_PEER_DELETE, peer,
|
||||
vdev, 0);
|
||||
dp_init_info("%pK: peer %pK (" QDF_MAC_ADDR_FMT ") pending-refs %d",
|
||||
soc, peer, QDF_MAC_ADDR_REF(peer->mac_addr.raw),
|
||||
qdf_atomic_read(&peer->ref_cnt));
|
||||
@@ -15544,6 +15610,7 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
|
||||
/* Reset wbm sg list and flags */
|
||||
dp_rx_wbm_sg_list_reset(soc);
|
||||
|
||||
dp_soc_cfg_history_attach(soc);
|
||||
dp_soc_tx_hw_desc_history_attach(soc);
|
||||
dp_soc_rx_history_attach(soc);
|
||||
dp_soc_mon_status_ring_history_attach(soc);
|
||||
|
@@ -2947,6 +2947,11 @@ dp_rx_mlo_peer_map_handler(struct dp_soc *soc, uint16_t peer_id,
|
||||
QDF_STATUS err = QDF_STATUS_SUCCESS;
|
||||
struct dp_soc *primary_soc;
|
||||
|
||||
dp_cfg_event_record_peer_map_unmap_evt(soc, DP_CFG_EVENT_MLO_PEER_MAP,
|
||||
NULL, peer_mac_addr,
|
||||
1, peer_id, ml_peer_id, 0,
|
||||
vdev_id);
|
||||
|
||||
dp_info("mlo_peer_map_event (soc:%pK): peer_id %d ml_peer_id %d, peer_mac "QDF_MAC_ADDR_FMT,
|
||||
soc, peer_id, ml_peer_id,
|
||||
QDF_MAC_ADDR_REF(peer_mac_addr));
|
||||
@@ -2963,7 +2968,6 @@ dp_rx_mlo_peer_map_handler(struct dp_soc *soc, uint16_t peer_id,
|
||||
|
||||
peer = dp_peer_find_add_id(soc, peer_mac_addr, ml_peer_id,
|
||||
hw_peer_id, vdev_id, CDP_MLD_PEER_TYPE);
|
||||
|
||||
if (peer) {
|
||||
if (wlan_op_mode_sta == peer->vdev->opmode &&
|
||||
qdf_mem_cmp(peer->mac_addr.raw,
|
||||
@@ -3100,6 +3104,9 @@ dp_rx_peer_map_handler(struct dp_soc *soc, uint16_t peer_id,
|
||||
enum cdp_txrx_ast_entry_type type = CDP_TXRX_AST_TYPE_STATIC;
|
||||
QDF_STATUS err = QDF_STATUS_SUCCESS;
|
||||
|
||||
dp_cfg_event_record_peer_map_unmap_evt(soc, DP_CFG_EVENT_PEER_MAP,
|
||||
NULL, peer_mac_addr, 1, peer_id,
|
||||
0, 0, vdev_id);
|
||||
dp_info("peer_map_event (soc:%pK): peer_id %d, hw_peer_id %d, peer_mac "QDF_MAC_ADDR_FMT", vdev_id %d",
|
||||
soc, peer_id, hw_peer_id,
|
||||
QDF_MAC_ADDR_REF(peer_mac_addr), vdev_id);
|
||||
@@ -3284,6 +3291,9 @@ dp_rx_peer_unmap_handler(struct dp_soc *soc, uint16_t peer_id,
|
||||
|
||||
dp_peer_clean_wds_entries(soc, peer, free_wds_count);
|
||||
|
||||
dp_cfg_event_record_peer_map_unmap_evt(soc, DP_CFG_EVENT_PEER_UNMAP,
|
||||
peer, mac_addr, 0, peer_id,
|
||||
0, 0, vdev_id);
|
||||
dp_info("peer_unmap_event (soc:%pK) peer_id %d peer %pK",
|
||||
soc, peer_id, peer);
|
||||
|
||||
@@ -3341,6 +3351,9 @@ void dp_rx_mlo_peer_unmap_handler(struct dp_soc *soc, uint16_t peer_id)
|
||||
uint8_t vdev_id = DP_VDEV_ALL;
|
||||
uint8_t is_wds = 0;
|
||||
|
||||
dp_cfg_event_record_peer_map_unmap_evt(soc, DP_CFG_EVENT_MLO_PEER_UNMAP,
|
||||
NULL, mac_addr, 0, peer_id,
|
||||
0, 0, vdev_id);
|
||||
dp_info("MLO peer_unmap_event (soc:%pK) peer_id %d",
|
||||
soc, peer_id);
|
||||
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include <qdf_types.h>
|
||||
#include <qdf_lock.h>
|
||||
#include "dp_types.h"
|
||||
#include "dp_internal.h"
|
||||
|
||||
#ifdef DUMP_REO_QUEUE_INFO_IN_DDR
|
||||
#include "hal_reo.h"
|
||||
@@ -1312,6 +1313,7 @@ void dp_mld_peer_add_link_peer(struct dp_peer *mld_peer,
|
||||
int i;
|
||||
struct dp_peer_link_info *link_peer_info;
|
||||
bool action_done = false;
|
||||
struct dp_soc *soc = mld_peer->vdev->pdev->soc;
|
||||
|
||||
qdf_spin_lock_bh(&mld_peer->link_peers_info_lock);
|
||||
for (i = 0; i < DP_MAX_MLO_LINKS; i++) {
|
||||
@@ -1342,6 +1344,10 @@ void dp_mld_peer_add_link_peer(struct dp_peer *mld_peer,
|
||||
mld_peer, QDF_MAC_ADDR_REF(mld_peer->mac_addr.raw),
|
||||
link_peer, QDF_MAC_ADDR_REF(link_peer->mac_addr.raw),
|
||||
i, mld_peer->num_links);
|
||||
|
||||
dp_cfg_event_record_mlo_link_delink_evt(soc, DP_CFG_EVENT_MLO_ADD_LINK,
|
||||
mld_peer, link_peer, i,
|
||||
action_done ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1359,6 +1365,7 @@ uint8_t dp_mld_peer_del_link_peer(struct dp_peer *mld_peer,
|
||||
struct dp_peer_link_info *link_peer_info;
|
||||
uint8_t num_links;
|
||||
bool action_done = false;
|
||||
struct dp_soc *soc = mld_peer->vdev->pdev->soc;
|
||||
|
||||
qdf_spin_lock_bh(&mld_peer->link_peers_info_lock);
|
||||
for (i = 0; i < DP_MAX_MLO_LINKS; i++) {
|
||||
@@ -1387,6 +1394,9 @@ uint8_t dp_mld_peer_del_link_peer(struct dp_peer *mld_peer,
|
||||
link_peer, QDF_MAC_ADDR_REF(link_peer->mac_addr.raw),
|
||||
i, mld_peer->num_links);
|
||||
|
||||
dp_cfg_event_record_mlo_link_delink_evt(soc, DP_CFG_EVENT_MLO_DEL_LINK,
|
||||
mld_peer, link_peer, i,
|
||||
action_done ? 1 : 0);
|
||||
|
||||
return num_links;
|
||||
}
|
||||
|
@@ -446,6 +446,7 @@ struct dp_rx_nbuf_frag_info {
|
||||
* @DP_MON_SOC_TYPE: Datapath monitor soc context
|
||||
* @DP_MON_PDEV_TYPE: Datapath monitor pdev context
|
||||
* @DP_MON_STATUS_BUF_HIST_TYPE: DP monitor status buffer history
|
||||
* @DP_CFG_EVENT_HIST_TYPE: DP config events history
|
||||
*/
|
||||
enum dp_ctxt_type {
|
||||
DP_PDEV_TYPE,
|
||||
@@ -460,6 +461,7 @@ enum dp_ctxt_type {
|
||||
DP_MON_SOC_TYPE,
|
||||
DP_MON_PDEV_TYPE,
|
||||
DP_MON_STATUS_BUF_HIST_TYPE,
|
||||
DP_CFG_EVENT_HIST_TYPE,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1570,6 +1572,206 @@ struct dp_rx_refill_history {
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* enum dp_cfg_event_type - Datapath config events type
|
||||
* @DP_CFG_EVENT_VDEV_ATTACH: vdev attach
|
||||
* @DP_CFG_EVENT_VDEV_DETACH: vdev detach
|
||||
* @DP_CFG_EVENT_VDEV_UNREF_DEL: vdev memory free after last ref is released
|
||||
* @DP_CFG_EVENT_PEER_CREATE: peer create
|
||||
* @DP_CFG_EVENT_PEER_DELETE: peer delete
|
||||
* @DP_CFG_EVENT_PEER_UNREF_DEL: peer memory free after last ref is released
|
||||
* @DP_CFG_EVENT_PEER_SETUP: peer setup
|
||||
* @DP_CFG_EVENT_MLO_ADD_LINK: add link peer to mld peer
|
||||
* @DP_CFG_EVENT_MLO_DEL_LINK: delete link peer from mld peer
|
||||
* @DP_CFG_EVENT_MLO_SETUP: MLO peer setup
|
||||
* @DP_CFG_EVENT_MLO_SETUP_VDEV_UPDATE: MLD peer vdev update
|
||||
* @DP_CFG_EVENT_PEER_MAP: peer map
|
||||
* @DP_CFG_EVENT_PEER_UNMAP: peer unmap
|
||||
* @DP_CFG_EVENT_MLO_PEER_MAP: MLD peer map
|
||||
* @DP_CFG_EVENT_MLO_PEER_UNMAP: MLD peer unmap
|
||||
*/
|
||||
enum dp_cfg_event_type {
|
||||
DP_CFG_EVENT_VDEV_ATTACH,
|
||||
DP_CFG_EVENT_VDEV_DETACH,
|
||||
DP_CFG_EVENT_VDEV_UNREF_DEL,
|
||||
DP_CFG_EVENT_PEER_CREATE,
|
||||
DP_CFG_EVENT_PEER_DELETE,
|
||||
DP_CFG_EVENT_PEER_UNREF_DEL,
|
||||
DP_CFG_EVENT_PEER_SETUP,
|
||||
DP_CFG_EVENT_MLO_ADD_LINK,
|
||||
DP_CFG_EVENT_MLO_DEL_LINK,
|
||||
DP_CFG_EVENT_MLO_SETUP,
|
||||
DP_CFG_EVENT_MLO_SETUP_VDEV_UPDATE,
|
||||
DP_CFG_EVENT_PEER_MAP,
|
||||
DP_CFG_EVENT_PEER_UNMAP,
|
||||
DP_CFG_EVENT_MLO_PEER_MAP,
|
||||
DP_CFG_EVENT_MLO_PEER_UNMAP,
|
||||
};
|
||||
|
||||
#ifdef WLAN_FEATURE_DP_CFG_EVENT_HISTORY
|
||||
/* Size must be in 2 power, for bitwise index rotation */
|
||||
#define DP_CFG_EVT_HISTORY_SIZE 0x800
|
||||
#define DP_CFG_EVT_HIST_PER_SLOT_MAX 256
|
||||
#define DP_CFG_EVT_HIST_MAX_SLOTS 8
|
||||
#define DP_CFG_EVT_HIST_SLOT_SHIFT 8
|
||||
|
||||
/**
|
||||
* struct dp_vdev_attach_detach_desc - vdev ops descriptor
|
||||
* @vdev: DP vdev handle
|
||||
* @mac_addr: vdev mac address
|
||||
* @vdev_id: vdev id
|
||||
* @ref_count: vdev ref count
|
||||
*/
|
||||
struct dp_vdev_attach_detach_desc {
|
||||
struct dp_vdev *vdev;
|
||||
union dp_align_mac_addr mac_addr;
|
||||
uint8_t vdev_id;
|
||||
int32_t ref_count;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dp_peer_cmn_ops_desc - peer events descriptor
|
||||
* @vdev_id: vdev_id of the vdev on which peer exists
|
||||
* @is_reuse: indicates if its a peer reuse case, during peer create
|
||||
* @peer: DP peer handle
|
||||
* @vdev: DP vdev handle on which peer exists
|
||||
* @mac_addr: peer mac address
|
||||
* @vdev_mac_addr: vdev mac address
|
||||
* @vdev_ref_count: vdev ref count
|
||||
* @peer_ref_count: peer ref count
|
||||
*/
|
||||
struct dp_peer_cmn_ops_desc {
|
||||
uint8_t vdev_id : 5,
|
||||
is_reuse : 1;
|
||||
struct dp_peer *peer;
|
||||
struct dp_vdev *vdev;
|
||||
union dp_align_mac_addr mac_addr;
|
||||
union dp_align_mac_addr vdev_mac_addr;
|
||||
int32_t vdev_ref_count;
|
||||
int32_t peer_ref_count;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dp_mlo_add_del_link_desc - MLO add/del link event descriptor
|
||||
* @idx: index at which link peer got added in MLD peer's list
|
||||
* @num_links: num links added in the MLD peer's list
|
||||
* @action_result: add/del was success or not
|
||||
* @link_peer: link peer handle
|
||||
* @mld_peer: MLD peer handle
|
||||
* @link_mac_addr: link peer mac address
|
||||
* @mld_mac_addr: MLD peer mac address
|
||||
*/
|
||||
struct dp_mlo_add_del_link_desc {
|
||||
uint8_t idx : 3,
|
||||
num_links : 3,
|
||||
action_result : 1,
|
||||
reserved : 1;
|
||||
struct dp_peer *link_peer;
|
||||
struct dp_peer *mld_peer;
|
||||
union dp_align_mac_addr link_mac_addr;
|
||||
union dp_align_mac_addr mld_mac_addr;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dp_mlo_setup_vdev_update_desc - MLD peer vdev update event desc
|
||||
* @mld_peer: MLD peer handle
|
||||
* @prev_vdev: previous vdev handle
|
||||
* @new_vdev: new vdev handle
|
||||
*/
|
||||
struct dp_mlo_setup_vdev_update_desc {
|
||||
struct dp_peer *mld_peer;
|
||||
struct dp_vdev *prev_vdev;
|
||||
struct dp_vdev *new_vdev;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dp_rx_peer_map_unmap_desc - peer map/unmap event descriptor
|
||||
* @peer_id: peer id
|
||||
* @ml_peer_id: ML peer id, if its an MLD peer
|
||||
* @hw_peer_id: hw peer id
|
||||
* @vdev_id: vdev id of the peer
|
||||
* @is_ml_peer: is this MLD peer
|
||||
* @mac_addr: mac address of the peer
|
||||
* @peer: peer handle
|
||||
*/
|
||||
struct dp_rx_peer_map_unmap_desc {
|
||||
uint16_t peer_id;
|
||||
uint16_t ml_peer_id;
|
||||
uint16_t hw_peer_id;
|
||||
uint8_t vdev_id;
|
||||
uint8_t is_ml_peer;
|
||||
union dp_align_mac_addr mac_addr;
|
||||
struct dp_peer *peer;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dp_peer_setup_desc - peer setup event descriptor
|
||||
* @peer: DP peer handle
|
||||
* @vdev: vdev handle on which peer exists
|
||||
* @vdev_ref_count: vdev ref count
|
||||
* @mac_addr: peer mac address
|
||||
* @mld_mac_addr: MLD mac address
|
||||
* @is_first_link: is the current link the first link created
|
||||
* @is_primary_link: is the current link primary link
|
||||
* @vdev_id: vdev id of the vdev on which the current link peer exists
|
||||
*/
|
||||
struct dp_peer_setup_desc {
|
||||
struct dp_peer *peer;
|
||||
struct dp_vdev *vdev;
|
||||
int32_t vdev_ref_count;
|
||||
union dp_align_mac_addr mac_addr;
|
||||
union dp_align_mac_addr mld_mac_addr;
|
||||
uint8_t is_first_link : 1,
|
||||
is_primary_link : 1,
|
||||
vdev_id : 5,
|
||||
reserved : 1;
|
||||
};
|
||||
|
||||
/**
|
||||
* union dp_cfg_event_desc - DP config event descriptor
|
||||
* @vdev_evt: vdev events desc
|
||||
* @peer_cmn_evt: common peer events desc
|
||||
* @peer_setup_evt: peer setup event desc
|
||||
* @mlo_link_delink_evt: MLO link/delink event desc
|
||||
* @mlo_setup_vdev_update: MLD peer vdev update event desc
|
||||
* @peer_map_unmap_evt: peer map/unmap event desc
|
||||
*/
|
||||
union dp_cfg_event_desc {
|
||||
struct dp_vdev_attach_detach_desc vdev_evt;
|
||||
struct dp_peer_cmn_ops_desc peer_cmn_evt;
|
||||
struct dp_peer_setup_desc peer_setup_evt;
|
||||
struct dp_mlo_add_del_link_desc mlo_link_delink_evt;
|
||||
struct dp_mlo_setup_vdev_update_desc mlo_setup_vdev_update;
|
||||
struct dp_rx_peer_map_unmap_desc peer_map_unmap_evt;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dp_cfg_event - DP config event descriptor
|
||||
* @timestamp: timestamp at which event was recorded
|
||||
* @type: event type
|
||||
* @event_desc: event descriptor
|
||||
*/
|
||||
struct dp_cfg_event {
|
||||
uint64_t timestamp;
|
||||
enum dp_cfg_event_type type;
|
||||
union dp_cfg_event_desc event_desc;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dp_cfg_event_history - DP config event history
|
||||
* @index: current index
|
||||
* @num_entries_per_slot: number of entries per slot
|
||||
* @allocated: Is the history allocated or not
|
||||
* @entry: event history descriptors
|
||||
*/
|
||||
struct dp_cfg_event_history {
|
||||
qdf_atomic_t index;
|
||||
uint16_t num_entries_per_slot;
|
||||
uint16_t allocated;
|
||||
struct dp_cfg_event *entry[DP_CFG_EVT_HIST_MAX_SLOTS];
|
||||
};
|
||||
#endif
|
||||
|
||||
enum dp_tx_event_type {
|
||||
DP_TX_DESC_INVAL_EVT = 0,
|
||||
DP_TX_DESC_MAP,
|
||||
@@ -2405,6 +2607,10 @@ struct dp_soc {
|
||||
struct dp_tx_comp_history tx_comp_history;
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_DP_CFG_EVENT_HISTORY
|
||||
struct dp_cfg_event_history cfg_event_history;
|
||||
#endif
|
||||
|
||||
qdf_spinlock_t ast_lock;
|
||||
/*Timer for AST entry ageout maintenance */
|
||||
qdf_timer_t ast_aging_timer;
|
||||
|
Reference in New Issue
Block a user