netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: xiyou.wangcong@gmail.com
Cc: kafai@fb.com, netdev@vger.kernel.org, edumazet@google.com,
	weiwan@google.com, kernel-team@fb.com
Subject: Re: [RFC PATCH net 3/4] ipv6: datagram: Update dst cache of a connected datagram sk during pmtu update
Date: Tue, 05 Apr 2016 19:56:54 -0400 (EDT)	[thread overview]
Message-ID: <20160405.195654.681016570979164308.davem@davemloft.net> (raw)
In-Reply-To: <CAM_iQpXV8UrBycmmTn3-FFEoR69OSvc4cWZMGbPnGiHF5aF7Dg@mail.gmail.com>

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Mon, 4 Apr 2016 13:45:02 -0700

> On Sat, Apr 2, 2016 at 7:33 PM, Martin KaFai Lau <kafai@fb.com> wrote:
>> One thing to note is that this patch uses the addresses from the sk
>> instead of iph when updating sk->sk_dst_cache.  It is basically the
>> same logic that the __ip6_datagram_connect() is doing, so some
>> refactoring works in the first two patches.
>>
>> AFAIK, a UDP socket can become connected after sending out some
>> datagrams in un-connected state.  or It can be connected
>> multiple times to different destinations.  I did some quick
>> tests but I could be wrong.
>>
>> I am thinking if there could be a chance that the skb->data, which
>> has the original outgoing iph, is not related to the current
>> connected address.  If it is possible, we have to specifically
>> use the addresses in the sk instead of skb->data (i.e. iph) when
>> updating the sk->sk_dst_cache.
>>
>> If we need to use the sk addresses (and other info) to find out a
>> new dst for a connected udp socket, it is better not doing it while
>> the userland is connecting to somewhere else.
>>
>> If the above case is impossible, we can keep using the info from iph to
>> do the dst update for a connected-udp sk without taking the lock.
> 
> I see your point, but calling __ip6_datagram_connect() seems overkill
> here, we don't need to update so many things in the pmtu update context,
> at least IPv4 doesn't do that either. I don't think you have to do that.
> 
> So why just updating the dst cache (also some addr cache) here is not
> enough?

I think we are steadily getting closer to a version of this fix that
we have some agreement on, right?

Martin can you address Cong's feedback and spin another version of this
series?

Thanks.

  reply	other threads:[~2016-04-05 23:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01 22:56 [RFC PATCH net 0/4] ip6: datagram: Update dst cache of a connected datagram sk during pmtu update Martin KaFai Lau
2016-04-01 22:56 ` [RFC PATCH net 1/4] ipv6: datagram: Refactor flowi6 init codes to a new function Martin KaFai Lau
2016-04-01 22:56 ` [RFC PATCH net 2/4] ipv6: datagram: Refactor dst lookup and update " Martin KaFai Lau
2016-04-01 22:56 ` [RFC PATCH net 3/4] ipv6: datagram: Update dst cache of a connected datagram sk during pmtu update Martin KaFai Lau
2016-04-01 23:13   ` Cong Wang
2016-04-01 23:15     ` Cong Wang
2016-04-03  2:33     ` Martin KaFai Lau
2016-04-04 20:45       ` Cong Wang
2016-04-05 23:56         ` David Miller [this message]
2016-04-11 17:56           ` Martin KaFai Lau
2016-04-06  0:11         ` Martin KaFai Lau
2016-04-06 17:58           ` Cong Wang
2016-04-06 18:49             ` Martin KaFai Lau
2016-04-07 18:37               ` Cong Wang
2016-04-07 19:09                 ` Martin KaFai Lau
2016-04-01 22:56 ` [RFC PATCH net 4/4] ipv6: udp: Do a route lookup and update during release_cb Martin KaFai Lau

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=20160405.195654.681016570979164308.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kafai@fb.com \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=weiwan@google.com \
    --cc=xiyou.wangcong@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).