Re: [PATCH v14 06/17] Use callback to deal with skb_release_data()specially.

From: Eric Dumazet
Date: Thu Nov 04 2010 - 05:07:54 EST


Le jeudi 04 novembre 2010 Ã 10:04 +0100, Eric Dumazet a Ãcrit :

> Hmm, I suggest you read the comment two lines above.
>
> If destructor_arg is now cleared each time we allocate a new skb, then,
> please move it before dataref in shinfo structure, so that the following
> memset() does the job efficiently...


Something like :

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index e6ba898..2dca504 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -195,6 +195,9 @@ struct skb_shared_info {
__be32 ip6_frag_id;
__u8 tx_flags;
struct sk_buff *frag_list;
+ /* Intermediate layers must ensure that destructor_arg
+ * remains valid until skb destructor */
+ void *destructor_arg;
struct skb_shared_hwtstamps hwtstamps;

/*
@@ -202,9 +205,6 @@ struct skb_shared_info {
*/
atomic_t dataref;

- /* Intermediate layers must ensure that destructor_arg
- * remains valid until skb destructor */
- void * destructor_arg;
/* must be last field, see pskb_expand_head() */
skb_frag_t frags[MAX_SKB_FRAGS];
};



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/