netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomas Winkler <tomasw@gmail.com>
To: Emmanuel Grumbach <egrumbach@gmail.com>
Cc: "Michał Mirosław" <mirqus@gmail.com>,
	netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	"Johannes Berg" <johannes@sipsolutions.net>,
	"Guy, Wey-Yi" <wey-yi.w.guy@intel.com>,
	guy.cohen@intel.com
Subject: Re: several packets in a single buffer in Rx
Date: Mon, 16 May 2011 23:04:54 +0300	[thread overview]
Message-ID: <BANLkTimvCVcQX-7teQgG7EQV9eeLgG3JnQ@mail.gmail.com> (raw)
In-Reply-To: <BANLkTin_stn+7Ja3hbuaOgtrEVJEoT9Lhw@mail.gmail.com>

2011/5/16 Emmanuel Grumbach <egrumbach@gmail.com>:
> 2011/5/16 Michał Mirosław <mirqus@gmail.com>:
>> W dniu 16 maja 2011 14:59 użytkownik Emmanuel Grumbach
>> <egrumbach@gmail.com> napisał:
>>> 2011/5/16 Michał Mirosław <mirqus@gmail.com>:
>>>> 2011/5/16 Emmanuel Grumbach <egrumbach@gmail.com>:
>>>>> I would like to be able to deliver the same page several times to the
>>>>> stack without having the stack consume it before the last time I
>>>>> deliver it.
>>>>> Of course I would like to avoid cloning it.
>>>>
>>>> Just do get_page() on the page having another packet in it before
>>>> passing skb up.
>>>>
>>>
>>> I can see the path:
>>> __kfree_skb -> skb_release_all -> skb_release_data -> put_page
>>> put_page will free the page iff the _count variable reaches 0. Of course,
>>> _count is incremented by get_page.
>>>
>>> I will give it try.
>>>
>>> I understand that this will work regardless the order given to
>>> alloc_pages right ?
>>
>> Yes. Remember that if you put a lot of packets in a big-order page
>> then the memory will be freed only after all packets are freed.
>
> Sure. Thanks for the help.

How it is ensured that skb manipulation won't corrupt another packet
on the same page?

Thanks
Tomas

  reply	other threads:[~2011-05-16 20:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16  9:41 several packets in a single buffer in Rx Emmanuel Grumbach
     [not found] ` <BANLkTimkgtQL1A2A3iAP-UYK2KdDvPmY3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-16 11:06   ` Michał Mirosław
2011-05-16 12:59     ` Emmanuel Grumbach
2011-05-16 13:13       ` Michał Mirosław
     [not found]         ` <BANLkTi=xJbL-26Hzg0Pp5zKPUi35bV6VmA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-16 13:36           ` Emmanuel Grumbach
2011-05-16 20:04             ` Tomas Winkler [this message]
     [not found]               ` <BANLkTimvCVcQX-7teQgG7EQV9eeLgG3JnQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-16 20:15                 ` Ben Hutchings

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=BANLkTimvCVcQX-7teQgG7EQV9eeLgG3JnQ@mail.gmail.com \
    --to=tomasw@gmail.com \
    --cc=egrumbach@gmail.com \
    --cc=guy.cohen@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mirqus@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=wey-yi.w.guy@intel.com \
    /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).