From 45752d066789a6abd1e3bd03ef081e63efe45d3f Mon Sep 17 00:00:00 2001 From: Shiva Krishna Pittala Date: Sat, 27 Jul 2019 18:14:23 +0530 Subject: [PATCH] qcacmn: Account for fragmented list in qdf_nbuf_count_inc When a jumbo packet connected using fragmented list is given to the WLAN driver, currently we increment WLAN skb count by only 1, instead, increment the skb count for all fragments in the fragmented list. Change-Id: I291118fab2316505ca32900d7cce2b1510de203a CRs-Fixed: 2498314 --- qdf/linux/src/qdf_nbuf.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/qdf/linux/src/qdf_nbuf.c b/qdf/linux/src/qdf_nbuf.c index 8e837834c812..3fd692ac1197 100644 --- a/qdf/linux/src/qdf_nbuf.c +++ b/qdf/linux/src/qdf_nbuf.c @@ -334,7 +334,16 @@ qdf_export_symbol(__qdf_nbuf_count_get); */ void __qdf_nbuf_count_inc(qdf_nbuf_t nbuf) { - qdf_atomic_inc(&nbuf_count); + int num_nbuf = 1; + qdf_nbuf_t ext_list = qdf_nbuf_get_ext_list(nbuf); + + /* Take care to account for frag_list */ + while (ext_list) { + ++num_nbuf; + ext_list = qdf_nbuf_queue_next(ext_list); + } + + qdf_atomic_add(num_nbuf, &nbuf_count); } qdf_export_symbol(__qdf_nbuf_count_inc);