netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>
Subject: Re: How to best consolidate list of skbs (msdu) for receive?
Date: Thu, 27 Feb 2014 14:38:09 -0800	[thread overview]
Message-ID: <530FBE51.8040905@candelatech.com> (raw)
In-Reply-To: <1393540305.26794.47.camel@edumazet-glaptop2.roam.corp.google.com>

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@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

  reply	other threads:[~2014-02-27 22:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27 18:36 How to best consolidate list of skbs (msdu) for receive? Ben Greear
2014-02-27 20:37 ` Florian Fainelli
2014-02-27 21:21   ` Eric Dumazet
2014-02-27 21:51     ` Ben Greear
2014-02-27 22:31       ` Eric Dumazet
2014-02-27 22:38         ` Ben Greear [this message]
2014-02-27 23:03           ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=530FBE51.8040905@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=eric.dumazet@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).