All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] cfg80211: Don't re-use the skb for larger NL messages.
@ 2015-05-30 23:28 Chaitanya T K
  2015-05-31  6:58 ` Arend van Spriel
  2015-05-31  8:31 ` Johannes Berg
  0 siblings, 2 replies; 9+ messages in thread
From: Chaitanya T K @ 2015-05-30 23:28 UTC (permalink / raw)
  To: linux-wireless, Johannes Berg; +Cc: Chaitanya T K

cfg80211 reuses the skb before asking for a fresh on from genl framework, 
this works efficiently for smaller messages but NLM_F_DUMP is normally 
used to transport larger data normally > PAGE_SIZE, so if the message 
occupies more than GOODSIZE its better to ask for a new, saves couple
of hanshakes with the driver.

This improves the time to get the DUMP response across to user space.
Signed-off-by: Chaitanya T K <chaitanya.mgit@gmail.com>
---
V2: no new line, so commit log was cut off. Updated now.
---
 net/wireless/nl80211.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index c264eff..152bd0c 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7636,6 +7636,10 @@ static int nl80211_testmode_dump(struct sk_buff *skb,
 		}
 
 		genlmsg_end(skb, hdr);
+
+		/* Don't re-use skb, when we know nla_put fails*/
+		if (skb->len > NLMSG_GOODSIZE / 2)
+			break;
 	}
 
 	err = skb->len;

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-05-31 11:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-30 23:28 [PATCH v2] cfg80211: Don't re-use the skb for larger NL messages Chaitanya T K
2015-05-31  6:58 ` Arend van Spriel
2015-05-31  9:56   ` Krishna Chaitanya
2015-05-31  8:31 ` Johannes Berg
2015-05-31 10:01   ` Krishna Chaitanya
2015-05-31 10:42     ` Johannes Berg
2015-05-31 11:17       ` Krishna Chaitanya
2015-05-31 11:21         ` Johannes Berg
2015-05-31 11:39           ` Krishna Chaitanya

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.