lkml.org 
[lkml]   [2021]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net v9] skb_expand_head() adjust skb->truesize incorrectly
From
Date


On 10/4/21 10:57 PM, Vasily Averin wrote:

>>>
>>> diff --git a/net/core/sock.c b/net/core/sock.c
>>> index 62627e868e03..1932755ae9ba 100644
>>> --- a/net/core/sock.c
>>> +++ b/net/core/sock.c
>>> @@ -2227,6 +2227,14 @@ void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
>>> }
>>> EXPORT_SYMBOL(skb_set_owner_w);
>>>
>>> +bool is_skb_wmem(const struct sk_buff *skb)
>>> +{
>>> + return skb->destructor == sock_wfree ||
>>> + skb->destructor == __sock_wfree ||
>>> + (IS_ENABLED(CONFIG_INET) && skb->destructor == tcp_wfree);
>>> +}
>>> +EXPORT_SYMBOL(is_skb_wmem);
>>> +
>>
>> This probably should be inlined.
>
> David Miller pointed me out in the comments to an early version of the patch
> "Please do not use inline in foo.c files, let the compiler decide."
>

Sure, my suggestion was to move this helper in an include file,
and use

static inline bool ....

I would not suggest add an inline in a C file, unless absolutely critical.

\
 
 \ /
  Last update: 2021-10-20 18:14    [W:0.088 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site