From: Ian Campbell <Ian.Campbell@eu.citrix.com>
To: "Michał Mirosław" <mirqus@gmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
"James E.J. Bottomley" <JBottomley@parallels.com>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
"Pekka Savola (ipv6)" <pekkas@netcore.fi>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Patrick McHardy <kaber@trash.net>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"devel@open-fcoe.org" <devel@open-fcoe.org>
Subject: Re: [PATCH 10/13] net: add paged frag destructor to skb_fill_page_desc()
Date: Fri, 22 Jul 2011 22:07:52 +0100 [thread overview]
Message-ID: <1311368872.4027.76.camel@dagon.hellion.org.uk> (raw)
In-Reply-To: <CAHXqBFLQFKqK=ORpDQx6s2ud8mWkx=YC_AT60GVS+4XK0H61pw@mail.gmail.com>
On Fri, 2011-07-22 at 20:58 +0100, Michał Mirosław wrote:
> 2011/7/22 Ian Campbell <ian.campbell@citrix.com>:
> > diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> > index 9818fe2..faee8d3 100644
> > --- a/include/linux/skbuff.h
> > +++ b/include/linux/skbuff.h
> > @@ -1134,12 +1134,14 @@ static inline int skb_pagelen(const struct sk_buff *skb)
> > * Does not take any additional reference on the fragment.
> > */
> > static inline void __skb_fill_page_desc(struct sk_buff *skb, int i,
> > - struct page *page, int off, int size)
> > + struct page *page,
> > + struct skb_frag_destructor *destroy,
> > + int off, int size)
> > {
> > skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
> >
> > frag->page.p = page;
> > - frag->page.destructor = NULL;
> > + frag->page.destructor = destroy;
> > frag->page_offset = off;
> > frag->size = size;
> > }
>
> You could just rename this function to e.g.
> __skb_fill_fragile_page_desc() (or whatever name) add an inline
> wrapper calling it with destroy == NULL. This will avoid touching all
> those drivers which won't ever need this functionality.
I could call this variant __skb_frag_init (which I think better fits
into the pattern of the new functions) and leave the existing
__skb_fill_page_desc as a compat wrapper if that's preferred but I was
trying to avoid duplicating up constructors just for different sets of
defaults.
Ian.
next prev parent reply other threads:[~2011-07-22 21:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1311340095.12772.57.camel@zakaz.uk.xensource.com>
2011-07-22 13:17 ` [PATCH 10/13] net: add paged frag destructor to skb_fill_page_desc() Ian Campbell
2011-07-22 19:58 ` Michał Mirosław
2011-07-22 21:07 ` Ian Campbell [this message]
2011-07-22 21:44 ` Michał Mirosław
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=1311368872.4027.76.camel@dagon.hellion.org.uk \
--to=ian.campbell@eu.citrix.com \
--cc=JBottomley@parallels.com \
--cc=davem@davemloft.net \
--cc=devel@open-fcoe.org \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mirqus@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pekkas@netcore.fi \
--cc=yoshfuji@linux-ipv6.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