From patchwork Sat Jun 26 02:40:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 12346093 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 A9E14C48BC2 for ; Sat, 26 Jun 2021 02:41:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9648A61490 for ; Sat, 26 Jun 2021 02:41:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229991AbhFZCnY (ORCPT ); Fri, 25 Jun 2021 22:43:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbhFZCnX (ORCPT ); Fri, 25 Jun 2021 22:43:23 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB0A0C061574; Fri, 25 Jun 2021 19:41:00 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id j1so12702411wrn.9; Fri, 25 Jun 2021 19:41:00 -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=iax7V+cUkox0wCx4k1np3PJhyC2u9ogpcAk3Z9ZACb4=; b=iJRfcDQiN86jkHJ9TXpR0lbQH7VR7KVitBHdgwkbauN9jTa5eFLM1cVOkeUmJoh7ss lmLY2aeS287VeSVkmXJNdyKGv3xgVjpLp8H4G6h7NcLez+dcPo2gYZkTtCtU5JFBCDAc GhvKHmBaL6gLc8K+58vNksgfOuNgoeVD21MfCtpiBU05qoWE0/mHjdMiVTnyb2z+vRdl U7H+AKwHo3XbnF07U4x4pjLCMpeJoFf6RzQbAMdwEHBDiN2TwFOoulDDCyL2lHhrBElw Gvuz23j0UCGkrsSwSAz0RUclWyRkHCCzTbL6J5m9fG/BZUKzW9BQCL4/OyOCahy40VaE qcXw== 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=iax7V+cUkox0wCx4k1np3PJhyC2u9ogpcAk3Z9ZACb4=; b=Grtft41J19r16vIMo1v7oPngKT3t/uS2cbVEiGLrcE3B6odDW2F3eithSGcAiX/MlA KCE9nep+fJgpLOreIA0oUpgGDisyL9C0DooZl7AZ9hH7sEB0Q39+HzZWIeLA55k94u4E o+fFldaILauissU8iIdT98ZNPOfaOvkOTfS9SfNPNJE/+c2A9Q8i6GwKgPmd1ETpMWkf JvR9qMrgCqhcm75MJ3PHbQjLsuFSPOKOO6s8jlVHWW9sVVXawmH35cg9W6n45I3kChoG 3IhDa1HOC9qbMWgI7d9zfZpvCymgtz9RCD3dwBc5oNmM/vLUOrn/LaUJa5tW24cEYx3y F2sA== X-Gm-Message-State: AOAM533hkHjGXZ4mab2aCITBXqEMDT41ZnpU3+4RlboP2PZIMBlaIIlb SvE91iwycuSM0FgCDQJS04MWBBYU1bQqjA== X-Google-Smtp-Source: ABdhPJy9NhSr5OzAjyXRde2J7y7VSZ/rqTRRUlwQghcSXWLmUo0ACJsfQVMFky2AzfiejLDdrABzYA== X-Received: by 2002:adf:ee4e:: with SMTP id w14mr14808367wro.108.1624675259330; Fri, 25 Jun 2021 19:40:59 -0700 (PDT) Received: from localhost (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id n16sm7414732wrx.85.2021.06.25.19.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 19:40:59 -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: [PATCHv2 net-next 1/2] sctp: do black hole detection in search complete state Date: Fri, 25 Jun 2021 22:40:54 -0400 Message-Id: <1d298cde5971e080b56fb7aad24805b6812eb2f0.1624675179.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. v1->v2: - do t->pl.raise_count++ and t->pl.raise_count check separately, as Marcelo suggested. Signed-off-by: Xin Long --- include/net/sctp/structs.h | 3 ++- net/sctp/transport.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 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..397a6244dd97 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,6 +328,7 @@ 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; @@ -340,8 +336,12 @@ void sctp_transport_pl_recv(struct sctp_transport *t) sctp_assoc_sync_pmtu(t->asoc); } } else if (t->pl.state == SCTP_PL_COMPLETE) { - t->pl.state = SCTP_PL_SEARCH; /* Search Complete -> Search */ - t->pl.probe_size += SCTP_PL_MIN_STEP; + t->pl.raise_count++; + if (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 Sat Jun 26 02:40:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 12346095 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 277D6C49EAB for ; Sat, 26 Jun 2021 02:41:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DBE061973 for ; Sat, 26 Jun 2021 02:41:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230014AbhFZCn0 (ORCPT ); Fri, 25 Jun 2021 22:43:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230001AbhFZCnZ (ORCPT ); Fri, 25 Jun 2021 22:43:25 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D01FC061574; Fri, 25 Jun 2021 19:41:02 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id u11so12698496wrw.11; Fri, 25 Jun 2021 19:41:02 -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=F8zwdD98RmyMrdOnZJfAllkLtp9ONn2LICEEp4xTbn9dJ0FAf6G10O/Y6xaShcbdH4 fowt8s4SgFTJy9sYysQ9D7/DnLsSn1FFfX1QaVgazX6oWuh3lk0B/kkjA/LGLHmSUNFM DfNIuoIy+mdi+eq3j27J0gDAhaO42Sl44VGEdgeL2kpDCmR2JZWzxFAsMDB9k1KJqtLJ OLqDDtCXqoVSybXalKkRiA1+1+8fdThftGMZpuaySWDju8ct00kqCqZ/OkQXHy7FxNhQ vDSYwNrk6NSD2DSmwDRgAHFDvNT4JvR1s+ByXB8ZHP3USWn21ga6OEcmE/dg7lSf1NP7 z9Mg== 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=gQCRiMeSs2d5I0g6QGO0tgDabdWjBXhxSL7JqCyVEdgwN/oswxjYHqZbjT71XUmoMc jVlZ+umVuE7GHP1AMGjIfBAHafDjZ6E75Y+IyMF1Tftsuz8GOu4dBwWTuX0ftbncfq7F Ofl28iEy/d1K09IbhRxCXO0Gn20kD0FcdqVwosrQZ0GKdpM7kuxHuQSDXSv8zCruEew8 pqH5pdHz/Jj86nmp245rOe7sgHcbCno38E+0vVStEbdxwXc/8bsNtBUVGEWsjIXf2gmd uZjRdlCo760iMZukK67MCXIQHCq5l5DrdZcrNqP2jfuSGJaR8jzm/2uKORPJdR/xlctw 5/2A== X-Gm-Message-State: AOAM532Z8cinLiaQn51TkM84FUTG04fb8W5vPkinnDCZvIacSfMVhR7a uqYZF4sQVuNlw6yQMwRQSeszCCoJXhv+lQ== X-Google-Smtp-Source: ABdhPJwTbufVLCPjPBiMAKL+ikWjTS2sfT7BYhtccZQzg0Xqa4Xg6LecFRSjMlHv2mI7ghmtqcPahg== X-Received: by 2002:a5d:42c2:: with SMTP id t2mr15150866wrr.382.1624675261145; Fri, 25 Jun 2021 19:41:01 -0700 (PDT) Received: from localhost (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id p13sm6005425wrx.30.2021.06.25.19.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 19:41:00 -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: [PATCHv2 net-next 2/2] sctp: send the next probe immediately once the last one is acked Date: Fri, 25 Jun 2021 22:40:55 -0400 Message-Id: <8b14c16d4300761026bf694cc2384b49d0d94c5b.1624675179.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;