qcacld-3.0: Featurize packet log

Featurize packet log.

Change-Id: Id747d142d72d02759b20bcf3091fd769261b8f67
CRs-Fixed: 2245422
This commit is contained in:
Nirav Shah 2018-05-17 16:56:41 +05:30 committed by nshrivas
parent 73713f7e80
commit bb8e47c200
20 changed files with 148 additions and 89 deletions

5
Kbuild
View File

@ -866,12 +866,15 @@ TXRX_OBJS := $(TXRX_DIR)/ol_txrx.o \
$(TXRX_DIR)/ol_rx_pn.o \
$(TXRX_DIR)/ol_tx_queue.o \
$(TXRX_DIR)/ol_txrx_peer_find.o \
$(TXRX_DIR)/ol_txrx_event.o \
$(TXRX_DIR)/ol_txrx_encap.o \
$(TXRX_DIR)/ol_tx_send.o \
$(TXRX_DIR)/ol_tx_sched.o \
$(TXRX_DIR)/ol_tx_classify.o
ifeq ($(CONFIG_WDI_EVENT_ENABLE), y)
TXRX_OBJS += $(TXRX_DIR)/ol_txrx_event.o
endif
ifeq ($(CONFIG_WLAN_TX_FLOW_CONTROL_V2), y)
TXRX_OBJS += $(TXRX_DIR)/ol_txrx_flow_control.o
endif

View File

@ -390,7 +390,11 @@ CONFIG_ATH_SUPPORT_FLOWMAC_MODULE := n
CONFIG_ATH_SUPPORT_SPECTRAL := n
#Enable WDI Event support
ifeq ($(CONFIG_REMOVE_PKT_LOG), y)
CONFIG_WDI_EVENT_ENABLE := n
else
CONFIG_WDI_EVENT_ENABLE := y
endif
#Endianness selection
CONFIG_LITTLE_ENDIAN := y

View File

@ -87,7 +87,6 @@ CONFIG_MPC_UT_FRAMEWORK := y
CONFIG_FEATURE_EPPING := y
CONFIG_WLAN_NAPI_DEBUG := n
CONFIG_REMOVE_PKT_LOG := n
CONFIG_WDI_EVENT_ENABLE := y
CONFIG_FEATURE_STATS_EXT := y
CONFIG_FEATURE_HTC_CREDIT_HISTORY := y
CONFIG_TRACE_RECORD_FEATURE := y
@ -105,6 +104,12 @@ CONFIG_WLAN_LOG_WARN := y
CONFIG_WLAN_LOG_INFO := y
CONFIG_WLAN_LOG_DEBUG := y
ifeq ($(CONFIG_REMOVE_PKT_LOG), y)
CONFIG_WDI_EVENT_ENABLE := n
else
CONFIG_WDI_EVENT_ENABLE := y
endif
# Features gets enabled on slub debug
CONFIG_WLAN_OBJMGR_DEBUG:= y
CONFIG_OL_RX_INDICATION_RECORD := y

View File

