Эх сурвалжийг харах

core: Add stat to track chaining

Keep a count in increments of 10 upto 60 and a count for greater
than 60.

CRs-Fixed: 2984565
Change-Id: I20d81e03b1a592e3e69c6e83d1a827ae0c72f6b9
Signed-off-by: Subash Abhinov Kasiviswanathan <[email protected]>
Subash Abhinov Kasiviswanathan 4 жил өмнө
parent
commit
3bbb9ff4ae

+ 1 - 0
core/rmnet_config.h

@@ -60,6 +60,7 @@ struct rmnet_port_priv_stats {
 	u64 dl_trl_last_seq;
 	u64 dl_trl_count;
 	struct rmnet_agg_stats agg;
+	u64 dl_chain_stat[7];
 };
 
 struct rmnet_egress_agg_params {

+ 20 - 0
core/rmnet_descriptor.c

@@ -1756,12 +1756,28 @@ recycle:
 rmnet_perf_chain_hook_t rmnet_perf_chain_end __rcu __read_mostly;
 EXPORT_SYMBOL(rmnet_perf_chain_end);
 
+void rmnet_descriptor_classify_chain_count(u64 chain_count,
+					   struct rmnet_port *port)
+{
+	u64 index;
+
+	if (chain_count >= 60) {
+		port->stats.dl_chain_stat[6] += chain_count;
+		return;
+	}
+
+	index = chain_count;
+	do_div(index, 10);
+	port->stats.dl_chain_stat[index] += chain_count;
+}
+
 void rmnet_frag_ingress_handler(struct sk_buff *skb,
 				struct rmnet_port *port)
 {
 	rmnet_perf_chain_hook_t rmnet_perf_opt_chain_end;
 	LIST_HEAD(desc_list);
 	bool skip_perf = (skb->priority == 0xda1a);
+	u64 chain_count = 0;
 
 	/* Deaggregation and freeing of HW originating
 	 * buffers is done within here
@@ -1769,6 +1785,8 @@ void rmnet_frag_ingress_handler(struct sk_buff *skb,
 	while (skb) {
 		struct sk_buff *skb_frag;
 
+		chain_count++;
+
 		rmnet_frag_deaggregate(skb, port, &desc_list, skb->priority);
 		if (!list_empty(&desc_list)) {
 			struct rmnet_frag_descriptor *frag_desc, *tmp;
@@ -1786,6 +1804,8 @@ void rmnet_frag_ingress_handler(struct sk_buff *skb,
 		skb = skb_frag;
 	}
 
+	rmnet_descriptor_classify_chain_count(chain_count, port);
+
 	if (skip_perf)
 		return;
 

+ 7 - 0
core/rmnet_vnd.c

@@ -433,6 +433,13 @@ static const char rmnet_port_gstrings_stats[][ETH_GSTRING_LEN] = {
 	"DL trailer pkts received",
 	"UL agg reuse",
 	"UL agg alloc",
+	"DL chaining [0-10)",
+	"DL chaining [10-20)",
+	"DL chaining [20-30)",
+	"DL chaining [30-40)",
+	"DL chaining [40-50)",
+	"DL chaining [50-60)",
+	"DL chaining >= 60",
 };
 
 static const char rmnet_ll_gstrings_stats[][ETH_GSTRING_LEN] = {