* [PATCH net-next] net: pass correct parameter to skb_headers_offset_update()
@ 2013-06-06 13:27 Weiping Pan
2013-06-07 6:47 ` Simon Horman
0 siblings, 1 reply; 3+ messages in thread
From: Weiping Pan @ 2013-06-06 13:27 UTC (permalink / raw)
To: netdev; +Cc: horms, Weiping Pan
Since commit 1a37e412a022(net: Use 16bits for *_headers fields of struct
skbuff), skb->*_header are relative to skb->head,
so copy_skb_header() should not call skb_headers_offset_update() now,
and we should pass correct parameter to skb_headers_offset_update() in
pskb_expand_head() and skb_copy_expand().
Signed-off-by: Weiping Pan <panweiping3@gmail.com>
---
net/core/skbuff.c | 15 ++-------------
1 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 73f57a0..30a1b56 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -905,18 +905,8 @@ static void skb_headers_offset_update(struct sk_buff *skb, int off)
static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
{
-#ifndef NET_SKBUFF_DATA_USES_OFFSET
- /*
- * Shift between the two data areas in bytes
- */
- unsigned long offset = new->data - old->data;
-#endif
-
__copy_skb_header(new, old);
-#ifndef NET_SKBUFF_DATA_USES_OFFSET
- skb_headers_offset_update(new, offset);
-#endif
skb_shinfo(new)->gso_size = skb_shinfo(old)->gso_size;
skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs;
skb_shinfo(new)->gso_type = skb_shinfo(old)->gso_type;
@@ -1108,7 +1098,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
skb->end = skb->head + size;
#endif
skb->tail += off;
- skb_headers_offset_update(skb, off);
+ skb_headers_offset_update(skb, nhead);
/* Only adjust this if it actually is csum_start rather than csum */
if (skb->ip_summed == CHECKSUM_PARTIAL)
skb->csum_start += nhead;
@@ -1203,9 +1193,8 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
off = newheadroom - oldheadroom;
if (n->ip_summed == CHECKSUM_PARTIAL)
n->csum_start += off;
-#ifdef NET_SKBUFF_DATA_USES_OFFSET
+
skb_headers_offset_update(n, off);
-#endif
return n;
}
--
1.7.4.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: pass correct parameter to skb_headers_offset_update()
2013-06-06 13:27 [PATCH net-next] net: pass correct parameter to skb_headers_offset_update() Weiping Pan
@ 2013-06-07 6:47 ` Simon Horman
2013-06-11 9:48 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2013-06-07 6:47 UTC (permalink / raw)
To: Weiping Pan; +Cc: netdev
On Thu, Jun 06, 2013 at 09:27:21PM +0800, Weiping Pan wrote:
> Since commit 1a37e412a022(net: Use 16bits for *_headers fields of struct
> skbuff), skb->*_header are relative to skb->head,
> so copy_skb_header() should not call skb_headers_offset_update() now,
> and we should pass correct parameter to skb_headers_offset_update() in
> pskb_expand_head() and skb_copy_expand().
>
> Signed-off-by: Weiping Pan <panweiping3@gmail.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
> ---
> net/core/skbuff.c | 15 ++-------------
> 1 files changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 73f57a0..30a1b56 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -905,18 +905,8 @@ static void skb_headers_offset_update(struct sk_buff *skb, int off)
>
> static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
> {
> -#ifndef NET_SKBUFF_DATA_USES_OFFSET
> - /*
> - * Shift between the two data areas in bytes
> - */
> - unsigned long offset = new->data - old->data;
> -#endif
> -
> __copy_skb_header(new, old);
>
> -#ifndef NET_SKBUFF_DATA_USES_OFFSET
> - skb_headers_offset_update(new, offset);
> -#endif
> skb_shinfo(new)->gso_size = skb_shinfo(old)->gso_size;
> skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs;
> skb_shinfo(new)->gso_type = skb_shinfo(old)->gso_type;
> @@ -1108,7 +1098,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
> skb->end = skb->head + size;
> #endif
> skb->tail += off;
> - skb_headers_offset_update(skb, off);
> + skb_headers_offset_update(skb, nhead);
> /* Only adjust this if it actually is csum_start rather than csum */
> if (skb->ip_summed == CHECKSUM_PARTIAL)
> skb->csum_start += nhead;
> @@ -1203,9 +1193,8 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
> off = newheadroom - oldheadroom;
> if (n->ip_summed == CHECKSUM_PARTIAL)
> n->csum_start += off;
> -#ifdef NET_SKBUFF_DATA_USES_OFFSET
> +
> skb_headers_offset_update(n, off);
> -#endif
>
> return n;
> }
> --
> 1.7.4.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: pass correct parameter to skb_headers_offset_update()
2013-06-07 6:47 ` Simon Horman
@ 2013-06-11 9:48 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-06-11 9:48 UTC (permalink / raw)
To: horms; +Cc: panweiping3, netdev
From: Simon Horman <horms@verge.net.au>
Date: Fri, 7 Jun 2013 15:47:22 +0900
> On Thu, Jun 06, 2013 at 09:27:21PM +0800, Weiping Pan wrote:
>> Since commit 1a37e412a022(net: Use 16bits for *_headers fields of struct
>> skbuff), skb->*_header are relative to skb->head,
>> so copy_skb_header() should not call skb_headers_offset_update() now,
>> and we should pass correct parameter to skb_headers_offset_update() in
>> pskb_expand_head() and skb_copy_expand().
>>
>> Signed-off-by: Weiping Pan <panweiping3@gmail.com>
>
> Reviewed-by: Simon Horman <horms@verge.net.au>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-11 9:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-06 13:27 [PATCH net-next] net: pass correct parameter to skb_headers_offset_update() Weiping Pan
2013-06-07 6:47 ` Simon Horman
2013-06-11 9:48 ` David Miller
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).