diff --git a/core/hdd/inc/hdd_dp_cfg.h b/core/hdd/inc/hdd_dp_cfg.h index 7cf3c0ae1aa5..04f1e575bac4 100644 --- a/core/hdd/inc/hdd_dp_cfg.h +++ b/core/hdd/inc/hdd_dp_cfg.h @@ -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") + +/* + * + * 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 + * + * + */ +#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 diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index b7abce7d808a..43247fb1329d 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -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; }; /** diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index bb6722eb2314..3fb3b026da80 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -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 diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index a864b39ead15..98eb0f7c65ef 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -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; diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c index fe7a22b7b079..83a48623fa5b 100644 --- a/core/hdd/src/wlan_hdd_softap_tx_rx.c +++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c @@ -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; diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index edeb5f0fcac1..5eee0d39a698 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -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