@ -439,7 +439,15 @@ QDF_STATUS cds_get_vdev_types(enum QDF_OPMODE mode, uint32_t *type,
void cds_flush_work(void *work);
void cds_flush_delayed_work(void *dwork);
#ifdef REMOVE_PKT_LOG
static inline
bool cds_is_packet_log_enabled(void)
{
return false;
}
#else
bool cds_is_packet_log_enabled(void);
#endif
uint64_t cds_get_monotonic_boottime(void);

View File

@ -1668,6 +1668,7 @@ void cds_flush_delayed_work(void *dwork)
cancel_delayed_work_sync(dwork);
}
#ifndef REMOVE_PKT_LOG
/**
* cds_is_packet_log_enabled() - check if packet log is enabled
*
@ -1684,6 +1685,7 @@ bool cds_is_packet_log_enabled(void)
}
return hdd_ctx->config->enablePacketLog;
}
#endif
static int cds_force_assert_target_via_pld(qdf_device_t qdf)
{

View File

@ -1770,7 +1770,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
/* calling callback function for packet logging */
if (pdev->rx_pkt_dump_cb) {
if (qdf_unlikely(RX_DESC_MIC_ERR_IS_SET &&
!RX_DESC_DISCARD_IS_SET))
!RX_DESC_DISCARD_IS_SET))
status = RX_PKT_FATE_FW_DROP_INVALID;
pdev->rx_pkt_dump_cb(msdu, peer_id, status);
}
@ -2904,6 +2904,7 @@ int htt_rx_ipa_uc_detach(struct htt_pdev_t *pdev)
}
#endif /* IPA_OFFLOAD */
#ifndef REMOVE_PKT_LOG
/**
* htt_register_rx_pkt_dump_callback() - registers callback to
* get rx pkt status and call callback to do rx packet dump
@ -2954,4 +2955,4 @@ void htt_deregister_rx_pkt_dump_callback(struct htt_pdev_t *pdev)
}
pdev->rx_pkt_dump_cb = NULL;
}
#endif

View File

@ -388,11 +388,30 @@ static inline void htt_clear_bundle_stats(struct htt_pdev_t *pdev)
#endif
void htt_mark_first_wakeup_packet(htt_pdev_handle pdev, uint8_t value);
typedef void (*tp_rx_pkt_dump_cb)(qdf_nbuf_t msdu, uint8_t peer_id,
uint8_t status);
#ifdef REMOVE_PKT_LOG
static inline
void htt_register_rx_pkt_dump_callback(struct htt_pdev_t *pdev,
tp_rx_pkt_dump_cb ol_rx_pkt_dump_call);
tp_rx_pkt_dump_cb ol_rx_pkt_dump_call)
{
}
static inline
void htt_deregister_rx_pkt_dump_callback(struct htt_pdev_t *pdev)
{
}
static inline
void ol_rx_pkt_dump_call(qdf_nbuf_t msdu, uint8_t peer_id, uint8_t status)
{
}
#else
void htt_register_rx_pkt_dump_callback(struct htt_pdev_t *pdev,
tp_rx_pkt_dump_cb ol_rx_pkt_dump_call);
void htt_deregister_rx_pkt_dump_callback(struct htt_pdev_t *pdev);
void ol_rx_pkt_dump_call(qdf_nbuf_t msdu, uint8_t peer_id, uint8_t status);
#endif
#endif /* _OL_HTT_API__H_ */

View File

