ソースを参照

qcacmn: Account for fragmented list in qdf_nbuf_count_dec

When a jumbo packet connected using fragmented list is freed or given to
the network stack, currently we decrement WLAN skb count by only 1,
instead, decrement the skb count for all fragments in the fragmented list.

Change-Id: I36a9aa9f3f5537718d476c368b3b110786494d5b
CRs-Fixed: 2498313
Shiva Krishna Pittala 5 年 前
コミット
1a87414f89
1 ファイル変更17 行追加1 行削除
  1. 17 1
      qdf/linux/src/qdf_nbuf.c

+ 17 - 1
qdf/linux/src/qdf_nbuf.c

@@ -347,7 +347,23 @@ qdf_export_symbol(__qdf_nbuf_count_inc);
  */
 void __qdf_nbuf_count_dec(__qdf_nbuf_t nbuf)
 {
-	qdf_atomic_dec(&nbuf_count);
+	qdf_nbuf_t ext_list;
+	int num_nbuf;
+
+	if (qdf_nbuf_get_users(nbuf) > 1)
+		return;
+
+	num_nbuf = 1;
+
+	/* Take care to account for frag_list */
+	ext_list = qdf_nbuf_get_ext_list(nbuf);
+	while (ext_list) {
+		if (qdf_nbuf_get_users(ext_list) == 1)
+			++num_nbuf;
+		ext_list = qdf_nbuf_queue_next(ext_list);
+	}
+
+	qdf_atomic_sub(num_nbuf, &nbuf_count);
 }
 qdf_export_symbol(__qdf_nbuf_count_dec);
 #endif