From patchwork Thu Jun 24 15:48:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 12342487 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D35EC49EA6 for ; Thu, 24 Jun 2021 15:48:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83301613B1 for ; Thu, 24 Jun 2021 15:48:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232358AbhFXPue (ORCPT ); Thu, 24 Jun 2021 11:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230087AbhFXPud (ORCPT ); Thu, 24 Jun 2021 11:50:33 -0400 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C739C061574; Thu, 24 Jun 2021 08:48:14 -0700 (PDT) Received: by mail-qk1-x72e.google.com with SMTP id e1so3644970qkm.3; Thu, 24 Jun 2021 08:48:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1A6cREIjspxX7ad+SljIeeKbqeAgevQspLlsQyDabSo=; b=WRnty9N7Uwax9oydIoAFHn1+DFeYiAeBxL9M81nQZqPGhwZa9ztsa2DuLeWhddfCBI Io2UZKK8uP9pU67OhC5cQkkr03du3MheWA2At7PJMrRo+O5FI149GPi2cKI7OLDPMU39 pp69uoXgWVwqPdIc4VnMe74/oBe8fB1PvOEsc6+pGRnvngVDx3052mNVhD6laljIzhBr xWzqczcEU4jmOPcmHUgCssF6SoDwlY/zDhaAEfmBPBd9eHNFislZccNigb/g6/0olvn2 jkETGQlIpLHjh5V2kuGoKOiKCDUSDYAa5Jx+VazLyR2AgsUxX8jEUK+wUiF96Wq+9WbL FgXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1A6cREIjspxX7ad+SljIeeKbqeAgevQspLlsQyDabSo=; b=IiRGy0SHFATxLosU6ypYSlEG6zE5DWONlS49EKVmPbtwNH4zgzHI482m7aB9dnL4T7 gE2/tBwtZ82hJLkSQWCss4WgS+fYXBjdeAQDhBQTEHfN58J6rPWXBn7mGvygvvK0wCi3 MQBNmFSRF0WHg21CNjaB620uEgVix8A+rMiN47dzCh7Z5vbepIroCztd6LjexBhXE83W uSEyPztGukn7Yl8p9nogfzH3cl7fpCx1GqSw67iRQrBInfRFroBwANWYlKXQbIWRwDUj LWTk03kDlKIU4SA3qaetqzDWoNW39e/IjckeP9XAeeFqQr2qtBHKO1VvKvxV/PIZA1P3 Dpyg== X-Gm-Message-State: AOAM531diERE2NZGPsU9GRmJcOWGrGPocaQw43GF1qsm6HspmTfMCx3W MIvjOJL/40Iu1AYEUWJQgMLM0wqq3oRmIw== X-Google-Smtp-Source: ABdhPJxesQUpvn2G8hQ+Rlqe5uOlaViSuuqS/oG1VGWNl93AAKQuuf7salhQYPP70U/LDLSW9DYLxQ== X-Received: by 2002:a37:9306:: with SMTP id v6mr6452926qkd.476.1624549693087; Thu, 24 Jun 2021 08:48:13 -0700 (PDT) Received: from localhost (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id w22sm2070682qta.55.2021.06.24.08.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 08:48:12 -0700 (PDT) From: Xin Long To: network dev , davem@davemloft.net, kuba@kernel.org, Marcelo Ricardo Leitner , linux-sctp@vger.kernel.org Cc: David Laight Subject: [PATCH net-next 1/2] sctp: do black hole detection in search complete state Date: Thu, 24 Jun 2021 11:48:08 -0400 Message-Id: <08344e5d9b0eb31c1b777f44cd1b95ecdde5a3d6.1624549642.git.lucien.xin@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Currently the PLPMUTD probe will stop for a long period (interval * 30) after it enters search complete state. If there's a pmtu change on the route path, it takes a long time to be aware if the ICMP TooBig packet is lost or filtered. As it says in rfc8899#section-4.3: "A DPLPMTUD method MUST NOT rely solely on this method." (ICMP PTB message). This patch is to enable the other method for search complete state: "A PL can use the DPLPMTUD probing mechanism to periodically generate probe packets of the size of the current PLPMTU." With this patch, the probe will continue with the current pmtu every 'interval' until the PMTU_RAISE_TIMER 'timeout', which we implement by adding raise_count to raise the probe size when it counts to 30 and removing the SCTP_PL_COMPLETE check for PMTU_RAISE_TIMER. Signed-off-by: Xin Long --- include/net/sctp/structs.h | 3 ++- net/sctp/transport.c | 11 ++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 9eaa701cda23..c4a4c1754be8 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -987,7 +987,8 @@ struct sctp_transport { __u16 pmtu; __u16 probe_size; __u16 probe_high; - __u8 probe_count; + __u8 probe_count:3; + __u8 raise_count:5; __u8 state; } pl; /* plpmtud related */ diff --git a/net/sctp/transport.c b/net/sctp/transport.c index f27b856ea8ce..5f23804f21c7 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c @@ -213,15 +213,10 @@ void sctp_transport_reset_reconf_timer(struct sctp_transport *transport) void sctp_transport_reset_probe_timer(struct sctp_transport *transport) { - int scale = 1; - if (timer_pending(&transport->probe_timer)) return; - if (transport->pl.state == SCTP_PL_COMPLETE && - transport->pl.probe_count == 1) - scale = 30; /* works as PMTU_RAISE_TIMER */ if (!mod_timer(&transport->probe_timer, - jiffies + transport->probe_interval * scale)) + jiffies + transport->probe_interval)) sctp_transport_hold(transport); } @@ -333,13 +328,15 @@ void sctp_transport_pl_recv(struct sctp_transport *t) t->pl.probe_size += SCTP_PL_MIN_STEP; if (t->pl.probe_size >= t->pl.probe_high) { t->pl.probe_high = 0; + t->pl.raise_count = 0; t->pl.state = SCTP_PL_COMPLETE; /* Search -> Search Complete */ t->pl.probe_size = t->pl.pmtu; t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); sctp_assoc_sync_pmtu(t->asoc); } - } else if (t->pl.state == SCTP_PL_COMPLETE) { + } else if (t->pl.state == SCTP_PL_COMPLETE && ++t->pl.raise_count == 30) { + /* Raise probe_size again after 30 * interval in Search Complete */ t->pl.state = SCTP_PL_SEARCH; /* Search Complete -> Search */ t->pl.probe_size += SCTP_PL_MIN_STEP; } From patchwork Thu Jun 24 15:48:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 12342489 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A544C49EA7 for ; Thu, 24 Jun 2021 15:48:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 71E69613CE for ; Thu, 24 Jun 2021 15:48:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232422AbhFXPug (ORCPT ); Thu, 24 Jun 2021 11:50:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232370AbhFXPuf (ORCPT ); Thu, 24 Jun 2021 11:50:35 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF092C061574; Thu, 24 Jun 2021 08:48:15 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id b3so4476676qtq.6; Thu, 24 Jun 2021 08:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UU6DtDGiyA1vWHeojTVbBhsXsciQ4zbhSh2JaptoGlM=; b=SRlxey+oYCINUn9G4HTTJ0AqS9LuZVHwhL4xuNDscS4VmSHXTt406Pa3rUHVuTVs2F ZNVZo2onwQ/nMo47SnpFXpv3ZLulKvxgYcL38t18JJWNhmF1yoCK2T1LPBjDOScf19Vt qOjjLiidSwtRPpxfcPFuoaIcVF43HP2j3KdHj9OEP+osi0HpeqxgEtqFY3smFl/9jjIa pF3RqEEI2bm6Omznd7d9RwdK8CpER0WUoffsF6LV8pLozFjwOjB0rM5gcfFYJQjVGy+p w28ortidm4ra8bJCAT9S/dEHvp78ZiKY1EC6mX5lelvoWIoc79ZrFKgj9pEBRaVcROlD j/bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UU6DtDGiyA1vWHeojTVbBhsXsciQ4zbhSh2JaptoGlM=; b=sZUmio3Bd7zgY+x7CXC2+pNA2IfLZxpr9LdMUzhuH95NEkIm5fPKwZWAl+Nop7a3ie R1xFpf0rgeDaIdLpnbobR7cO/QY9WKOsHUpwTSOXF5ABvy2kE/VbljoN8iomDKvfAJYX AZm7yKJK0lC1ZJdwDYJkSHe0meDnjQNO+wj6fOQydXYWP0mxU6WcR+YWkpXt32g8iRGI yEO3fGqnX2Zf0IXpTnwWbhICNuWqaicdf+XAhWrhTJstMP023a56ubj2yAulfxBFKw0W t8uA2kWnRecCZ4+90zEnAbObkPpXgvjPHB8d1NCL3QFDje6M9/vsqcfMf9xn92HWrVwR HVJA== X-Gm-Message-State: AOAM5326SdDC87bQ+zgm/3NlVkBbTfKhqFihd/xoeMtqCjAcwdPnT+qL ngVgr7zwBR/0wBZwtDsrC2CO81KqKjjI7Q== X-Google-Smtp-Source: ABdhPJy+QqFZolzb9n224yoPQj9aU2hzd5auCxa0gGci1GSUMuvTgjhCr+G2oomQL8CSqmbew2rPIA== X-Received: by 2002:ac8:4a18:: with SMTP id x24mr5262672qtq.239.1624549694864; Thu, 24 Jun 2021 08:48:14 -0700 (PDT) Received: from localhost (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id j4sm2179897qtr.72.2021.06.24.08.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 08:48:14 -0700 (PDT) From: Xin Long To: network dev , davem@davemloft.net, kuba@kernel.org, Marcelo Ricardo Leitner , linux-sctp@vger.kernel.org Cc: David Laight Subject: [PATCH net-next 2/2] sctp: send the next probe immediately once the last one is acked Date: Thu, 24 Jun 2021 11:48:09 -0400 Message-Id: <5ef97ff6f95741bde34124e4d4aed8c32bde0ff5.1624549642.git.lucien.xin@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org These is no need to wait for 'interval' period for the next probe if the last probe is already acked in search state. The 'interval' period waiting should be only for probe failure timeout and the current pmtu check when it's in search complete state. This change will shorten the probe time a lot in search state, and also fix the document accordingly. Signed-off-by: Xin Long --- Documentation/networking/ip-sysctl.rst | 12 ++++++++---- net/sctp/sm_statefuns.c | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Documentation/networking/ip-sysctl.rst b/Documentation/networking/ip-sysctl.rst index 8bff728b3a1e..b3fa522e4cd9 100644 --- a/Documentation/networking/ip-sysctl.rst +++ b/Documentation/networking/ip-sysctl.rst @@ -2835,10 +2835,14 @@ encap_port - INTEGER Default: 0 plpmtud_probe_interval - INTEGER - The time interval (in milliseconds) for sending PLPMTUD probe chunks. - These chunks are sent at the specified interval with a variable size - to probe the mtu of a given path between 2 endpoints. PLPMTUD will - be disabled when 0 is set, and other values for it must be >= 5000. + The time interval (in milliseconds) for the PLPMTUD probe timer, + which is configured to expire after this period to receive an + acknowledgment to a probe packet. This is also the time interval + between the probes for the current pmtu when the probe search + is done. + + PLPMTUD will be disabled when 0 is set, and other values for it + must be >= 5000. Default: 0 diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index d29b579da904..09a8f23ec709 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -1275,7 +1275,10 @@ enum sctp_disposition sctp_sf_backbeat_8_3(struct net *net, return SCTP_DISPOSITION_DISCARD; sctp_transport_pl_recv(link); - return SCTP_DISPOSITION_CONSUME; + if (link->pl.state == SCTP_PL_COMPLETE) + return SCTP_DISPOSITION_CONSUME; + + return sctp_sf_send_probe(net, ep, asoc, type, link, commands); } max_interval = link->hbinterval + link->rto;