From patchwork Thu Oct 28 09:36:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 12589653 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DC1BC433EF for ; Thu, 28 Oct 2021 09:36:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54C5F60D43 for ; Thu, 28 Oct 2021 09:36:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230123AbhJ1JjN (ORCPT ); Thu, 28 Oct 2021 05:39:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbhJ1JjM (ORCPT ); Thu, 28 Oct 2021 05:39:12 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BB25C061570; Thu, 28 Oct 2021 02:36:45 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id g10so22007674edj.1; Thu, 28 Oct 2021 02:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MagIzwlMg0pBulaBVZB5v/rWaq1H9cpvWyZ+olzH6Z0=; b=Ua6RxpR5CNPz52SoqpgOfnSGwgK4Yrv9S2CfeQcPHK610CIgS09JTTKDLxH1OCxDq5 O6nQlyUA1TWq2g1cjVyinEHu3b0+q03TrbA1Q8haj6lAmr0qktzV7UI7DPS+/T9yfDo1 DSU2d+yj6Tb86kKR+F1Td+Pgd71TmX2+VcwhjslYFduWTn8abol/kO6kvDZ2upTgoVXR WT3OXsIKOtmXH1G897sqSPN6qf5geNIDQ5Lbjb5TYfkczFJ5BSO+MKE/CgqbS8ZxAsf2 NqDFLcPkWimIkMN7Y/+gqqSkTRbUAydL9xgGi0H2vTtyEjEUqC0FMUDJjWVK5lVNcdr1 nL1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MagIzwlMg0pBulaBVZB5v/rWaq1H9cpvWyZ+olzH6Z0=; b=uhOxHhrr23Q5MQyx9Ykv4Z+ZB5ycbZDgWI1Ugm1Hp1fuxXBcvaf98zUUej+X4MbD3L SrYDNYJCq21sYgDpaV2ay0ELLsUwqMIeiDL6ZOkRUIABgQLJdAWa71ZtCsOfVwE3gfbN FJqybx8donFrYIIgf/omIcraRlYhk2rvFLt0DQq1drbtvKTgN4gxcD6EKt5F+ohY0Qu0 fmAJbs4GIP6LDw6G9AXvh74bwII1jwYoFcSQlpH/jnDFtEoNA9j56qSuUQpnHAq2V3dZ c4DNUI1G4LZ8POVTRAkMBm0MsA8BQGN8bow75GIph28t6Bl2aXuTzBtIGudjD4BUXk4p ayFg== X-Gm-Message-State: AOAM5338mC2v8XCsHbvrxaB6tYY8Y6Peed63Fx8PqUkhLjTZcOhXzb4Y VFmmxsJIGeK3UNAGYma1f/fyWpVG4qARfQ== X-Google-Smtp-Source: ABdhPJzm8c9jtrBZWjbKeRSFYn1DdeDdHyx6SlYUtqyyTtZr6OR8QdBbURRzgeuNxKOKgftAKDwCWw== X-Received: by 2002:a05:6402:d0a:: with SMTP id eb10mr4611796edb.292.1635413803999; Thu, 28 Oct 2021 02:36:43 -0700 (PDT) Received: from wsfd-netdev15.ntdv.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id s12sm1379865edc.48.2021.10.28.02.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 02:36:43 -0700 (PDT) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, Marcelo Ricardo Leitner Subject: [PATCH net 1/4] sctp: allow IP fragmentation when PLPMTUD enters Error state Date: Thu, 28 Oct 2021 05:36:01 -0400 Message-Id: <8a59f3bd9d43063f77c7b8db88f6722be44c6034.1635413715.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 when PLPMTUD enters Error state, transport pathmtu will be set to MIN_PLPMTU(512) while probe is continuing with BASE_PLPMTU(1200). It will cause pathmtu to stay in a very small value, even if the real pmtu is some value like 1000. RFC8899 doesn't clearly say how to set the value in Error state. But one possibility could be keep using BASE_PLPMTU for the real pmtu, but allow to do IP fragmentation when it's in Error state. As it says in rfc8899#section-5.4: Some paths could be unable to sustain packets of the BASE_PLPMTU size. The Error State could be implemented to provide robustness to such paths. This allows fallback to a smaller than desired PLPMTU rather than suffer connectivity failure. This could utilize methods such as endpoint IP fragmentation to enable the PL sender to communicate using packets smaller than the BASE_PLPMTU. This patch is to set pmtu to BASE_PLPMTU instead of MIN_PLPMTU for Error state in sctp_transport_pl_send/toobig(), and set packet ipfragok for non-probe packets when it's in Error state. Fixes: 1dc68c194571 ("sctp: do state transition when PROBE_COUNT == MAX_PROBES on HB send path") Reported-by: Ying Xu Signed-off-by: Xin Long --- net/sctp/output.c | 13 ++++++++----- net/sctp/transport.c | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/net/sctp/output.c b/net/sctp/output.c index 4dfb5ea82b05..cdfdbd353c67 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c @@ -581,13 +581,16 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp) chunk = list_entry(packet->chunk_list.next, struct sctp_chunk, list); sk = chunk->skb->sk; - /* check gso */ if (packet->size > tp->pathmtu && !packet->ipfragok && !chunk->pmtu_probe) { - if (!sk_can_gso(sk)) { - pr_err_once("Trying to GSO but underlying device doesn't support it."); - goto out; + if (tp->pl.state == SCTP_PL_ERROR) { /* do IP fragmentation if in Error state */ + packet->ipfragok = 1; + } else { + if (!sk_can_gso(sk)) { /* check gso */ + pr_err_once("Trying to GSO but underlying device doesn't support it."); + goto out; + } + gso = 1; } - gso = 1; } /* alloc head skb */ diff --git a/net/sctp/transport.c b/net/sctp/transport.c index a3d3ca6dd63d..1f2dfad768d5 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c @@ -269,7 +269,7 @@ bool sctp_transport_pl_send(struct sctp_transport *t) if (t->pl.probe_size == SCTP_BASE_PLPMTU) { /* BASE_PLPMTU Confirmation Failed */ t->pl.state = SCTP_PL_ERROR; /* Base -> Error */ - t->pl.pmtu = SCTP_MIN_PLPMTU; + t->pl.pmtu = SCTP_BASE_PLPMTU; t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); sctp_assoc_sync_pmtu(t->asoc); } @@ -366,7 +366,7 @@ static bool sctp_transport_pl_toobig(struct sctp_transport *t, u32 pmtu) if (pmtu >= SCTP_MIN_PLPMTU && pmtu < SCTP_BASE_PLPMTU) { t->pl.state = SCTP_PL_ERROR; /* Base -> Error */ - t->pl.pmtu = SCTP_MIN_PLPMTU; + t->pl.pmtu = SCTP_BASE_PLPMTU; t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); } } else if (t->pl.state == SCTP_PL_SEARCH) { From patchwork Thu Oct 28 09:36:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 12589655 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73ADDC433F5 for ; Thu, 28 Oct 2021 09:36:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6155760EB4 for ; Thu, 28 Oct 2021 09:36:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230135AbhJ1JjO (ORCPT ); Thu, 28 Oct 2021 05:39:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbhJ1JjN (ORCPT ); Thu, 28 Oct 2021 05:39:13 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8BBDC061570; Thu, 28 Oct 2021 02:36:46 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id w15so22276146edc.9; Thu, 28 Oct 2021 02:36:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5UtnX/BS5wJUI30R0Rg1To+05cxnloCRImbzHZCiB2k=; b=TZt3Q/KcU5hGmbKYla11JTZok67tXjXu+bFXrbXCi4OmNJ9QxutRu1vVDVJ6wTk61h ck9FZDza/bgu2gEm6mqCODziQ9Ieh5zDFkMqIGO+qExUpPhJ9p0MwFWHmiLI1yM5hoi9 H96euIaBxn07vxRO7VjOqSg4yc0t+pXkNxaBhuX0HIIn8P4kpu71QzmjFofXK9130Igs ENqLDHPxizAry8fxV2ckxA+Vm0lgQhAiDhzaPk0VXXMVmhk7R85rowQ6DmrFAhtpLsVM uMoUxydOPzDdftg4Wi9fSBVWiqITZcBnAwmLZtTpgKzS5VAQsGmbJTO0pYAYZEvMdwDU +LGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5UtnX/BS5wJUI30R0Rg1To+05cxnloCRImbzHZCiB2k=; b=zaJz2/hZRmMTNjCf+OfBoDD24UCBegz5x2yRh1abDXPKzXH1vaA7UWIROIXtHtl4dT M0BjRL/7AIISUZ6Be+y68Sz3CTVBRCy+JZ5o7c5tyBTuvB+wMmg64rfCv/LtUIVonoTf j0hfDgqzv/10iBfkWBcnntxHz5oyPqvElB3hiUmMLRQvzUjEGEHxd0VcjzcF6McpAj3q 76aiga8ojR61kmGRwXjFv542OsRP0yYS2nvjB8taYTW0Q/Nf0PUNQoTGpmBy7GDcs1YN xm2/eD3oh3DgT6/JUlwcG4+87xCv2weNhySJHMIMf2ySYJUQ8bXAsGBajMAzKICo03K2 9Z9Q== X-Gm-Message-State: AOAM533nR1p4aJjm8LGpr/2JDQczf1/hjQfQuf9oOnRq9/faZ4hw1RLW qo0G6/d3OCJV0RkPmk0h7xSMv2UTLcM4Yg== X-Google-Smtp-Source: ABdhPJxt3ok0lGq6TajYoNgRaghilWVSsBqi+ZH4/iJVFy5+ZjFLi+hD0sCxFmqSW0lKc4pSHdGGbA== X-Received: by 2002:a50:998c:: with SMTP id m12mr4572087edb.19.1635413805354; Thu, 28 Oct 2021 02:36:45 -0700 (PDT) Received: from wsfd-netdev15.ntdv.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id s12sm1379865edc.48.2021.10.28.02.36.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 02:36:45 -0700 (PDT) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, Marcelo Ricardo Leitner Subject: [PATCH net 2/4] sctp: reset probe_timer in sctp_transport_pl_update Date: Thu, 28 Oct 2021 05:36:02 -0400 Message-Id: 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 sctp_transport_pl_update() is called when transport update its dst and pathmtu, instead of stopping the PLPMTUD probe timer, PLPMTUD should start over and reset the probe timer. Otherwise, the PLPMTUD service would stop. Fixes: 92548ec2f1f9 ("sctp: add the probe timer in transport for PLPMTUD") Signed-off-by: Xin Long --- include/net/sctp/sctp.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 69bab88ad66b..bc00410223b0 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -653,12 +653,10 @@ static inline void sctp_transport_pl_update(struct sctp_transport *t) if (t->pl.state == SCTP_PL_DISABLED) return; - if (del_timer(&t->probe_timer)) - sctp_transport_put(t); - t->pl.state = SCTP_PL_BASE; t->pl.pmtu = SCTP_BASE_PLPMTU; t->pl.probe_size = SCTP_BASE_PLPMTU; + sctp_transport_reset_probe_timer(t); } static inline bool sctp_transport_pl_enabled(struct sctp_transport *t) From patchwork Thu Oct 28 09:36:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 12589659 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DA94C433EF for ; Thu, 28 Oct 2021 09:36:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3196660E8C for ; Thu, 28 Oct 2021 09:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230158AbhJ1JjR (ORCPT ); Thu, 28 Oct 2021 05:39:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbhJ1JjQ (ORCPT ); Thu, 28 Oct 2021 05:39:16 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E847C061570; Thu, 28 Oct 2021 02:36:49 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id w1so3283016edd.0; Thu, 28 Oct 2021 02:36:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x1A5pRhcW9q68s/vm/42s6cTh/b679cMZFrfrXosCU0=; b=MTbvp3SgoJR8NWLaSSNBIc+rqyFSbL+lM4sfem9P6p9GsJi645BZ1qEIeU56oMrMSF d+P95lu7vu99b2ArifPG1Xfwl8OrXsZsqDbCXR4BDRHH+kXnoX00YahpLNUMPZfYfJMT je+UwQ8PYB8O1qj7u9B1+8EEAfhOnNz6t56I/AIg1Fv4IfcsjQWl+c1HONOJXlinq3l+ xVTq8ehdoXkiItPKPUC8Xj4O8FlrTDuR6dMmQsEWbXPAKIDPBA2dFf7JbvtEqN8crnG4 qYE+fjoQcah2rSpG455qwg4NU+tVcNS1/yVAJ81xJx7eA3BLdXrReEVyHNk7tq312eIp LkHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x1A5pRhcW9q68s/vm/42s6cTh/b679cMZFrfrXosCU0=; b=4nOgtTEzpo0jkzzwDlCAIMonhdSzQYwu86fP80fEuW2kAH9WZ4aLKe4AgqNFLiEntW 9jz/ePF0H94xIaZ/Y96phBMewoW0qu2g52gPeyAmOj26DxThUGS2IckpU7mdS2l7qlNO pMve3dWkQ+ydy9rdVyPSKjNfoRoMTRyI87yw/3klOg2y7kDQ+A48reegwPna+etdyGvz U4B4rtxkga6pfuE6hsHs+qIS73Mbh1WEGTn+wqPDbU3VoT0Ohb8aJn0v76Hvkwn/QC97 QPyuQlpOAdsRfIwp517o81WQYmaEpeTBaDd5srMv/KbENfvqYxC1lh+1jGxKbSE1rJc4 J4FQ== X-Gm-Message-State: AOAM533F9ZqxLLFmOPlyTPkZoxLcDj9nFN/HjDFseFNz6hiN0p9r6srg 8DloymoK/5MTbXZnEEcAPhfkKJ0F7eOUwg== X-Google-Smtp-Source: ABdhPJw8SEOrKiHHto3u3POc4uUiI6XuO5Xpxg19nDSG+Oby2bTFmS9imZREs7jOM3X/VA5bsxDHcQ== X-Received: by 2002:a17:906:c28d:: with SMTP id r13mr4066609ejz.102.1635413806866; Thu, 28 Oct 2021 02:36:46 -0700 (PDT) Received: from wsfd-netdev15.ntdv.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id s12sm1379865edc.48.2021.10.28.02.36.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 02:36:46 -0700 (PDT) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, Marcelo Ricardo Leitner Subject: [PATCH net 3/4] sctp: subtract sctphdr len in sctp_transport_pl_hlen Date: Thu, 28 Oct 2021 05:36:03 -0400 Message-Id: <5f9e29853938b5ad1cdb5e1a1de14ebcd04b58d8.1635413715.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 sctp_transport_pl_hlen() is called to calculate the outer header length for PL. However, as the Figure in rfc8899#section-4.4: Any additional headers .--- MPS -----. | | | v v v +------------------------------+ | IP | ** | PL | protocol data | +------------------------------+ <----- PLPMTU -----> <---------- PMTU --------------> Outer header are IP + Any additional headers, which doesn't include Packetization Layer itself header, namely sctphdr, whereas sctphdr is counted by __sctp_mtu_payload(). The incorrect calculation caused the link pathmtu to be set larger than expected by t->pl.pmtu + sctp_transport_pl_hlen(). This patch is to fix it by subtracting sctphdr len in sctp_transport_pl_hlen(). Fixes: d9e2e410ae30 ("sctp: add the constants/variables and states and some APIs for transport") Signed-off-by: Xin Long --- include/net/sctp/sctp.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index bc00410223b0..189fdb9db162 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -626,7 +626,8 @@ static inline __u32 sctp_min_frag_point(struct sctp_sock *sp, __u16 datasize) static inline int sctp_transport_pl_hlen(struct sctp_transport *t) { - return __sctp_mtu_payload(sctp_sk(t->asoc->base.sk), t, 0, 0); + return __sctp_mtu_payload(sctp_sk(t->asoc->base.sk), t, 0, 0) - + sizeof(struct sctphdr); } static inline void sctp_transport_pl_reset(struct sctp_transport *t) From patchwork Thu Oct 28 09:36:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 12589657 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFFE8C4332F for ; Thu, 28 Oct 2021 09:36:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94B0A60E8C for ; Thu, 28 Oct 2021 09:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230160AbhJ1JjS (ORCPT ); Thu, 28 Oct 2021 05:39:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230143AbhJ1JjQ (ORCPT ); Thu, 28 Oct 2021 05:39:16 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9F91C061745; Thu, 28 Oct 2021 02:36:49 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id 5so21662727edw.7; Thu, 28 Oct 2021 02:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=heVQdx8kuIp03Ln79hY3i096v+do8vPuzLCHTVsedUA=; b=Vjhw42kql2G9KSW8o3SWp6WhEjqv4/7eh3I35kFSAxpODJIgRbkAG8wuapLDC1m03U hZeOfzNEeSkwlwjDvHpztCrvqGcHENaOIme1U+yG0guaOdRlMO1ptzrFnlX0IpsjKPCp YAgJPoMHK4sVQWlSz2tyO6wVYJleT2JYxH0oYsAsKQJPjxtFqFvjRX4z2vp8Aw1Wmq14 /6ZFXwH/o1JE1aX5IGIR7XwvefWZHqxSn63zQwvjt0Bw8N77Eeh37Mt8j261Pj0mRjfO S1JrdokYMv9a++JkUwzWZIHc3bqkPguG+mBRT5MlEW4PNeF3iWwFoCLnfcWVuj7rMBZq y6RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=heVQdx8kuIp03Ln79hY3i096v+do8vPuzLCHTVsedUA=; b=AiX18GDtimPMIojSYL1Pd/KRPKkH9v6qV/phpdC6FcEsW8m6G/Cp4jPbx0E5AbsPhm WA5VeXIqFc1IgQWYQKotZNJfjUBPPR06duQ83xWboC9FM62Q/JW9x//JChkzE0G0pOyd nTrN8F7XEpmnVNRJtkuEGK84nBuwRET85nFqXFv4auRDCkwq8aBFsqGDoYZPCWU24xB+ d0QRExg1FR2jCcCMo5XcCzHn4LYXmeDNghIXap7EDrR9SvFaiNHi/z2bGL+Y4jrmpiG6 4Iydtx0IInTkvaC/rJynyu0208G/XT3cEQuFGZb/kKvf02RkhJdnTynBLrbs4IeX7eJa O7zw== X-Gm-Message-State: AOAM533uJB8MZKlCP7uRz9Wp9i6EjjKWNhzej7kJr63Sx79f+o7aWdyn 7jcm9S8XCGLNVb5PjqHJnpgQnRd3wd1cQA== X-Google-Smtp-Source: ABdhPJxEnhf7Mf7vP9PFD0gqTYsNcP08ImZfC/2eOztLDDUWTZ0cr4rhSyUvgXcV+IfI2AsuXJ8G6w== X-Received: by 2002:aa7:cb8a:: with SMTP id r10mr4685187edt.237.1635413808252; Thu, 28 Oct 2021 02:36:48 -0700 (PDT) Received: from wsfd-netdev15.ntdv.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id s12sm1379865edc.48.2021.10.28.02.36.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 02:36:47 -0700 (PDT) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, Marcelo Ricardo Leitner Subject: [PATCH net 4/4] sctp: return true only for pathmtu update in sctp_transport_pl_toobig Date: Thu, 28 Oct 2021 05:36:04 -0400 Message-Id: <81d365e3186a0ad69dadf5c316637696b64c7f1d.1635413715.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 sctp_transport_pl_toobig() supposes to return true only if there's pathmtu update, so that in sctp_icmp_frag_needed() it would call sctp_assoc_sync_pmtu() and sctp_retransmit(). This patch is to fix these return places in sctp_transport_pl_toobig(). Fixes: 836964083177 ("sctp: do state transition when receiving an icmp TOOBIG packet") Signed-off-by: Xin Long --- net/sctp/transport.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/sctp/transport.c b/net/sctp/transport.c index 1f2dfad768d5..133f1719bf1b 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c @@ -368,6 +368,7 @@ static bool sctp_transport_pl_toobig(struct sctp_transport *t, u32 pmtu) t->pl.pmtu = SCTP_BASE_PLPMTU; t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); + return true; } } else if (t->pl.state == SCTP_PL_SEARCH) { if (pmtu >= SCTP_BASE_PLPMTU && pmtu < t->pl.pmtu) { @@ -378,11 +379,10 @@ static bool sctp_transport_pl_toobig(struct sctp_transport *t, u32 pmtu) t->pl.probe_high = 0; t->pl.pmtu = SCTP_BASE_PLPMTU; t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); + return true; } else if (pmtu > t->pl.pmtu && pmtu < t->pl.probe_size) { t->pl.probe_size = pmtu; t->pl.probe_count = 0; - - return false; } } else if (t->pl.state == SCTP_PL_COMPLETE) { if (pmtu >= SCTP_BASE_PLPMTU && pmtu < t->pl.pmtu) { @@ -393,10 +393,11 @@ static bool sctp_transport_pl_toobig(struct sctp_transport *t, u32 pmtu) t->pl.probe_high = 0; t->pl.pmtu = SCTP_BASE_PLPMTU; t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); + return true; } } - return true; + return false; } bool sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu)