[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0e8fff74-b9a8-8ec8-71f6-4745fc82dd4b@gmail.com>
Date:   Wed, 20 Oct 2021 09:14:26 -0700
From:   Eric Dumazet <eric.dumazet@...il.com>
To:     Vasily Averin <vvs@...tuozzo.com>,
        Eric Dumazet <eric.dumazet@...il.com>,
        Jakub Kicinski <kuba@...nel.org>
Cc:     netdev <netdev@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        David Ahern <dsahern@...nel.org>,
        Julian Wiedmann <jwi@...ux.ibm.com>,
        Christoph Paasch <christoph.paasch@...il.com>,
        linux-kernel@...r.kernel.org, kernel@...nvz.org
Subject: Re: [PATCH net v9] skb_expand_head() adjust skb->truesize incorrectly
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.
Powered by blists - more mailing lists