On Mon, Oct 13, 2014 at 10:28:44AM +0100, Martin Townsend wrote: ... > >> If it's ok with everyone I'll change pskb_expand_head to skb_cow or skb_cow_head and leave the bluetooth code as it is with this v5 patch. > > For me it's confusing, you do that on skb, but we never used skb > > afterwards (maybe on freeing) but we use local_skb, the local_skb should > > always be cloned because we running skb_clone before. > skb_clone does ensure that the skb isn't shared anymore so I think it will be safe to remove the skb_share_check. Or I can move it to the start of the function like we do for 802.15.4? We need to clarify the following points: skb_is_shared: It's used twice in some packet handler functions or elsewhere. now a skb_clone: A skb clone is only a copy of struct sk_buff, so we can safely run skb_pull and skb_push, skb->dev = foo. Simple for modify skb attributes. now a skb_copy: It's a complete private copy with private data buffer which allow us to make skb->data[#] = foobar; Now skb_share_check do: if skb_is_shared true, then make a clone. This doesn't allow to manipulate the data, but skb_cow make a copy of the private data so this is okay for IPHC call. Means after skb_cow, we have something like skb_copy, but skb_cow should be faster. ;-) Also skb_share_check checks if skb_is_shared is false, then we don't need a skb_clone, because it's not shared, then we are allow to manipulate skb attributes, because nobody else use it. I would add skb_share_check at beginning of this function like 802.15.4 but the IPV6 DISPATCH of bluetooth do a complete copy of the data buffer which seems not necessary, but this is another issue and maybe I think that the IPV6 DISPATCH value isn't needed by bluetooth 6lowpan. <-- But I am not sure about this. I also can't see that bluetooth 6lowpan runs skb_pull for the one byte dispatch value. Jukka need to check that, if he has time and feel like to doing it. - Alex -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html