From 6d2ffaa98057a9818a1ef0ed4f6f54608c207429 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Wed, 14 Jun 2017 15:59:52 +0530 Subject: [PATCH] qcacmn: Increase cld80211 family nlmsg size to 8K bytes Current cld80211 nl message size depends on PAGE_SIZE. PAGE_SIZE can be 4K and thus it's limiting the maximum nl message size to 4K bytes. Make the max supported nl message size to 8K bytes irrespective of PAGE_SIZE. Change-Id: I58fe8f85a5c9a0476fc5df75d0caa342cc261967 CRs-Fixed: 2053305 --- utils/nlink/src/wlan_nlink_srv.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/utils/nlink/src/wlan_nlink_srv.c b/utils/nlink/src/wlan_nlink_srv.c index 197e7ece53d8..0576ad3e3183 100644 --- a/utils/nlink/src/wlan_nlink_srv.c +++ b/utils/nlink/src/wlan_nlink_srv.c @@ -276,6 +276,8 @@ qdf_export_symbol(nl_srv_is_initialized); #include #endif +#define WLAN_CLD80211_MAX_SIZE (SKB_WITH_OVERHEAD(8192UL) - NLMSG_HDRLEN) + /* Global variables */ static DEFINE_MUTEX(nl_srv_sem); static struct sock *nl_srv_sock; @@ -459,7 +461,17 @@ static int send_msg_to_cld80211(int mcgroup_id, int pid, int app_id, if (in_interrupt() || irqs_disabled() || in_atomic()) flags = GFP_ATOMIC; - msg = nlmsg_new(NLMSG_DEFAULT_SIZE, flags); + if (len > NLMSG_DEFAULT_SIZE) { + if (len > WLAN_CLD80211_MAX_SIZE) { + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, + "buf size:%d if more than max size: %d", + len, (int) WLAN_CLD80211_MAX_SIZE); + return -ENOMEM; + } + msg = nlmsg_new(WLAN_CLD80211_MAX_SIZE, flags); + } else { + msg = nlmsg_new(NLMSG_DEFAULT_SIZE, flags); + } if (!msg) { QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, "nlmsg malloc fails");