Sfoglia il codice sorgente

qcacmn: Support TX completion and RX delay tracing for KIWI

Support TX completion and RX delay tracing by Ftrace for KIWI,
Add generic IP protocol packt tracing like ICMP packet.

Change-Id: Ie0c4b1764ce953fd2ed41fc5eea8aa28c8d427d9
CRs-Fixed: 3126080
Jinwei Chen 3 anni fa
parent
commit
7a60675260

+ 2 - 1
dp/wifi3.0/be/dp_be_rx.c

@@ -569,7 +569,8 @@ done:
 		DP_RX_TID_SAVE(nbuf, tid);
 		if (qdf_unlikely(rx_pdev->delay_stats_flag) ||
 		    qdf_unlikely(wlan_cfg_is_peer_ext_stats_enabled(
-				 soc->wlan_cfg_ctx)))
+				 soc->wlan_cfg_ctx)) ||
+		    dp_rx_pkt_tracepoints_enabled())
 			qdf_nbuf_set_timestamp(nbuf);
 
 		enh_flag = rx_pdev->enhanced_stats_en;

+ 3 - 2
dp/wifi3.0/be/dp_be_tx.c

@@ -535,8 +535,9 @@ dp_tx_hw_enqueue_be(struct dp_soc *soc, struct dp_vdev *vdev,
 		hal_tx_desc_set_hlos_tid(hal_tx_desc_cached, tid);
 
 	if (qdf_unlikely(vdev->pdev->delay_stats_flag) ||
-		qdf_unlikely(wlan_cfg_is_peer_ext_stats_enabled(soc->wlan_cfg_ctx)) ||
-		qdf_unlikely(soc->rdkstats_enabled))
+	    qdf_unlikely(wlan_cfg_is_peer_ext_stats_enabled(soc->wlan_cfg_ctx)) ||
+	    qdf_unlikely(soc->rdkstats_enabled) ||
+	    dp_tx_pkt_tracepoints_enabled())
 		tx_desc->timestamp = qdf_ktime_to_ms(qdf_ktime_real_get());
 
 	dp_verbose_debug("length:%d , type = %d, dma_addr %llx, offset %d desc id %u",

+ 69 - 2
qdf/linux/src/i_qdf_tracepoint.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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
@@ -150,7 +150,74 @@ void __qdf_trace_dp_tx_comp_udp_pkt(struct sk_buff *skb, uint16_t ip_id,
 }
 
 /**
- * __qdf_trace_dp_rx_pkt_enabled() - Get the dp_rx_pkt tracepoint
+ * __qdf_trace_dp_rx_generic_ip_pkt_enabled() - Get the dp_rx_generic_ip_pkt
+ *					tracepoint enabled or disabled state
+ *
+ * Return: True if the tracepoint is enabled else false
+ */
+static inline
+bool __qdf_trace_dp_rx_generic_ip_pkt_enabled(void)
+{
+	return trace_dp_rx_generic_ip_pkt_enabled();
+}
+
+/**
+ * __qdf_trace_dp_rx_generic_ip_pkt() - Trace generic ip packet in rx direction
+ * @skb: pointer to network buffer
+ * @ip_proto: ip protocol type
+ * @ip_id: ip identification field
+ * @trans_hdr_4_bytes: transport header first 4 bytes
+ * @latency: latency
+ *
+ * Return: None
+ */
+static inline
+void __qdf_trace_dp_rx_generic_ip_pkt(struct sk_buff *skb, uint8_t ip_proto,
+				      uint16_t ip_id, uint32_t trans_hdr_4_bytes,
+				      uint64_t latency)
+{
+	trace_dp_rx_generic_ip_pkt(skb, ip_proto, ip_id,
+				   trans_hdr_4_bytes,
+				   latency);
+}
+
+/**
+ * __qdf_trace_dp_tx_comp_generic_ip_pkt_enabled() - Get the dp_tx_comp_generic_ip_pkt
+ *						tracepoint enabled or disabled state
+ *
+ * Return: True if the tracepoint is enabled else false
+ */
+static inline
+bool __qdf_trace_dp_tx_comp_generic_ip_pkt_enabled(void)
+{
+	return trace_dp_tx_comp_generic_ip_pkt_enabled();
+}
+
+/**
+ * __qdf_trace_dp_tx_comp_generic_ip_pkt() - Trace generic ip packet in
+ *					     tx direction
+ * @skb: pointer to network buffer
+ * @ip_id: ip identification field
+ * @trans_hdr_4_bytes: transport header first 4 bytes
+ * @latency: latency
+
+ *
+ * Return: None
+ */
+static inline
+void __qdf_trace_dp_tx_comp_generic_ip_pkt(struct sk_buff *skb,
+					   uint8_t ip_proto,
+					   uint16_t ip_id,
+					   uint32_t trans_hdr_4_bytes,
+					   uint64_t latency)
+{
+	trace_dp_tx_comp_generic_ip_pkt(skb, ip_proto, ip_id,
+					trans_hdr_4_bytes,
+					latency);
+}
+
+/**
+ * __qdf_trace_dp_rx_pkt_enablei() - Get the dp_rx_pkt tracepoint
  *  enabled or disabled state
  *
  * Return: True if the tracepoint is enabled else false

+ 9 - 1
qdf/linux/src/qdf_tracepoint.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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
@@ -50,6 +50,10 @@ static void qdf_trace_dp_tx_ip_packet(qdf_nbuf_t nbuf, uint8_t *trans_hdr,
 					       qdf_ntohs(udph->src_port),
 					       qdf_ntohs(udph->dst_port),
 					       latency);
+	} else if (__qdf_trace_dp_tx_comp_generic_ip_pkt_enabled()) {
+		__qdf_trace_dp_tx_comp_generic_ip_pkt(nbuf, ip_proto, ip_id,
+						      QDF_SWAP_U32(*(uint32_t *)trans_hdr),
+						      latency);
 	}
 }
 
@@ -74,6 +78,10 @@ static void qdf_trace_dp_rx_ip_packet(qdf_nbuf_t nbuf, uint8_t *trans_hdr,
 					  qdf_ntohs(udph->src_port),
 					  qdf_ntohs(udph->dst_port),
 					  latency);
+	} else if (__qdf_trace_dp_rx_generic_ip_pkt_enabled()) {
+		__qdf_trace_dp_rx_generic_ip_pkt(nbuf, ip_proto, ip_id,
+						 QDF_SWAP_U32(*(uint32_t *)trans_hdr),
+						 latency);
 	}
 }
 

+ 45 - 1
qdf/linux/src/qdf_tracepoint_defs.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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
@@ -130,6 +130,50 @@ DEFINE_EVENT(dp_trace_udp_pkt_class, dp_tx_comp_udp_pkt,
 	     TP_ARGS(skb, ip_id, srcport, dstport, tdelta)
 );
 
+DECLARE_EVENT_CLASS(dp_trace_generic_ip_pkt_class,
+		    TP_PROTO(struct sk_buff *skb, uint8_t ip_proto,
+			     uint16_t ip_id, uint32_t trans_hdr_4_bytes,
+			     uint64_t tdelta),
+		    TP_ARGS(skb, ip_proto, ip_id,
+			    trans_hdr_4_bytes, tdelta),
+		    TP_STRUCT__entry(
+			__field(void *, skb)
+			__field(uint8_t, ip_proto)
+			__field(uint16_t, ip_id)
+			__field(uint32_t, trans_hdr_4_bytes)
+			__field(uint64_t, tdelta)
+		    ),
+		    TP_fast_assign(
+			__entry->skb = skb;
+			__entry->ip_proto = ip_proto;
+			__entry->ip_id = ip_id;
+			__entry->trans_hdr_4_bytes = trans_hdr_4_bytes;
+			__entry->tdelta = tdelta;
+		    ),
+		    TP_printk("skb=%pK ip_proto=0x%x ip_id=0x%x, transport_hdr[4]:0x%08x, latency(ms)=%llu",
+			      __entry->skb, __entry->ip_proto,
+			      __entry->ip_id,  __entry->trans_hdr_4_bytes,
+			      __entry->tdelta)
+);
+
+DEFINE_EVENT(dp_trace_generic_ip_pkt_class, dp_rx_generic_ip_pkt,
+	     TP_PROTO(struct sk_buff *skb, uint8_t ip_proto,
+		      uint16_t ip_id, uint32_t trans_hdr_4_bytes,
+		      uint64_t tdelta),
+	     TP_ARGS(skb, ip_proto, ip_id,
+		     trans_hdr_4_bytes,
+		     tdelta)
+);
+
+DEFINE_EVENT(dp_trace_generic_ip_pkt_class, dp_tx_comp_generic_ip_pkt,
+	     TP_PROTO(struct sk_buff *skb, uint8_t ip_proto,
+		      uint16_t ip_id, uint32_t trans_hdr_4_bytes,
+		      uint64_t tdelta),
+	     TP_ARGS(skb, ip_proto, ip_id,
+		     trans_hdr_4_bytes,
+		     tdelta)
+);
+
 DECLARE_EVENT_CLASS(dp_trace_pkt_class,
 		    TP_PROTO(struct sk_buff *skb, uint16_t ether_type,
 			     uint64_t tdelta),