[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1371142391.2246.4.camel@bwh-desktop.uk.level5networks.com>
Date: Thu, 13 Jun 2013 17:53:11 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: Dave Wiltshire <david.wiltshire@....com>
CC: <davem@...emloft.net>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <nsujir@...adcom.com>,
<mchan@...adcom.com>, <rmody@...cade.com>, <jcliburn@...il.com>,
<chris.snook@...il.com>, <jeffrey.t.kirsher@...el.com>,
<bruce.w.allan@...el.com>, <alexander.h.duyck@...el.com>,
<cooldavid@...ldavid.org>, <linux-driver@...gic.com>,
<linux-wimax@...el.com>, <wimax@...uxwimax.org>,
<linux-wireless@...r.kernel.org>, <viro@...iv.linux.org.uk>,
<eparis@...hat.com>, <edumazet@...gle.com>, <dev@...nvswitch.org>,
<jhs@...atatu.com>
Subject: Re: [PATCH 3/3] skbuff: Added new helper function
skb_cow_clone_head.
On Wed, 2013-06-12 at 22:40 +1000, Dave Wiltshire wrote:
> In a few different drivers there is a check of (skb_cloned &&
> !skb_clone_writable) before then using pskb_expand_head to copy the skb
> if that is required. There are already some skb_cow_* functions for
> other conditions, so added this one and changed the call sites.
>
> Signed-off-by: Dave Wiltshire <david.wiltshire@....com>
> ---
> include/linux/skbuff.h | 14 ++++++++++++++
> net/core/dev.c | 8 ++------
> net/openvswitch/actions.c | 22 +++++++---------------
> net/sched/act_csum.c | 8 ++------
> net/sched/act_nat.c | 18 +++++-------------
> 5 files changed, 30 insertions(+), 40 deletions(-)
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index a7393ad..7d18541 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -2154,6 +2154,20 @@ static inline int skb_cow_head(struct sk_buff *skb, unsigned int headroom)
> }
>
> /**
> + * skb_cow_clone_head
This is a missing a short description after the name.
Ben.
> + * @skb: buffer to cow
> + * @len: length up to which to write
> + *
> + * This function is identical to skb_cow and sb_cow_head except that we
> + * replace the skb_cloned check by skb_cloned && !skb_clone_writable.
> + *
> + */
> +static inline int skb_cow_clone_head(struct sk_buff *skb, unsigned int len)
> +{
> + return __skb_cow(skb, 0, skb_cloned(skb) && !skb_clone_writable(skb, len));
> +}
[...]
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
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