Bladeren bron

core: Add a stat to track chaining frags

Keep count of single fragments and other fragment counts in increments
of 6 upto the maximum possible 16.

CRs-Fixed: 2992022
Change-Id: I1b1c474e51cf1fe8856d53511ae7c374caa0b4a2
Signed-off-by: Subash Abhinov Kasiviswanathan <[email protected]>
Subash Abhinov Kasiviswanathan 4 jaren geleden
bovenliggende
commit
2bb9cb1f3c
3 gewijzigde bestanden met toevoegingen van 30 en 0 verwijderingen
  1. 2 0
      core/rmnet_config.h
  2. 22 0
      core/rmnet_descriptor.c
  3. 6 0
      core/rmnet_vnd.c

+ 2 - 0
core/rmnet_config.h

@@ -61,6 +61,8 @@ struct rmnet_port_priv_stats {
 	u64 dl_trl_count;
 	struct rmnet_agg_stats agg;
 	u64 dl_chain_stat[7];
+	u64 dl_frag_stat_1;
+	u64 dl_frag_stat[5];
 };
 
 struct rmnet_egress_agg_params {

+ 22 - 0
core/rmnet_descriptor.c

@@ -1771,6 +1771,26 @@ void rmnet_descriptor_classify_chain_count(u64 chain_count,
 	port->stats.dl_chain_stat[index] += chain_count;
 }
 
+void rmnet_descriptor_classify_frag_count(u64 frag_count,
+					  struct rmnet_port *port)
+{
+	u64 index;
+
+	if (frag_count <= 1) {
+		port->stats.dl_frag_stat_1 += frag_count;
+		return;
+	}
+
+	if (frag_count >= 16) {
+		port->stats.dl_frag_stat[4] += frag_count;
+		return;
+	}
+
+	index = frag_count;
+	do_div(index, 4);
+	port->stats.dl_frag_stat[index] += frag_count;
+}
+
 void rmnet_frag_ingress_handler(struct sk_buff *skb,
 				struct rmnet_port *port)
 {
@@ -1786,6 +1806,8 @@ void rmnet_frag_ingress_handler(struct sk_buff *skb,
 		struct sk_buff *skb_frag;
 
 		chain_count++;
+		rmnet_descriptor_classify_frag_count(skb_shinfo(skb)->nr_frags,
+						     port);
 
 		rmnet_frag_deaggregate(skb, port, &desc_list, skb->priority);
 		if (!list_empty(&desc_list)) {

+ 6 - 0
core/rmnet_vnd.c

@@ -440,6 +440,12 @@ static const char rmnet_port_gstrings_stats[][ETH_GSTRING_LEN] = {
 	"DL chaining [40-50)",
 	"DL chaining [50-60)",
 	"DL chaining >= 60",
+	"DL chaining frags [0-1]",
+	"DL chaining frags [2-3]",
+	"DL chaining frags [4-7]",
+	"DL chaining frags [8-11]",
+	"DL chaining frags [12-15]",
+	"DL chaining frags = 16",
 };
 
 static const char rmnet_ll_gstrings_stats[][ETH_GSTRING_LEN] = {