From patchwork Sun May 2 20:36:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 12235429 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=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,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 1CF76C433B4 for ; Sun, 2 May 2021 20:37:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EEAC560C40 for ; Sun, 2 May 2021 20:37:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232498AbhEBUiK (ORCPT ); Sun, 2 May 2021 16:38:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232374AbhEBUiJ (ORCPT ); Sun, 2 May 2021 16:38:09 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB2B0C06174A; Sun, 2 May 2021 13:37:16 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id j6so2808965pfh.5; Sun, 02 May 2021 13:37:16 -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 :in-reply-to:references:mime-version:content-transfer-encoding; bh=qBb626UAryAdgm1T2pey6uV0joO//C8f4zZWIykiFHk=; b=owdkxVfeqfxf1akWBJJcpdJ5mBargcPVnGKdSk1J8ENrkq91GmpunuNwnVSarOTXKj c7R/mgfxVCAgUdTyJatS+8gFiLvgCHcFtPvWjnd9TdFxF5xMTqTct5OHS8IKL5wmLQNl ivgHcVYLXChjlOxU5ILq99bkCJb4vXiaCAZPma74FNtf1EgYvlALkOgAjKVMZ9OBafgj sw6JeDcVfCL6gD81pMOHVzxbZeyHUyh9jwZCvuJHaOi5mW8LQIEqoBStwD0CcP/9BvqS SiE71OH3h2G8v3OwTMcBMfJOb5Sx1F+iYBB5QCrPdMYdQyNlbZdcwnr7R3VZ7UBTibkk ZS5g== 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:in-reply-to:references:mime-version :content-transfer-encoding; bh=qBb626UAryAdgm1T2pey6uV0joO//C8f4zZWIykiFHk=; b=KqzEYsfAeV9D61kc1vVFoi0tp+otCPxMnWLjQqsj81g4wuIVaT3tYbJhuM0U+OFdgR 8bHCd4lCCtPz6WRep3bbCWVRF6mHrvZvw8eNOc/IsOw/zLXb9WchPLMdDfkjqckX2YBE TqxW2X9a2N26T7ZllZAZqnn8W8F4T9lpSb/IP6OXox9lIFJrVn4iH5yEQPjlcGpv5dvg amjnW4RGo2d69Cz0S8Z36y9gKJ6QXmPHdYzSd2XudQm2wlQ6GWoAnNACpF5Jh54KfG59 mXE7eTG53ShP/hpkE9BGGGBZSUw9k0sjvY341w6LuV0VdgEr6ELBKTRACqJRWLR8iM17 VJfQ== X-Gm-Message-State: AOAM530uY40uUBBT2ym03U8I/II5IIjT/9W4wpm7ljZ2IL/9bw8eJLcj dth3ofkP8YfUuDhxnjGKjt4OdAP3vDJg8mf/ X-Google-Smtp-Source: ABdhPJxzP2kqfSe/20haLDQkoKfg3VFeQ6sqaSXFycr9fkki9uGnmwm+357T1yDDX4YoafHHLkdnXw== X-Received: by 2002:a62:1b94:0:b029:28d:496d:10d0 with SMTP id b142-20020a621b940000b029028d496d10d0mr11840467pfb.28.1619987835334; Sun, 02 May 2021 13:37:15 -0700 (PDT) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id a1sm1242769pfi.22.2021.05.02.13.37.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 May 2021 13:37:15 -0700 (PDT) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, Marcelo Ricardo Leitner , jere.leppanen@nokia.com Subject: [PATCH net 1/2] Revert "Revert "sctp: Fix bundling of SHUTDOWN with COOKIE-ACK"" Date: Mon, 3 May 2021 04:36:58 +0800 Message-Id: <8b4e11506ccf62e18944bc94a02ea86c4c4de26e.1619987699.git.lucien.xin@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: References: 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 This reverts commit 7e9269a5acec6d841d22e12770a0b02db4f5d8f2. As Jere notice, commit 35b4f24415c8 ("sctp: do asoc update earlier in sctp_sf_do_dupcook_a") only keeps the SHUTDOWN and COOKIE-ACK with the same asoc, not transport. So we have to bring this patch back. Reported-by: Jere Leppänen Signed-off-by: Xin Long --- net/sctp/sm_statefuns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index a428449..5fc3f3a 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -1903,7 +1903,7 @@ static enum sctp_disposition sctp_sf_do_dupcook_a( */ sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl)); return sctp_sf_do_9_2_start_shutdown(net, ep, asoc, - SCTP_ST_CHUNK(0), NULL, + SCTP_ST_CHUNK(0), repl, commands); } else { sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, @@ -5549,7 +5549,7 @@ enum sctp_disposition sctp_sf_do_9_2_start_shutdown( * in the Cumulative TSN Ack field the last sequential TSN it * has received from the peer. */ - reply = sctp_make_shutdown(asoc, NULL); + reply = sctp_make_shutdown(asoc, arg); if (!reply) goto nomem; @@ -6147,7 +6147,7 @@ enum sctp_disposition sctp_sf_autoclose_timer_expire( disposition = SCTP_DISPOSITION_CONSUME; if (sctp_outq_is_empty(&asoc->outqueue)) { disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type, - arg, commands); + NULL, commands); } return disposition; From patchwork Sun May 2 20:36:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 12235431 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=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,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 7398CC43462 for ; Sun, 2 May 2021 20:37:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 547F160C40 for ; Sun, 2 May 2021 20:37:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232529AbhEBUiS (ORCPT ); Sun, 2 May 2021 16:38:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232528AbhEBUiQ (ORCPT ); Sun, 2 May 2021 16:38:16 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BE87C06138C; Sun, 2 May 2021 13:37:24 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id q2so2766191pfh.13; Sun, 02 May 2021 13:37:24 -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 :in-reply-to:references:mime-version:content-transfer-encoding; bh=mR9e4NkKqzrDkV1l6zV2ulkWewV/V4ENDDwbld/8TKY=; b=K8HshOlG18N3SMVofWgPCloxSQyPHL/44AtEfmXz7vNLZSb50FrYpPa2q1A38T2Br+ spg1KzYIo3RoOnZICS7g0mhUSKmnH853bGGAPuTp7vIBzBNl6MJTcZj9POca3gJSkbWh X+k1wjhyZp/XAbNow/4NFFPNNZQGHFigZQtGrjjYn/ymw6WnMtLZscbVWbbQ9mWIY1cE egEMiIOkvgu6sNL/PmaG6EKkQkq9S6H1jUrrHzKVb+qTBP7pP60ywZki6hy+T6vCEMxI xFy4zBJy7YyPCncLNhhW0ul7Htj7adN+7qoqDYVkB6LVx10wlM5igE/n/GXUuzjMHXqZ 5aig== 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:in-reply-to:references:mime-version :content-transfer-encoding; bh=mR9e4NkKqzrDkV1l6zV2ulkWewV/V4ENDDwbld/8TKY=; b=i6F0ZUAIXIN9Ej/AMX0i8Opu4pmFuzuShrW0OkW6VOWbc6q7x3eQ3A9vrjeo1kf7t+ gUCBfLdRiNpNIOA25cXc8dz4/NJQ5YRHhwcPJjF4+v2I219XQKfrQVXX77E0hIivHqBa IrJ1hr6y+e8lpbUG+SWq1CVw6EK/hoBh9ouKLbDd++cZSI2J7tj8I565T+lyOKIH+XsQ u7zPOlRdFWc3TWicSBYis1fDsL2ul89T2dgH6NgBBPFIU2L42KjBq+kri5BDpyKJMGgR YX0bkiL6tLmvXFceavVEUAyfTCJZkK0w95cqSWZVoPV0penaz1i6xfDhIUnvzGuQjbpf YCKA== X-Gm-Message-State: AOAM533UfOF98EZP3Hl77ru1RGKL4GS1gwYKcHKCRU2LDYWIXi9S1JCp 5aEVAY+sHMMya3Sk1L/4ZRzn/8dY8dXmfsDO X-Google-Smtp-Source: ABdhPJymtN5VBEeezmnt9cZX4ei/cmISN9t7628dQPjOpNbXjV/qN+TTAJd6zjmQwjKQXrkntILlhA== X-Received: by 2002:a63:9e02:: with SMTP id s2mr15717002pgd.134.1619987843404; Sun, 02 May 2021 13:37:23 -0700 (PDT) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id a128sm7231175pfd.115.2021.05.02.13.37.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 May 2021 13:37:23 -0700 (PDT) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, Marcelo Ricardo Leitner , jere.leppanen@nokia.com Subject: [PATCH net 2/2] Revert "sctp: Fix SHUTDOWN CTSN Ack in the peer restart case" Date: Mon, 3 May 2021 04:36:59 +0800 Message-Id: X-Mailer: git-send-email 2.1.0 In-Reply-To: <8b4e11506ccf62e18944bc94a02ea86c4c4de26e.1619987699.git.lucien.xin@gmail.com> References: <8b4e11506ccf62e18944bc94a02ea86c4c4de26e.1619987699.git.lucien.xin@gmail.com> 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 This reverts commit 12dfd78e3a74825e6f0bc8df7ef9f938fbc6bfe3. This can be reverted as shutdown and cookie_ack chunk are using the same asoc since commit 35b4f24415c8 ("sctp: do asoc update earlier in sctp_sf_do_dupcook_a"). Reported-by: Jere Leppänen Signed-off-by: Xin Long --- net/sctp/sm_make_chunk.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 5f9a7c0..5b44d22 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -858,11 +858,7 @@ struct sctp_chunk *sctp_make_shutdown(const struct sctp_association *asoc, struct sctp_chunk *retval; __u32 ctsn; - if (chunk && chunk->asoc) - ctsn = sctp_tsnmap_get_ctsn(&chunk->asoc->peer.tsn_map); - else - ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); - + ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); shut.cum_tsn_ack = htonl(ctsn); retval = sctp_make_control(asoc, SCTP_CID_SHUTDOWN, 0,