@ -120,6 +120,7 @@ void ol_rx_ind_record_event(uint32_t value, enum ol_rx_ind_record_type type)
void ol_rx_data_process(struct ol_txrx_peer_t *peer,
qdf_nbuf_t rx_buf_list);
#ifdef WDI_EVENT_ENABLE
/**
* ol_rx_send_pktlog_event() - send rx packetlog event
* @pdev: pdev handle
@ -176,6 +177,7 @@ void ol_rx_send_pktlog_event(struct ol_txrx_pdev_t *pdev,
&data);
}
#endif
#endif /* WDI_EVENT_ENABLE */
#ifdef HTT_RX_RESTORE
@ -257,6 +259,7 @@ void ol_rx_update_histogram_stats(uint32_t msdu_count, uint8_t frag_ind,
}
#ifdef WDI_EVENT_ENABLE
static void ol_rx_process_inv_peer(ol_txrx_pdev_handle pdev,
void *rx_mpdu_desc, qdf_nbuf_t msdu)
{
@ -293,11 +296,16 @@ static void ol_rx_process_inv_peer(ol_txrx_pdev_handle pdev,
msg.wh = wh;
msg.msdu = msdu;
msg.vdev_id = vdev->vdev_id;
#ifdef WDI_EVENT_ENABLE
wdi_event_handler(WDI_EVENT_RX_PEER_INVALID, (struct cdp_pdev *)pdev,
&msg);
#endif
}
#else
static inline
void ol_rx_process_inv_peer(ol_txrx_pdev_handle pdev,
void *rx_mpdu_desc, qdf_nbuf_t msdu)
{
}
#endif
#ifdef QCA_SUPPORT_PEER_DATA_RX_RSSI
static inline int16_t
@ -624,9 +632,8 @@ ol_rx_indication_handler(ol_txrx_pdev_handle pdev,
}
/* Pktlog */
#ifdef WDI_EVENT_ENABLE
ol_rx_send_pktlog_event(pdev, peer, head_msdu, 1);
#endif
ol_rx_send_pktlog_event(pdev, peer,
head_msdu, 1);
if (msdu_chaining) {
/*
@ -702,19 +709,20 @@ ol_rx_indication_handler(ol_txrx_pdev_handle pdev,
key_id);
}
}
#ifdef WDI_EVENT_ENABLE
if (status != htt_rx_status_ctrl_mgmt_null) {
/* Pktlog */
ol_rx_send_pktlog_event(pdev,
peer, msdu, 1);
}
#endif
if (status == htt_rx_status_err_inv_peer) {
/* once per mpdu */
ol_rx_process_inv_peer(pdev,
rx_mpdu_desc,
msdu);
}
while (1) {
/* Free the nbuf */
qdf_nbuf_t next;
@ -970,24 +978,6 @@ ol_rx_offload_deliver_ind_handler(ol_txrx_pdev_handle pdev,
htt_rx_msdu_buff_replenish(htt_pdev);
}
#ifdef WDI_EVENT_ENABLE
static inline
void ol_rx_mic_error_send_pktlog_event(struct ol_txrx_pdev_t *pdev,
struct ol_txrx_peer_t *peer, qdf_nbuf_t msdu, uint8_t pktlog_bit)
{
ol_rx_send_pktlog_event(pdev, peer, msdu, pktlog_bit);
}
#else
static inline
void ol_rx_mic_error_send_pktlog_event(struct ol_txrx_pdev_t *pdev,
struct ol_txrx_peer_t *peer, qdf_nbuf_t msdu, uint8_t pktlog_bit)
{
}
#endif
void
ol_rx_mic_error_handler(
ol_txrx_pdev_handle pdev,
@ -1023,7 +1013,7 @@ ol_rx_mic_error_handler(
}
}
/* Pktlog */
ol_rx_mic_error_send_pktlog_event(pdev, peer, msdu, 1);
ol_rx_send_pktlog_event(pdev, peer, msdu, 1);
}
}
@ -1477,10 +1467,9 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
uint8_t *rx_ind_data;
uint32_t *msg_word;
uint32_t msdu_count;
#ifdef WDI_EVENT_ENABLE
uint8_t pktlog_bit;
#endif
uint32_t filled = 0;
if (tid >= OL_TXRX_NUM_EXT_TIDS) {
ol_txrx_err("%s: invalid tid, %u\n", __FUNCTION__, tid);
WARN_ON(1);
@ -1504,10 +1493,7 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
__func__, __LINE__, rx_ind_msg, peer_id, tid, is_offload);
#endif
#ifdef WDI_EVENT_ENABLE
pktlog_bit = (htt_rx_amsdu_rx_in_order_get_pktlog(rx_ind_msg) == 0x01);
#endif
rx_ind_data = qdf_nbuf_data(rx_ind_msg);
msg_word = (uint32_t *)rx_ind_data;
/* Get the total number of MSDUs */
@ -1547,9 +1533,7 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
qdf_nbuf_set_next(tail_msdu, NULL);
/* Pktlog */
#ifdef WDI_EVENT_ENABLE
ol_rx_send_pktlog_event(pdev, peer, head_msdu, pktlog_bit);
#endif
/*
* if this is an offload indication, peer id is carried in the
@ -1575,6 +1559,7 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
peer->rx_opt_proc(vdev, peer, tid, head_msdu);
}
#ifndef REMOVE_PKT_LOG
/**
* ol_rx_pkt_dump_call() - updates status and
* calls packetdump callback to log rx packet
@ -1616,6 +1601,7 @@ void ol_rx_pkt_dump_call(
if (packetdump_cb)
packetdump_cb(msdu, status, peer->vdev->vdev_id, RX_DATA_PKT);
}
#endif
/* the msdu_list passed here must be NULL terminated */
void

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2011, 2014-2018 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
@ -40,8 +40,18 @@ void ol_rx_peer_init(struct ol_txrx_pdev_t *pdev, struct ol_txrx_peer_t *peer);
void
ol_rx_peer_cleanup(struct ol_txrx_vdev_t *vdev, struct ol_txrx_peer_t *peer);
#ifdef WDI_EVENT_ENABLE
void ol_rx_send_pktlog_event(struct ol_txrx_pdev_t *pdev,
struct ol_txrx_peer_t *peer, qdf_nbuf_t msdu, uint8_t pktlog_bit);
struct ol_txrx_peer_t *peer, qdf_nbuf_t msdu,
uint8_t pktlog_bit);
#else
static inline
void ol_rx_send_pktlog_event(struct ol_txrx_pdev_t *pdev,
struct ol_txrx_peer_t *peer, qdf_nbuf_t msdu,
uint8_t pktlog_bit)
{
}
#endif
void

