All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antoine Tenart <atenart@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>, davem@davemloft.net, kuba@kernel.org
Cc: netdev@vger.kernel.org, vladbu@nvidia.com, pshelar@ovn.org
Subject: Re: [PATCH net 1/2] net: do not keep the dst cache when uncloning an skb dst and its metadata
Date: Wed, 02 Feb 2022 15:29:10 +0100	[thread overview]
Message-ID: <164381215019.380114.11003803249824068036@kwain> (raw)
In-Reply-To: <c699ed79feb4f86f02e882597bffd8c91782d573.camel@redhat.com>

Quoting Paolo Abeni (2022-02-02 15:24:51)
> On Wed, 2022-02-02 at 12:01 +0100, Antoine Tenart wrote:
> >       memcpy(&new_md->u.tun_info, &md_dst->u.tun_info,
> >              sizeof(struct ip_tunnel_info) + md_size);
> > +#ifdef CONFIG_DST_CACHE
> > +     ret = dst_cache_init(&new_md->u.tun_info.dst_cache, GFP_ATOMIC);
> > +     if (ret) {
> > +             /* We can't call metadata_dst_free directly as the still shared
> > +              * dst cache would be released.
> > +              */
> > +             kfree(new_md);
> 
> I think here you can use metadata_dst_free(): if dst_cache_init fails,
> the dst_cache will be zeroed.

You're right, I'll use it in v2.

Thanks!
Antoine

  reply	other threads:[~2022-02-02 14:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02 11:01 [PATCH net 0/2] net: fix issues when uncloning an skb dst+metadata Antoine Tenart
2022-02-02 11:01 ` [PATCH net 1/2] net: do not keep the dst cache when uncloning an skb dst and its metadata Antoine Tenart
2022-02-02 11:17   ` Antoine Tenart
2022-02-02 12:13   ` Daniel Borkmann
2022-02-02 13:44     ` Antoine Tenart
2022-02-04 12:33       ` Daniel Borkmann
2022-02-04 16:19         ` Antoine Tenart
2022-02-02 14:24   ` Paolo Abeni
2022-02-02 14:29     ` Antoine Tenart [this message]
2022-02-02 11:01 ` [PATCH net 2/2] net: fix a memleak " Antoine Tenart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=164381215019.380114.11003803249824068036@kwain \
    --to=atenart@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pshelar@ovn.org \
    --cc=vladbu@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.