lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <530FBE51.8040905@candelatech.com>
Date:	Thu, 27 Feb 2014 14:38:09 -0800
From:	Ben Greear <greearb@...delatech.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
CC:	Florian Fainelli <f.fainelli@...il.com>,
	"linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
	netdev <netdev@...r.kernel.org>
Subject: Re: How to best consolidate list of skbs (msdu) for receive?

On 02/27/2014 02:31 PM, Eric Dumazet wrote:
> On Thu, 2014-02-27 at 13:51 -0800, Ben Greear wrote:
> 
>> That said, the code below appears to work, even if it is
>> not as efficient as it might be?
>>
>> 			if (msdu_chaining) {
>> 				struct sk_buff *next = msdu_head->next;
>> 				struct sk_buff *to_free = next;
>> 				int space;
>> 				static int do_once = 1;
>> 				msdu_head->next = NULL;
>>
>> 				if (unlikely(do_once)) {
>> 					ath10k_warn("htt rx msdu_chaining detected %d\n",
>> 						    msdu_chaining);
>> 					do_once = 0;
>> 				}
>>
>> 				while (next) {
>> 					space = next->len - skb_tailroom(msdu_head);
>>
>> 					if ((space > 0) &&
>> 					    (pskb_expand_head(msdu_head, 0, space, GFP_ATOMIC) < 0)) {
>> 						/* TODO:  bump some rx-oom error stat */
>> 						goto outside_continue;
>> 					}
>> 					skb_copy_from_linear_data(next, skb_put(msdu_head, next->len),
>> 								  next->len);
>> 					next = next->next;
>> 				}
> 
> Yep, this is very inefficient , you might copy data very often in
> pskb_expand_head(), then in skb_copy_from_linear_data()

Based on the code above, do you think skb_try_coalesce() is
the best option for this logic?

> Also, if total length is big, you end up doing high order allocations,
> since you generate a linear skb. This might fail under memory pressure.
> 
> What is the maximal skb->len of resulting skb ?

According to the page below, msdu are limited to 7935 total.  In my testing, I have seen a maximum
of 2 chained skbs (3 total).  I do not know the average total combined skb size...but since it
has upper bound of 8k, perhaps that doesn't matter so much?

http://ergodicthoughts.blogspot.com/2012/02/difference-between-mpdu-msdu-ampdu-and.html

Thanks,
Ben

-- 
Ben Greear <greearb@...delatech.com>
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