qcacld-3.0: Add ini support for protocol data pkt diag logging

Add ini support to configure the protocol data packet types
for which diag log is sent to user-space.

Change-Id: I10c83aa4af7099feafa86e2b57dc5fd79d02114c
CRs-Fixed: 2595789
This commit is contained in:
Yeshwanth Sriram Guntuka 2019-12-23 11:20:35 +05:30 • committed by nshrivas
commit d0e884aedf
6 changed files with 56 additions and 6 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2020 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
@ -1207,9 +1207,41 @@
20, \
"1, 6, 2, 126", \
"dp trace configuration string")
/*
* <ini>
* dp_proto_event_bitmap - Control for which protocol packet diag event should
* be sent to user space.
* @Min: 0
* @Max: 0x17
* @Default: 0x6
*
* This ini is used to control for which protocol packet diag event should be
* sent to user space.
*
* QDF_NBUF_PKT_TRAC_TYPE_DNS 0x01
* QDF_NBUF_PKT_TRAC_TYPE_EAPOL 0x02
* QDF_NBUF_PKT_TRAC_TYPE_DHCP 0x04
* QDF_NBUF_PKT_TRAC_TYPE_ARP 0x10
*
* Related: None
*
* Supported Feature: STA, SAP
*
* Usage: Internal
*
* <ini>
*/
#define CFG_DP_PROTO_EVENT_BITMAP \
CFG_INI_UINT("dp_proto_event_bitmap", \
0, 0x17, 0x6, \
CFG_VALUE_OR_DEFAULT, \
"Control for which protocol type diag log should be sent")
#define CFG_DP_CONFIG_DP_TRACE_ALL \
CFG(CFG_DP_ENABLE_DP_TRACE) \
CFG(CFG_DP_DP_TRACE_CONFIG)
CFG(CFG_DP_DP_TRACE_CONFIG) \
CFG(CFG_DP_PROTO_EVENT_BITMAP)
#else
#define CFG_DP_CONFIG_DP_TRACE_ALL
#endif

View file

@ -232,6 +232,7 @@ struct hdd_config {
uint16_t pkt_bundle_timer_value;
uint16_t pkt_bundle_size;
#endif
uint32_t dp_proto_event_bitmap;
};
/**

View file

@ -492,10 +492,14 @@ void hdd_ipa_send_nbuf_to_network(qdf_nbuf_t nbuf, qdf_netdev_t dev)
adapter->stats.rx_bytes += nbuf->len;
result = hdd_ipa_aggregated_rx_ind(nbuf);
if (result == NET_RX_SUCCESS)
if (result == NET_RX_SUCCESS) {
++adapter->hdd_stats.tx_rx_stats.rx_delivered[cpu_index];
else
} else {
++adapter->hdd_stats.tx_rx_stats.rx_refused[cpu_index];
DPTRACE(qdf_dp_log_proto_pkt_info(NULL, NULL, 0, 0, QDF_RX,
QDF_TRACE_DEFAULT_MSDU_ID,
QDF_TX_RX_STATUS_DROP));
}
/*
* Restore PF_WAKE_UP_IDLE flag in the task structure

View file

@ -12644,6 +12644,8 @@ void hdd_dp_trace_init(struct hdd_config *config)
uint8_t num_entries = 0;
uint32_t bw_compute_interval;
qdf_dp_set_proto_event_bitmap(config->dp_proto_event_bitmap);
if (!config->enable_dp_trace) {
hdd_err("dp trace is disabled from ini");
return;

View file

@ -925,10 +925,15 @@ QDF_STATUS hdd_softap_rx_packet_cbk(void *adapter_context, qdf_nbuf_t rx_buf)
qdf_status = hdd_rx_deliver_to_stack(adapter, skb);
if (QDF_IS_STATUS_SUCCESS(qdf_status))
if (QDF_IS_STATUS_SUCCESS(qdf_status)) {
++adapter->hdd_stats.tx_rx_stats.rx_delivered[cpu_index];
else
} else {
++adapter->hdd_stats.tx_rx_stats.rx_refused[cpu_index];
DPTRACE(qdf_dp_log_proto_pkt_info(NULL, NULL, 0, 0,
QDF_RX,
QDF_TRACE_DEFAULT_MSDU_ID,
QDF_TX_RX_STATUS_DROP));
}
}
return QDF_STATUS_SUCCESS;

View file

@ -2219,6 +2219,10 @@ QDF_STATUS hdd_rx_packet_cbk(void *adapter_context,
hdd_tx_rx_collect_connectivity_stats_info(
skb, adapter,
PKT_TYPE_RX_REFUSED, &pkt_type);
DPTRACE(qdf_dp_log_proto_pkt_info(NULL, NULL, 0, 0,
QDF_RX,
QDF_TRACE_DEFAULT_MSDU_ID,
QDF_TX_RX_STATUS_DROP));
}
}
@ -3118,6 +3122,8 @@ hdd_dp_dp_trace_cfg_update(struct hdd_config *config,
qdf_uint8_array_parse(cfg_get(psoc, CFG_DP_DP_TRACE_CONFIG),
config->dp_trace_config,
sizeof(config->dp_trace_config), &array_out_size);
config->dp_proto_event_bitmap = cfg_get(psoc,
CFG_DP_PROTO_EVENT_BITMAP);
}
#else
static void