From: Fan Du <fengyuleidian0615@gmail.com>
To: John Heffner <johnwheffner@gmail.com>
Cc: Fan Du <fan.du@intel.com>, Eric Dumazet <edumazet@google.com>,
David Miller <davem@davemloft.net>,
Netdev <netdev@vger.kernel.org>
Subject: Re: [PATCHv4 net-next 3/3] ipv4: Create probe timer for tcp PMTU as per RFC4821
Date: Wed, 04 Mar 2015 10:11:10 +0800 [thread overview]
Message-ID: <54F669BE.7060706@gmail.com> (raw)
In-Reply-To: <CABrhC0nQcFSkAcMmnJ+fw0nhOGKiebEDnU4P9=nRsn=u16Lotw@mail.gmail.com>
于 2015年03月04日 00:39, John Heffner 写道:
> On Tue, Mar 3, 2015 at 4:19 AM, Fan Du <fan.du@intel.com> wrote:
>> As per RFC4821 7.3. Selecting Probe Size, a probe timer should
>> be armed once probing has converged. Once this timer expired,
>> probing again to take advantage of any path PMTU change. The
>> recommended probing interval is 10 minutes per RFC1981. Probing
>> interval could be sysctled by sysctl_tcp_probe_interval.
>>
>> Eric Dumazet suggested to implement pseudo timer based on 32bits
>> jiffies tcp_time_stamp instead of using classic timer for such
>> rare event.
>>
>> Signed-off-by: Fan Du <fan.du@intel.com>
>
>> @@ -1823,6 +1825,31 @@ send_now:
>> return false;
>> }
>>
>> +static inline void tcp_mtu_check_reprobe(struct sock *sk)
>> +{
>> + struct inet_connection_sock *icsk = inet_csk(sk);
>> + struct tcp_sock *tp = tcp_sk(sk);
>> + struct net *net = sock_net(sk);
>> + u32 interval;
>> + s32 delta;
>> +
>> + interval = net->ipv4.sysctl_tcp_probe_interval;
>> + delta = tcp_time_stamp - icsk->icsk_mtup.probe_timestamp;
>> + if (unlikely(delta >= interval * HZ)) {
>> + int mss = tcp_current_mss(sk);
>> +
>> + /* Update current search range */
>> + icsk->icsk_mtup.search_high = tp->rx_opt.mss_clamp +
>> + sizeof(struct tcphdr) +
>> + icsk->icsk_af_ops->net_header_len;
>> + icsk->icsk_mtup.search_low = tcp_mss_to_mtu(sk, mss);
>> + icsk->icsk_mtup.probe_size = 0;
>> +
>> + /* Update probe time stamp */
>> + icsk->icsk_mtup.probe_timestamp = tcp_time_stamp;
>> + }
>> +}
>> +
>> /* Create a new MTU probe if we are ready.
>> * MTU probe is regularly attempting to increase the path MTU by
>> * deliberately sending larger packets. This discovers routing
>
> I think the only update to the search range required here is
> potentially moving search_high upward. Touching search_low seems
> unnecessary,
No.
If you restoring search_low to its original, the first probe will probably
be no better than using current mss, because current mss is working good,
there may be better mss between mtu(current mss) and search_high. Reprobing
from search_low to search_high is definitely not worth the effort.
> and probe_size better be zero when executing this anyway.
> (We don't want to be changing the state while a probe is in flight.)
Good point.
probe size should be set to zero frist, then update search range to keep
state consistent.
>
>
>> @@ -1866,8 +1893,11 @@ static int tcp_mtu_probe(struct sock *sk)
>> size_needed = probe_size + (tp->reordering + 1) * tp->mss_cache;
>> interval = icsk->icsk_mtup.search_high - icsk->icsk_mtup.search_low;
>> if (probe_size > tcp_mtu_to_mss(sk, icsk->icsk_mtup.search_high) ||
>> - interval < max(1, net->ipv4.sysctl_tcp_probe_threshold)) {
>> - /* TODO: set timer for probe_converge_event */
>> + interval < net->ipv4.sysctl_tcp_probe_threshold) {
>> + /* Check whether enough time has elaplased for
>> + * another round of probing.
>> + */
>> + tcp_mtu_check_reprobe(sk);
>> return -1;
>> }
>
> The way this check works, I think putting it here may not be exactly
> what we want. The comment was to set a timer here, but that's not
> exactly what tcp_mtu_check_reprobe does. Since it may update the
> search range, I think it would be better to call prior to comparing
> the candidate probe_size to search_high.
Semantically speaking, reprobe checking should be placed inside where
a decision to not probe has been made, reprobing from a stable state ;)
If we moving the reporobe checking outside, current probing may be legal,
but the reprobe check will rule it out.
So I don't see any compelling reason to move the reprobe checking outside.
> Thanks,
> -John
>
next prev parent reply other threads:[~2015-03-04 2:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 9:19 [PATCHv4 net-next 0/3] Improvements for TCP PMTU Fan Du
2015-03-03 9:19 ` [PATCHv4 net-next 1/3] ipv4: Raise tcp PMTU probe mss base size Fan Du
2015-03-03 16:52 ` John Heffner
2015-03-03 9:19 ` [PATCHv4 net-next 2/3] ipv4: Use binary search to choose tcp PMTU probe_size Fan Du
2015-03-03 16:51 ` John Heffner
2015-03-04 13:39 ` John Heffner
2015-03-05 2:36 ` Fan Du
2015-03-03 9:19 ` [PATCHv4 net-next 3/3] ipv4: Create probe timer for tcp PMTU as per RFC4821 Fan Du
2015-03-03 16:39 ` John Heffner
2015-03-04 2:11 ` Fan Du [this message]
2015-03-04 13:26 ` John Heffner
2015-03-05 2:36 ` Fan Du
2015-03-03 16:43 ` [PATCHv4 net-next 0/3] Improvements for TCP PMTU John Heffner
2015-03-04 2:12 ` Fan Du
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=54F669BE.7060706@gmail.com \
--to=fengyuleidian0615@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fan.du@intel.com \
--cc=johnwheffner@gmail.com \
--cc=netdev@vger.kernel.org \
/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).