All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zoltan Kiss <zoltan.kiss@citrix.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: <xen-devel@lists.xenproject.org>, <ian.campbell@citrix.com>,
	<wei.liu2@citrix.com>, <linux@eikelenboom.it>,
	<paul.durrant@citrix.com>, <netdev@vger.kernel.org>,
	<david.vrabel@citrix.com>, <davem@davemloft.net>
Subject: Re: [PATCH net RFC] xen-netback: Fix grant ref resolution in RX path
Date: Wed, 14 May 2014 14:25:14 +0100	[thread overview]
Message-ID: <53736EBA.7050401@citrix.com> (raw)
In-Reply-To: <1400067318.7973.69.camel@edumazet-glaptop2.roam.corp.google.com>

On 14/05/14 12:35, Eric Dumazet wrote:
> On Wed, 2014-05-14 at 12:12 +0100, Zoltan Kiss wrote:
>> On 13/05/14 17:13, Eric Dumazet wrote:
>>>
>>> The 'cleanup' of stale ubufs should be right after __pskb_pull_tail().
>> We can't fix every place in the kernel where frags might be changed,
>> especially with a netback specific stuff, so unfortunately that won't work
>>>
>>> This is the function that can 'consume frags' after all.
>>>
>>> Its not clear that you catch all cases, like skbs being purged in case
>>> of device dismantle.
>> We need this list for two reason:
>> a) give back the pages to the sending guest (kfree/skb_copy_ubufs)
>
> So If networking stack takes a reference on one particular frag, or
> releases a ref on a frag, how is it done exactly ?
Releasing a frag (= put_page) is not a problem, it will be given back to 
the guest when the skb is freed up. But taking an another ref is bad, 
because the destructor_arg is on shinfo, an another skb won't have the 
information about how to release that frag. That's why skb_orphan_frags 
exist, it triggers a local copy of the frags to be done, and release 
them back, so later on this feature doesn't cause a trouble. skb_clone 
does that as first thing, for example.
But of course it should be carefully checked that functions which place 
frags into another frags arrays should call orphan_frags, e.g. I guess 
skb_shift does such thing. That's what I intend to start another thread 
about.
>
> Are you 'giving back' page to the guest later because ubuf chain is now
> obsolete ???
>
>
>> b) find out the grant refs when the skb is sent to another vif
>> b) is handled by this patch. For a) netback doesn't mind if granted
>> frags were removed and/or local ones were injected. It only needs to
>> give back the pages, it doesn't matter how the skb ended up.
>
>> The only other problematic point if frags are passed around between
>> skbs, I'll write a separate mail about it.
>
> Well, it seems this is exactly the point.
> You give 'very special skb' to the stack, expecting stack will never do
> any frag games, like in skb_try_coalesce()
That's another function which needs an orphan_frag. Btw. usually these 
functions doesn't touch these packets, as they don't reach the upper 
layers of the stack, unless a frontend wants a socket connection to the 
backend domain.

  parent reply	other threads:[~2014-05-14 13:25 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 14:31 [PATCH net RFC] xen-netback: Fix grant ref resolution in RX path Zoltan Kiss
2014-05-13 15:47 ` Ian Campbell
2014-05-13 15:47 ` Ian Campbell
2014-05-13 20:18   ` Zoltan Kiss
2014-05-13 20:18   ` Zoltan Kiss
2014-05-13 16:13 ` Eric Dumazet
2014-05-13 19:25   ` Sander Eikelenboom
2014-05-13 19:25   ` Sander Eikelenboom
2014-05-14  8:32   ` Ian Campbell
2014-05-14 13:37     ` David Vrabel
2014-05-14 13:37     ` David Vrabel
2014-05-14  8:32   ` Ian Campbell
2014-05-14 11:12   ` Zoltan Kiss
2014-05-14 11:35     ` Eric Dumazet
2014-05-14 13:25       ` Zoltan Kiss
2014-05-14 13:25       ` Zoltan Kiss [this message]
2014-05-14 16:40         ` Ian Campbell
2014-05-14 16:40         ` Ian Campbell
2014-05-14 17:28           ` Sander Eikelenboom
2014-05-14 17:28           ` Sander Eikelenboom
2014-05-14 18:44           ` Zoltan Kiss
2014-05-14 18:44           ` Zoltan Kiss
2014-05-15  8:41             ` Ian Campbell
2014-05-15  8:41             ` Ian Campbell
2014-05-14 11:35     ` Eric Dumazet
2014-05-15  8:31     ` Ian Campbell
2014-05-15  8:31     ` Ian Campbell
2014-05-15 10:14       ` Zoltan Kiss
2014-05-15 10:14       ` Zoltan Kiss
2014-05-14 11:12   ` Zoltan Kiss
2014-05-13 16:13 ` Eric Dumazet
  -- strict thread matches above, loose matches on Subject: below --
2014-05-13 14:31 Zoltan Kiss

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=53736EBA.7050401@citrix.com \
    --to=zoltan.kiss@citrix.com \
    --cc=davem@davemloft.net \
    --cc=david.vrabel@citrix.com \
    --cc=eric.dumazet@gmail.com \
    --cc=ian.campbell@citrix.com \
    --cc=linux@eikelenboom.it \
    --cc=netdev@vger.kernel.org \
    --cc=paul.durrant@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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 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.