View File

@ -289,23 +289,6 @@ void ol_rx_defrag_push_rx_desc(qdf_nbuf_t nbuf,
}
#endif /* CONFIG_HL_SUPPORT */
#ifdef WDI_EVENT_ENABLE
static inline
void ol_rx_frag_send_pktlog_event(struct ol_txrx_pdev_t *pdev,
struct ol_txrx_peer_t *peer, qdf_nbuf_t msdu, uint8_t pktlog_bit)
{
ol_rx_send_pktlog_event(pdev, peer, msdu, pktlog_bit);
}
#else
static inline
void ol_rx_frag_send_pktlog_event(struct ol_txrx_pdev_t *pdev,
struct ol_txrx_peer_t *peer, qdf_nbuf_t msdu, uint8_t pktlog_bit)
{
}
#endif
/*
* Process incoming fragments
*/
@ -366,7 +349,7 @@ ol_rx_frag_indication_handler(ol_txrx_pdev_handle pdev,
seq_num = htt_rx_mpdu_desc_seq_num(htt_pdev, rx_mpdu_desc);
OL_RX_ERR_STATISTICS_1(pdev, peer->vdev, peer, rx_mpdu_desc,
OL_RX_ERR_NONE_FRAG);
ol_rx_frag_send_pktlog_event(pdev, peer, head_msdu, pktlog_bit);
ol_rx_send_pktlog_event(pdev, peer, head_msdu, pktlog_bit);
ol_rx_reorder_store_frag(pdev, peer, tid, seq_num, head_msdu);
} else {
/* invalid frame - discard it */
@ -375,7 +358,7 @@ ol_rx_frag_indication_handler(ol_txrx_pdev_handle pdev,
else
htt_rx_mpdu_desc_list_next(htt_pdev, rx_frag_ind_msg);
ol_rx_frag_send_pktlog_event(pdev, peer, head_msdu, pktlog_bit);
ol_rx_send_pktlog_event(pdev, peer, head_msdu, pktlog_bit);
htt_rx_desc_frame_free(htt_pdev, head_msdu);
}
/* request HTT to provide new rx MSDU buffers for the target to fill. */

View File

@ -5872,6 +5872,11 @@ static void ol_txrx_soc_detach(void *soc)
*
* Return: noe
*/
#ifdef REMOVE_PKT_LOG
static void ol_txrx_pkt_log_con_service(struct cdp_pdev *ppdev, void *scn)
{
}
#else
static void ol_txrx_pkt_log_con_service(struct cdp_pdev *ppdev, void *scn)
{
struct ol_txrx_pdev_t *pdev = (struct ol_txrx_pdev_t *)ppdev;
@ -5879,6 +5884,7 @@ static void ol_txrx_pkt_log_con_service(struct cdp_pdev *ppdev, void *scn)
htt_pkt_log_init((struct cdp_pdev *)pdev, scn);
pktlog_htc_attach();
}
#endif
/* OL wrapper functions for CDP abstraction */
/**

View File

@ -86,6 +86,7 @@ ol_txrx_hl_tdls_flag_reset(struct cdp_vdev *vdev, bool flag)
#ifdef WDI_EVENT_ENABLE
void *ol_get_pldev(struct cdp_pdev *txrx_pdev);
#else
static inline
void *ol_get_pldev(struct cdp_pdev *txrx_pdev)
{
return NULL;

View File

@ -18,8 +18,6 @@
#include "ol_txrx_types.h"
#ifdef WDI_EVENT_ENABLE
static inline wdi_event_subscribe *wdi_event_next_sub(wdi_event_subscribe *
wdi_sub)
{
@ -233,5 +231,3 @@ A_STATUS wdi_event_detach(struct ol_txrx_pdev_t *txrx_pdev)
txrx_pdev->wdi_event_list = NULL;
return A_OK;
}
#endif /* WDI_EVENT_ENABLE */

View File

@ -23,6 +23,7 @@
#include <cdp_txrx_handle.h>
struct ol_txrx_pdev_t;
#ifdef WDI_EVENT_ENABLE
/**
* @brief Subscribe to a specified WDI event.
* @details
@ -59,7 +60,6 @@ A_STATUS wdi_event_unsub(struct cdp_pdev *ppdev,
void *event_cb_sub,
uint32_t event);
#ifdef WDI_EVENT_ENABLE
void wdi_event_handler(enum WDI_EVENT event,
struct cdp_pdev *txrx_pdev, void *data);
@ -72,14 +72,29 @@ static inline void wdi_event_handler(enum WDI_EVENT event,
struct cdp_pdev *txrx_pdev, void *data)
{
}
static inline A_STATUS wdi_event_attach(struct ol_txrx_pdev_t *txrx_pdev)
{
return A_OK;
}
static inline A_STATUS wdi_event_detach(struct ol_txrx_pdev_t *txrx_pdev)
{
return A_OK;
}
static inline A_STATUS wdi_event_sub(struct cdp_pdev *ppdev, void *event_cb_sub,
uint32_t event)
{
return A_OK;
}
static inline A_STATUS wdi_event_unsub(struct cdp_pdev *ppdev,
void *event_cb_sub,
uint32_t event)
{
return A_OK;
}
#endif /* WDI_EVENT_ENABLE */
#endif /* _WDI_EVENT_API_H_ */

View File

@ -5570,6 +5570,7 @@ enum hdd_link_speed_rpt_type {
#define CFG_ENABLE_CCK_TX_FIR_OVERRIDE_MAX (1)
#define CFG_ENABLE_CCK_TX_FIR_OVERRIDE_DEFAULT (0)
#ifndef REMOVE_PKT_LOG
#define CFG_ENABLE_PACKET_LOG "gEnablePacketLog"
#define CFG_ENABLE_PACKET_LOG_MIN (0)
#define CFG_ENABLE_PACKET_LOG_MAX (1)
@ -5578,7 +5579,7 @@ enum hdd_link_speed_rpt_type {
#else
#define CFG_ENABLE_PACKET_LOG_DEFAULT (0)
#endif
#endif
/* gFwDebugLogType takes values from enum dbglog_process_t,
@ -14612,7 +14613,10 @@ struct hdd_config {
bool debugP2pRemainOnChannel;
#ifndef REMOVE_PKT_LOG
bool enablePacketLog;
#endif
#ifdef MSM_PLATFORM
uint32_t busBandwidthHighThreshold;
uint32_t busBandwidthMediumThreshold;

View File

@ -2940,12 +2940,14 @@ struct reg_table_entry g_registry_table[] = {
CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_MIN,
CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_MAX),
#ifndef REMOVE_PKT_LOG
REG_VARIABLE(CFG_ENABLE_PACKET_LOG, WLAN_PARAM_Integer,
struct hdd_config, enablePacketLog,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
CFG_ENABLE_PACKET_LOG_DEFAULT,
CFG_ENABLE_PACKET_LOG_MIN,
CFG_ENABLE_PACKET_LOG_MAX),
#endif
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
REG_VARIABLE(CFG_ROAMING_OFFLOAD_NAME, WLAN_PARAM_Integer,

View File

@ -4435,6 +4435,7 @@ static iw_softap_set_max_tx_power(struct net_device *dev,
return ret;
}
#ifndef REMOVE_PKT_LOG
int
static __iw_softap_set_pktlog(struct net_device *dev,
struct iw_request_info *info,
@ -4473,7 +4474,15 @@ static iw_softap_set_pktlog(struct net_device *dev,
return ret;
}
#else
int
static iw_softap_set_pktlog(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
return -EINVAL;
}
#endif
int
static __iw_softap_set_tx_power(struct net_device *dev,

View File

@ -7271,7 +7271,6 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
return ret;
break;
}
case WE_MAC_PWR_DEBUG_CMD:
{
struct sir_mac_pwr_dbg_cmd mac_pwr_dbg_args;
@ -9078,10 +9077,12 @@ static const struct iw_priv_args we_private_args[] = {
0,
"setTxMaxPower5G"},
#ifndef REMOVE_PKT_LOG
{WE_SET_PKTLOG,
IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
0,
"pktlog"},
#endif
/* SAP has TxMax whereas STA has MaxTx, adding TxMax for STA
* as well to keep same syntax as in SAP. Now onwards, STA

View File

@ -47,6 +47,8 @@
#if !defined(REMOVE_PKT_LOG)
#include "pktlog_ac.h"
#else
#include "pktlog_ac_fmt.h"
#endif /* REMOVE_PKT_LOG */
#include "dbglog_host.h"

View File

@ -16,10 +16,11 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef REMOVE_PKT_LOG
#ifndef _PKTLOG_FMT_H_
#define _PKTLOG_FMT_H_
#ifndef REMOVE_PKT_LOG
#define CUR_PKTLOG_VER 10010 /* Packet log version */
#define PKTLOG_MAGIC_NUM 7735225
@ -65,26 +66,6 @@ struct ath_pktlog_hdr {
#endif
} __ATTRIB_PACK;
/**
* enum pkt_type - packet type
* @START_MONITOR: indicates parser to start packetdump parsing
* @STOP_MONITOR: indicates parser to stop packetdump parsing
* @TX_MGMT_PKT: TX management Packet
* @TX_DATA_PKT: TX data Packet
* @RX_MGMT_PKT: RX management Packet
* @RX_DATA_PKT: RX data Packet
*
* This enum has packet types
*/
enum pkt_type {
START_MONITOR = 1,
STOP_MONITOR,
TX_MGMT_PKT,
TX_DATA_PKT,
RX_MGMT_PKT,
RX_DATA_PKT,
};
#define ATH_PKTLOG_HDR_FLAGS_MASK 0xffff
#define ATH_PKTLOG_HDR_FLAGS_SHIFT 0
#define ATH_PKTLOG_HDR_FLAGS_OFFSET 0
@ -314,6 +295,28 @@ struct ath_pktlog_buf {
sizeof(struct ath_pktlog_hdr)) ? _rd_offset : 0; \
} while (0)
#endif /* REMOVE_PKT_LOG */
/**
* enum pkt_type - packet type
* @START_MONITOR: indicates parser to start packetdump parsing
* @STOP_MONITOR: indicates parser to stop packetdump parsing
* @TX_MGMT_PKT: TX management Packet
* @TX_DATA_PKT: TX data Packet
* @RX_MGMT_PKT: RX management Packet
* @RX_DATA_PKT: RX data Packet
*
* This enum has packet types
*/
enum pkt_type {
START_MONITOR = 1,
STOP_MONITOR,
TX_MGMT_PKT,
TX_DATA_PKT,
RX_MGMT_PKT,
RX_DATA_PKT,
};
/**
* enum tx_pkt_fate - tx packet fate
* @TX_PKT_FATE_ACKED: Sent over air and ACKed
@ -392,4 +395,3 @@ enum rx_pkt_fate {
};
#endif /* _PKTLOG_FMT_H_ */
#endif /* REMOVE_PKT_LOG */