On 07/24/2014 10:42 PM, Alexander Aring wrote:
>
>>>>>> return NETDEV_TX_OK;
>>>>>> }
>>>>>> - work = kzalloc(sizeof(struct xmit_work), GFP_ATOMIC);
>>>>>> + work = kzalloc(sizeof(*work), GFP_ATOMIC);
>>>>>> if (!work) {
>>>>>> - kfree_skb(skb);
>>>>>> + dev_kfree_skb(skb);
>>>>>> return NETDEV_TX_BUSY;
>>>>>> }
>>>>> Sorry this is wrong. dev_kfree_skb is the same like consume_skb.
>>>>>
>>>>> Look for the documentation:
>>>>>
>>>>> "Drop a ref to the buffer and free it if the usage count has hit zero
>>>>> Functions identically to kfree_skb, but kfree_skb assumes that the frame
>>>>> is being dropped after a failure and notes that"
>>>> This type of functionality use on IEEE-80211 subsystem also.. Every where
>>>> on Tx
>>>> error path subsystem uses dev_kfree_skb(skb);
>>>>
>>> mhh, maybe we could clear this. Can you give a link with an example
>>> where they do this?
>> Please see: http://lxr.free-electrons.com/source/net/mac80211/tx.c#L2218
>> <http://lxr.free-electrons.com/source/net/mac80211/tx.c#L2218>
> I think this is because "... but kfree_skb assumes that the frame is
> being dropped after a failure and notes that". It's dropped afterwards,
> then we need kfree_skb.
>
>
>
> But ieee80211_subif_start_xmit the skb is not dropped afterwards. The function
> comment is:
>
> Returns: 0 on success (and frees skb in this case) or 1 on failure (skb will
> not be freed, and caller is responsible for either retrying later or freeing
> skb).
>
> In this case the skb is not dropped, it's laying around and the caller can do
> a
> retry or free the skb, then it's dropped.
>
>
> And I compared the two functions, it looks almost the same except the trace
> calls
> which is for some function tracing, I think.
can i drop this patch then...?
Thanks...
--
Regards,
Varka Bhadram.
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Linux-zigbee-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel