From nobody Sat May 18 18:58:01 2024 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43C97440C for ; Mon, 22 Apr 2024 03:01:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754884; cv=none; b=APL3AtnCIm/YZD48FEK+tsrqeoqieDIHGrtiRk4d3pdwlayGH4+294W9FMDsdgkwBa9TPXZKF6rCeaore1jsLygABA0H2mC4Y2lKiUcWWmWR0LdNVkRwDFRnGbUNVJfAyAQqfPXcuYBuj73ulolEwYyKoFkwgI035b8EOtU/Y4s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754884; c=relaxed/simple; bh=A0+lVjcnZtXBQTlCyTGaoCOQxWNlvze1Lo/Gsj96H6s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=F+H0DmXV2IJI+eCa5oB/kEoJQOL96jDkULAFnJ0/gAPjvrw9KDqJ/FqQK/3C5qmJTcI3QgkBiMLYFw23rbpf4V6OuIpCDHb6gH9t8T8oW5g0eKh32hl3lhLilLBtjMM7F2YSiyY27VeEjDA4XGBDsYcPYJTQxk1b4hRIrGj2ZIE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dottyGdv; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dottyGdv" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1e3c9300c65so33158985ad.0 for ; Sun, 21 Apr 2024 20:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713754882; x=1714359682; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gzAkyxG9AVwGz60CC3f/7tiHEIrcRZuy+oTme1mlZJQ=; b=dottyGdv/a7uX6+wpyeeoc8Pgs4rE2Oxit5bWgpIvkmuAIpkaIzkgNGCR2GdNOSOIj aS6PlGxV+cfKo1U3+8dzeHLEFkQmVPNM5AW19IeVT5+bg3rM5wyC+aVDPCd8+EFjFe/E W1UTEXndTBTK0XDEiX5OaeLjAMjpeuMYh6y2Pu5Np7MlW9bVgDWcEiAfR8BAa4OrWP17 HVe0cMEHn2NHggSlsqE4/uy5lQb5e+Dvkt6PsyGZMzD8dtPVB3xxGPUbOfjR2U4Pm1gv 3s7taj4aFUnfWIZTmc86M9lfsAnAGjvFAkLI37qfHp6XN3KwLFRZzUOCYpw6AzTaSVfZ qKxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713754882; x=1714359682; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gzAkyxG9AVwGz60CC3f/7tiHEIrcRZuy+oTme1mlZJQ=; b=vpAPYlPgpbJ3qUuhZt8MyoPpsoKHIbmPipfY0KeEp7tXnGgAbJVJwAHPWhkycHorkW s5COlDXMqK1muKUc9QyOFprgyrPKN/n41nz22Hxd97Y9U9+A5G1Ut6wYLGGZ9jPh2K/t R/Qposwk3n9/ZaMMaraZNPPkrOKkGiQfHbraBTwAACz9sQfsOFOOzEl3wB6FHUpnj5qe KMs+cF0OBVnLM7yX9VTdCzXIUhWzup2+wYF20/OhGqU8CQXoPWg6RMyeee1xSeQekSI7 eh9M9W1yky+RdhQRcm5m7q454bQGBjD+wcVqaHLwUKnoixf6ulys2L0kDYcq0SxE7o+j h/kg== X-Gm-Message-State: AOJu0YwW0ZC6cB8yjNOp77SSgN+2Na5uLx/BJWbS1LUFJUMZSprNxsLJ 0GfF+igaf4BsfgTdTiky0wFxNx9n/bWyZb2YskXo8wdCRu1dhr+L X-Google-Smtp-Source: AGHT+IHmDBUqF0fWd75hmvRosTsDXdT4f9yAvAN8nap/0Aig4K+7NfEkCyBzHk5N4R2B+lzvDXMmrg== X-Received: by 2002:a17:902:b486:b0:1e2:718d:f290 with SMTP id y6-20020a170902b48600b001e2718df290mr8552958plr.67.1713754882446; Sun, 21 Apr 2024 20:01:22 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([43.132.141.21]) by smtp.gmail.com with ESMTPSA id b5-20020a170902d60500b001e421f98ebdsm6966009plp.280.2024.04.21.20.01.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 20:01:21 -0700 (PDT) From: Jason Xing To: edumazet@google.com, dsahern@kernel.org, matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, atenart@kernel.org Cc: mptcp@lists.linux.dev, netdev@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH net-next v7 1/7] net: introduce rstreason to detect why the RST is sent Date: Mon, 22 Apr 2024 11:01:03 +0800 Message-Id: <20240422030109.12891-2-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240422030109.12891-1-kerneljasonxing@gmail.com> References: <20240422030109.12891-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Xing Add a new standalone file for the easy future extension to support both active reset and passive reset in the TCP/DCCP/MPTCP protocols. This patch only does the preparations for reset reason mechanism, nothing else changes. The reset reasons are divided into three parts: 1) reuse MP_TCPRST option for MPTCP 2) reuse drop reasons for passive reset in TCP 3) our own reasons which are not relying on other reasons at all The benefits of a standalone reset reason are listed here: 1) it can cover more than one case, such as reset reasons in MPTCP, active reset reasons. 2) people can easily/fastly understand and maintain this mechanism. 3) we get unified format of output with prefix stripped. 4) more new reset reasons are on the way ... I will implement the basic codes of active/passive reset reason in those three protocols, which are not complete for this moment. For passive reset part in TCP, I only introduce the NO_SOCKET common case which could be set as an example. After this series applied, it will have the ability to open a new gate to let other people contribute more reasons into it :) Signed-off-by: Jason Xing --- include/net/rstreason.h | 144 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 include/net/rstreason.h diff --git a/include/net/rstreason.h b/include/net/rstreason.h new file mode 100644 index 000000000000..c57bc5413c17 --- /dev/null +++ b/include/net/rstreason.h @@ -0,0 +1,144 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef _LINUX_RSTREASON_H +#define _LINUX_RSTREASON_H +#include +#include + +#define DEFINE_RST_REASON(FN, FNe) \ + FN(MPTCP_RST_EUNSPEC) \ + FN(MPTCP_RST_EMPTCP) \ + FN(MPTCP_RST_ERESOURCE) \ + FN(MPTCP_RST_EPROHIBIT) \ + FN(MPTCP_RST_EWQ2BIG) \ + FN(MPTCP_RST_EBADPERF) \ + FN(MPTCP_RST_EMIDDLEBOX) \ + FN(NOT_SPECIFIED) \ + FN(NO_SOCKET) \ + FNe(MAX) + +/** + * There are three parts in order: + * 1) reset reason in MPTCP: only for MPTCP use + * 2) skb drop reason: relying on drop reasons for such as passive reset + * 3) independent reset reason: such as active reset reasons + */ +enum sk_rst_reason { + /** + * Copy from include/uapi/linux/mptcp.h. + * These reset fields will not be changed since they adhere to + * RFC 8684. So do not touch them. I'm going to list each definition + * of them respectively. + */ + /** + * @SK_RST_REASON_MPTCP_RST_EUNSPEC: Unspecified error. + * This is the default error; it implies that the subflow is no + * longer available. The presence of this option shows that the + * RST was generated by an MPTCP-aware device. + */ + SK_RST_REASON_MPTCP_RST_EUNSPEC, + /** + * @SK_RST_REASON_MPTCP_RST_EMPTCP: MPTCP-specific error. + * An error has been detected in the processing of MPTCP options. + * This is the usual reason code to return in the cases where a RST + * is being sent to close a subflow because of an invalid response. + */ + SK_RST_REASON_MPTCP_RST_EMPTCP, + /** + * @SK_RST_REASON_MPTCP_RST_ERESOURCE: Lack of resources. + * This code indicates that the sending host does not have enough + * resources to support the terminated subflow. + */ + SK_RST_REASON_MPTCP_RST_ERESOURCE, + /** + * @SK_RST_REASON_MPTCP_RST_EPROHIBIT: Administratively prohibited. + * This code indicates that the requested subflow is prohibited by + * the policies of the sending host. + */ + SK_RST_REASON_MPTCP_RST_EPROHIBIT, + /** + * @SK_RST_REASON_MPTCP_RST_EWQ2BIG: Too much outstanding data. + * This code indicates that there is an excessive amount of data + * that needs to be transmitted over the terminated subflow while + * having already been acknowledged over one or more other subflows. + * This may occur if a path has been unavailable for a short period + * and it is more efficient to reset and start again than it is to + * retransmit the queued data. + */ + SK_RST_REASON_MPTCP_RST_EWQ2BIG, + /** + * @SK_RST_REASON_MPTCP_RST_EBADPERF: Unacceptable performance. + * This code indicates that the performance of this subflow was + * too low compared to the other subflows of this Multipath TCP + * connection. + */ + SK_RST_REASON_MPTCP_RST_EBADPERF, + /** + * @SK_RST_REASON_MPTCP_RST_EMIDDLEBOX: Middlebox interference. + * Middlebox interference has been detected over this subflow, + * making MPTCP signaling invalid. For example, this may be sent + * if the checksum does not validate. + */ + SK_RST_REASON_MPTCP_RST_EMIDDLEBOX, + + /** + * Refer to include/net/dropreason-core.h + * Rely on skb drop reason because it indicates exactly why RST + * could happen. + */ + /** @SK_RST_REASON_NOT_SPECIFIED: reset reason is not specified */ + SK_RST_REASON_NOT_SPECIFIED, + /** @SK_RST_REASON_NO_SOCKET: no valid socket that can be used */ + SK_RST_REASON_NO_SOCKET, + + /** @SK_RST_REASON_ERROR: unexpected error happens */ + SK_RST_REASON_ERROR, + + /** + * @SK_RST_REASON_MAX: Maximum of socket reset reasons. + * It shouldn't be used as a real 'reason'. + */ + SK_RST_REASON_MAX, +}; + +/* Convert reset reasons in MPTCP to our own enum type */ +static inline enum sk_rst_reason convert_mptcpreason(u32 reason) +{ + switch (reason) { + case MPTCP_RST_EUNSPEC: + return SK_RST_REASON_MPTCP_RST_EUNSPEC; + case MPTCP_RST_EMPTCP: + return SK_RST_REASON_MPTCP_RST_EMPTCP; + case MPTCP_RST_ERESOURCE: + return SK_RST_REASON_MPTCP_RST_ERESOURCE; + case MPTCP_RST_EPROHIBIT: + return SK_RST_REASON_MPTCP_RST_EPROHIBIT; + case MPTCP_RST_EWQ2BIG: + return SK_RST_REASON_MPTCP_RST_EWQ2BIG; + case MPTCP_RST_EBADPERF: + return SK_RST_REASON_MPTCP_RST_EBADPERF; + case MPTCP_RST_EMIDDLEBOX: + return SK_RST_REASON_MPTCP_RST_EMIDDLEBOX; + default: + /** + * It should not happen, or else errors may occur + * in MPTCP layer + */ + return SK_RST_REASON_ERROR; + } +} + +/* Convert reset reasons in MPTCP to our own enum type */ +static inline enum sk_rst_reason convert_dropreason(enum skb_drop_reason r= eason) +{ + switch (reason) { + case SKB_DROP_REASON_NOT_SPECIFIED: + return SK_RST_REASON_NOT_SPECIFIED; + case SKB_DROP_REASON_NO_SOCKET: + return SK_RST_REASON_NO_SOCKET; + default: + /* If we don't have our own corresponding reason */ + return SK_RST_REASON_NOT_SPECIFIED; + } +} +#endif --=20 2.37.3 From nobody Sat May 18 18:58:01 2024 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98404CA40 for ; Mon, 22 Apr 2024 03:01:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754889; cv=none; b=Jm4qRlfSdWOwjYPAB0w9T5lmgqheyhaQ066pe+FIgUK/RqLkbbz64QazmJcDo65PK3ot/mAmC8bkKCgmmG1ZLxDv4NcZniJWIxyshoaSxnb/SL9YAVwWC3gzZu6JgRVvUYzm0EgN01Vf1onl7MINAvZjEp5LYBr2tFO1mX6hbx0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754889; c=relaxed/simple; bh=R72y8G3W+r5Gv772gRuKqyNYdMiisYHVyoC5CLyv1S8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=m7we5OKRljhU0Q8d3IjZDdgIjpZgzfkPf20q8vsBByT0DFUAi6K9FnTXpOo7KGsnBdH8DvAfc7tD2MJwFLEIJolevGl8cm19pZheJ7WPEb8Uz/7zXr/6nmiPcxvd3VFV/I7FDhP38Sq76r0rVSXQggj4OG9EbxRqZx35MUFW7co= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=k8yD3Tun; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k8yD3Tun" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6f00f24f761so3225111b3a.3 for ; Sun, 21 Apr 2024 20:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713754887; x=1714359687; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i6oTHYgz5TngiL2FyP+veB9hzruY6XcRakjEoX1j6fI=; b=k8yD3Tun/ClZ4oxpghXzFMrBnQeb+ktxC72v7xCRAT5ZUKCSfZez7wKTBZ+8dq89q1 y73whlvfKvez1Kc+GcBdgouDHyDVligHSKAkvRZnKOx/1cy3+oPux8Kd6Y7WJeRs9A/r iGAjxTgCyN9R7wTJ+R9o/9EYCCD9PhLNfMdUxQNFC2YEFNhVqdstMD5a20ECXYmZGuIO 9e3SLg1nLtBYzVdIY+YzGET6Dri4XDSiLk5/kX+/4pDSclXbPOrXNrZkiMHCuj73TvSa nO8fk0yAy5IsqJ/T9K/B2b1gs7fXkw5eU2ZOL+pBJzl3uLD8yGL4uA6kppVZRUbqKwki 75hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713754887; x=1714359687; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i6oTHYgz5TngiL2FyP+veB9hzruY6XcRakjEoX1j6fI=; b=cFVaSSwwNFG4gKLYSC5kUIU3rHz0Tud/gJzLDTPaJdQ7D9ojWuMK6eUyMbPSTv4zMV L4ZNUKX/xoE8JzZM9aniMFxF4bTwnNqbVrUFR6nWsgBtHb7YkZxK/V3p/B79Ee4fvFd/ SdpmiBKCvx09sdP6squuqIb56I8Va9FpuG1pB+4giAYvNtFcYfOxukar+bjTKPfhdTw5 H4LIs05LzSCnVbzn0uKI8mWghIqAP8GfbDfG6b+LrkDQxGAnlYPKwSt2n7nM0lR0Rk1J NOkqxYc19WZGoVbpW6+fgCIaFjR316FQ0Y2iHM65SOx8NNC82t53X6or58CN+o5yeS9H 1ATg== X-Gm-Message-State: AOJu0YzEbHVnn5ETUjuDnn/afJ6qpzPMAPOpJKfVA0iJ0UUaAV8Edr8x wym4WKKnY6SsQ7U+W7L0taaLkux++YtVkBGrbHYFch6dai8kIiyz X-Google-Smtp-Source: AGHT+IFYrhYTPco4BrBFeQgbPAQG3+HJieS+pto9bBLGU6tT80CEqy6C+4WD/p2xFmtqG5j2g3+hFQ== X-Received: by 2002:a05:6a21:3d85:b0:1a9:49ae:853 with SMTP id bj5-20020a056a213d8500b001a949ae0853mr7606122pzc.45.1713754886861; Sun, 21 Apr 2024 20:01:26 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([43.132.141.21]) by smtp.gmail.com with ESMTPSA id b5-20020a170902d60500b001e421f98ebdsm6966009plp.280.2024.04.21.20.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 20:01:26 -0700 (PDT) From: Jason Xing To: edumazet@google.com, dsahern@kernel.org, matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, atenart@kernel.org Cc: mptcp@lists.linux.dev, netdev@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH net-next v7 2/7] rstreason: prepare for passive reset Date: Mon, 22 Apr 2024 11:01:04 +0800 Message-Id: <20240422030109.12891-3-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240422030109.12891-1-kerneljasonxing@gmail.com> References: <20240422030109.12891-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Xing Adjust the parameter and support passing reason of reset which is for now NOT_SPECIFIED. No functional changes. Signed-off-by: Jason Xing --- include/net/request_sock.h | 4 +++- net/dccp/ipv4.c | 10 ++++++---- net/dccp/ipv6.c | 10 ++++++---- net/dccp/minisocks.c | 3 ++- net/ipv4/tcp_ipv4.c | 12 +++++++----- net/ipv4/tcp_minisocks.c | 3 ++- net/ipv6/tcp_ipv6.c | 15 +++++++++------ net/mptcp/subflow.c | 8 +++++--- 8 files changed, 40 insertions(+), 25 deletions(-) diff --git a/include/net/request_sock.h b/include/net/request_sock.h index 004e651e6067..bdc737832da6 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h @@ -18,6 +18,7 @@ #include =20 #include +#include =20 struct request_sock; struct sk_buff; @@ -34,7 +35,8 @@ struct request_sock_ops { void (*send_ack)(const struct sock *sk, struct sk_buff *skb, struct request_sock *req); void (*send_reset)(const struct sock *sk, - struct sk_buff *skb); + struct sk_buff *skb, + enum sk_rst_reason reason); void (*destructor)(struct request_sock *req); void (*syn_ack_timeout)(const struct request_sock *req); }; diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 9fc9cea4c251..ff41bd6f99c3 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c @@ -24,6 +24,7 @@ #include #include #include +#include =20 #include "ackvec.h" #include "ccid.h" @@ -521,7 +522,8 @@ static int dccp_v4_send_response(const struct sock *sk,= struct request_sock *req return err; } =20 -static void dccp_v4_ctl_send_reset(const struct sock *sk, struct sk_buff *= rxskb) +static void dccp_v4_ctl_send_reset(const struct sock *sk, struct sk_buff *= rxskb, + enum sk_rst_reason reason) { int err; const struct iphdr *rxiph; @@ -706,7 +708,7 @@ int dccp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) return 0; =20 reset: - dccp_v4_ctl_send_reset(sk, skb); + dccp_v4_ctl_send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); kfree_skb(skb); return 0; } @@ -869,7 +871,7 @@ static int dccp_v4_rcv(struct sk_buff *skb) if (nsk =3D=3D sk) { reqsk_put(req); } else if (dccp_child_process(sk, nsk, skb)) { - dccp_v4_ctl_send_reset(sk, skb); + dccp_v4_ctl_send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); goto discard_and_relse; } else { sock_put(sk); @@ -909,7 +911,7 @@ static int dccp_v4_rcv(struct sk_buff *skb) if (dh->dccph_type !=3D DCCP_PKT_RESET) { DCCP_SKB_CB(skb)->dccpd_reset_code =3D DCCP_RESET_CODE_NO_CONNECTION; - dccp_v4_ctl_send_reset(sk, skb); + dccp_v4_ctl_send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); } =20 discard_it: diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index c8ca703dc331..85f4b8fdbe5e 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c @@ -29,6 +29,7 @@ #include #include #include +#include =20 #include "dccp.h" #include "ipv6.h" @@ -256,7 +257,8 @@ static void dccp_v6_reqsk_destructor(struct request_soc= k *req) kfree_skb(inet_rsk(req)->pktopts); } =20 -static void dccp_v6_ctl_send_reset(const struct sock *sk, struct sk_buff *= rxskb) +static void dccp_v6_ctl_send_reset(const struct sock *sk, struct sk_buff *= rxskb, + enum sk_rst_reason reason) { const struct ipv6hdr *rxip6h; struct sk_buff *skb; @@ -656,7 +658,7 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_bu= ff *skb) return 0; =20 reset: - dccp_v6_ctl_send_reset(sk, skb); + dccp_v6_ctl_send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); discard: if (opt_skb !=3D NULL) __kfree_skb(opt_skb); @@ -762,7 +764,7 @@ static int dccp_v6_rcv(struct sk_buff *skb) if (nsk =3D=3D sk) { reqsk_put(req); } else if (dccp_child_process(sk, nsk, skb)) { - dccp_v6_ctl_send_reset(sk, skb); + dccp_v6_ctl_send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); goto discard_and_relse; } else { sock_put(sk); @@ -801,7 +803,7 @@ static int dccp_v6_rcv(struct sk_buff *skb) if (dh->dccph_type !=3D DCCP_PKT_RESET) { DCCP_SKB_CB(skb)->dccpd_reset_code =3D DCCP_RESET_CODE_NO_CONNECTION; - dccp_v6_ctl_send_reset(sk, skb); + dccp_v6_ctl_send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); } =20 discard_it: diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c index 64d805b27add..251a57cf5822 100644 --- a/net/dccp/minisocks.c +++ b/net/dccp/minisocks.c @@ -15,6 +15,7 @@ #include #include #include +#include =20 #include "ackvec.h" #include "ccid.h" @@ -202,7 +203,7 @@ struct sock *dccp_check_req(struct sock *sk, struct sk_= buff *skb, DCCP_SKB_CB(skb)->dccpd_reset_code =3D DCCP_RESET_CODE_TOO_BUSY; drop: if (dccp_hdr(skb)->dccph_type !=3D DCCP_PKT_RESET) - req->rsk_ops->send_reset(sk, skb); + req->rsk_ops->send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); =20 inet_csk_reqsk_queue_drop(sk, req); out: diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 88c83ac42129..418d11902fa7 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -70,6 +70,7 @@ #include #include #include +#include =20 #include #include @@ -723,7 +724,8 @@ static bool tcp_v4_ao_sign_reset(const struct sock *sk,= struct sk_buff *skb, * Exception: precedence violation. We do not implement it in any case. */ =20 -static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb) +static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb, + enum sk_rst_reason reason) { const struct tcphdr *th =3D tcp_hdr(skb); struct { @@ -1934,7 +1936,7 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *sk= b) return 0; =20 reset: - tcp_v4_send_reset(rsk, skb); + tcp_v4_send_reset(rsk, skb, SK_RST_REASON_NOT_SPECIFIED); discard: kfree_skb_reason(skb, reason); /* Be careful here. If this function gets more complicated and @@ -2276,7 +2278,7 @@ int tcp_v4_rcv(struct sk_buff *skb) } else { drop_reason =3D tcp_child_process(sk, nsk, skb); if (drop_reason) { - tcp_v4_send_reset(nsk, skb); + tcp_v4_send_reset(nsk, skb, SK_RST_REASON_NOT_SPECIFIED); goto discard_and_relse; } sock_put(sk); @@ -2355,7 +2357,7 @@ int tcp_v4_rcv(struct sk_buff *skb) bad_packet: __TCP_INC_STATS(net, TCP_MIB_INERRS); } else { - tcp_v4_send_reset(NULL, skb); + tcp_v4_send_reset(NULL, skb, SK_RST_REASON_NOT_SPECIFIED); } =20 discard_it: @@ -2407,7 +2409,7 @@ int tcp_v4_rcv(struct sk_buff *skb) tcp_v4_timewait_ack(sk, skb); break; case TCP_TW_RST: - tcp_v4_send_reset(sk, skb); + tcp_v4_send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); inet_twsk_deschedule_put(inet_twsk(sk)); goto discard_it; case TCP_TW_SUCCESS:; diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index f53c7ada2ace..0bc19aca2759 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -22,6 +22,7 @@ #include #include #include +#include =20 static bool tcp_in_window(u32 seq, u32 end_seq, u32 s_win, u32 e_win) { @@ -879,7 +880,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_b= uff *skb, * avoid becoming vulnerable to outside attack aiming at * resetting legit local connections. */ - req->rsk_ops->send_reset(sk, skb); + req->rsk_ops->send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); } else if (fastopen) { /* received a valid RST pkt */ reqsk_fastopen_remove(sk, req, true); tcp_reset(sk, skb); diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index bb7c3caf4f85..017f6293b5f4 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -60,6 +60,7 @@ #include #include #include +#include =20 #include #include @@ -69,7 +70,8 @@ =20 #include =20 -static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb); +static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb, + enum sk_rst_reason reason); static void tcp_v6_reqsk_send_ack(const struct sock *sk, struct sk_buff *s= kb, struct request_sock *req); =20 @@ -1008,7 +1010,8 @@ static void tcp_v6_send_response(const struct sock *s= k, struct sk_buff *skb, u32 kfree_skb(buff); } =20 -static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb) +static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb, + enum sk_rst_reason reason) { const struct tcphdr *th =3D tcp_hdr(skb); struct ipv6hdr *ipv6h =3D ipv6_hdr(skb); @@ -1677,7 +1680,7 @@ int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *sk= b) return 0; =20 reset: - tcp_v6_send_reset(sk, skb); + tcp_v6_send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); discard: if (opt_skb) __kfree_skb(opt_skb); @@ -1862,7 +1865,7 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff= *skb) } else { drop_reason =3D tcp_child_process(sk, nsk, skb); if (drop_reason) { - tcp_v6_send_reset(nsk, skb); + tcp_v6_send_reset(nsk, skb, SK_RST_REASON_NOT_SPECIFIED); goto discard_and_relse; } sock_put(sk); @@ -1939,7 +1942,7 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff= *skb) bad_packet: __TCP_INC_STATS(net, TCP_MIB_INERRS); } else { - tcp_v6_send_reset(NULL, skb); + tcp_v6_send_reset(NULL, skb, SK_RST_REASON_NOT_SPECIFIED); } =20 discard_it: @@ -1995,7 +1998,7 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff= *skb) tcp_v6_timewait_ack(sk, skb); break; case TCP_TW_RST: - tcp_v6_send_reset(sk, skb); + tcp_v6_send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); inet_twsk_deschedule_put(inet_twsk(sk)); goto discard_it; case TCP_TW_SUCCESS: diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index b94d1dca1094..32fe2ef36d56 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -20,6 +20,8 @@ #include #endif #include +#include + #include "protocol.h" #include "mib.h" =20 @@ -308,7 +310,7 @@ static struct dst_entry *subflow_v4_route_req(const str= uct sock *sk, =20 dst_release(dst); if (!req->syncookie) - tcp_request_sock_ops.send_reset(sk, skb); + tcp_request_sock_ops.send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); return NULL; } =20 @@ -376,7 +378,7 @@ static struct dst_entry *subflow_v6_route_req(const str= uct sock *sk, =20 dst_release(dst); if (!req->syncookie) - tcp6_request_sock_ops.send_reset(sk, skb); + tcp6_request_sock_ops.send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); return NULL; } #endif @@ -911,7 +913,7 @@ static struct sock *subflow_syn_recv_sock(const struct = sock *sk, tcp_rsk(req)->drop_req =3D true; inet_csk_prepare_for_destroy_sock(child); tcp_done(child); - req->rsk_ops->send_reset(sk, skb); + req->rsk_ops->send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); =20 /* The last child reference will be released by the caller */ return child; --=20 2.37.3 From nobody Sat May 18 18:58:01 2024 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE85CE542 for ; Mon, 22 Apr 2024 03:01:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754893; cv=none; b=X2PcK4EYF/daYjS6kYhhEQYLdmq917aqdGoTN612IJbDfmmRBo+Nt76xNt/3+Gon1YElEkM16MGoHSGA5neySK25m/pWTU/TqQYtL0kFo0hYtrmX9RejHVZ5JwmtH2ayxVXLnadsWdD+NFDcNTtbmcRNZV/3td45IiVA6Kxvz4g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754893; c=relaxed/simple; bh=UQ8OKu/6XO1gzteA1wAsmRbCyz+zioVQYep7p/MIbLM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BrT9Nz0yityIGPLIKZnbeims5eeoEvnm+FY/azUaLlBvyrySJLCnpJHCEt2v2PL20dQiF5hKOhKy5ABpObRSEVy3NtiKiJb5CzrOuIhyU12XYWt9xBAcKBkve6u/HkrcNKnWucoyczaV8Pfn5nX8I3DOmUvR7RdtUjOUzy31s5o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CoHVkzP+; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CoHVkzP+" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1e36b7e7dd2so33056755ad.1 for ; Sun, 21 Apr 2024 20:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713754891; x=1714359691; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OLE5sB7nZh8FDwAJ64hDtj2qNR1n4lihjWtB4CW/Oiw=; b=CoHVkzP+rqjRULOtbm5Z+M4E8UzbcC/rmJaxXXe5+nQHrsjz1LEXc3fYu17eQV943L lX7l25Jt8gmroA8fkjWDy4plWxNdf4nEDpaYp3FBqrEt6PIPDiC2BsF+S5PWet00tKuv MzfKaboBNnyDNFaSdvGUnDrwxyuMBUPVtUZ3VqNTBq7QProj9p221PUzZ48DCU57pe0V xzT7vGF5NQxiA+6KN8q7bALvZbhj9mh+VlJ6HgjjMJQe432XwG1fYNdE0CsFRje76L34 9IaX6RVDCarfrN8TZhuTA1yGz2ifCSVm3HAmqoY3qevnq0phQvHfrkrk5hxnlDBUIJeD 0pMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713754891; x=1714359691; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OLE5sB7nZh8FDwAJ64hDtj2qNR1n4lihjWtB4CW/Oiw=; b=KPlpTb3P12BbY1P/kZ21gcAH+CDGhA5+tLz9NDcSHjSKN1CslD17oEJebQY/zG3jC3 dUXkm1o6LyQfY3/GQg/Iq6yT68dKrmEIne8Z+AJuK8Fx7FjTmeyBrkFHg2pYGw6dQUAk ukwSul+y8y9CN+l+hh8+hAboiqppdZJZy808vjDwNPKr33MXRI5RzsJlCtmJvJ3QZOgM gcdILGC2S8V1KBhlMqvtuK03F38ZZ9D8OBQZkAzCr1NxOTfJRPtou4QFI6zujY3BX8Ed PePbQTSFoxJfqZKtoN/Em65BIUvBYbKLKXFzzWLEjaWeMO+lM7r6xYPXxfJOp9q7eNj3 AwDQ== X-Gm-Message-State: AOJu0Yz8AAZuzdnBcNQjIa4RU9gkzQqa8fybk2be4iABKKq8Zjnj+usf nvcvLyiBwAIbvE11IGbzffUp4Ef7t2pMkPPxY2vZqadUkHsFmmho X-Google-Smtp-Source: AGHT+IEVzqC5KCQsvIF5bE//s+moL9G/9gDhYOuckAed4rCY6Z4hbgdN7nvxEyS35Jg8Rf4lo2JvBA== X-Received: by 2002:a17:902:ed0c:b0:1e0:3084:6cb4 with SMTP id b12-20020a170902ed0c00b001e030846cb4mr8062660pld.17.1713754891158; Sun, 21 Apr 2024 20:01:31 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([43.132.141.21]) by smtp.gmail.com with ESMTPSA id b5-20020a170902d60500b001e421f98ebdsm6966009plp.280.2024.04.21.20.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 20:01:30 -0700 (PDT) From: Jason Xing To: edumazet@google.com, dsahern@kernel.org, matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, atenart@kernel.org Cc: mptcp@lists.linux.dev, netdev@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH net-next v7 3/7] rstreason: prepare for active reset Date: Mon, 22 Apr 2024 11:01:05 +0800 Message-Id: <20240422030109.12891-4-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240422030109.12891-1-kerneljasonxing@gmail.com> References: <20240422030109.12891-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Xing Like what we did to passive reset: only passing possible reset reason in each active reset path. No functional changes. Signed-off-by: Jason Xing --- include/net/tcp.h | 3 ++- net/ipv4/tcp.c | 15 ++++++++++----- net/ipv4/tcp_output.c | 3 ++- net/ipv4/tcp_timer.c | 9 ++++++--- net/mptcp/protocol.c | 4 +++- net/mptcp/subflow.c | 5 +++-- 6 files changed, 26 insertions(+), 13 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index b935e1ae4caf..adeacc9aa28a 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -670,7 +670,8 @@ int tcp_fragment(struct sock *sk, enum tcp_queue tcp_qu= eue, void tcp_send_probe0(struct sock *); int tcp_write_wakeup(struct sock *, int mib); void tcp_send_fin(struct sock *sk); -void tcp_send_active_reset(struct sock *sk, gfp_t priority); +void tcp_send_active_reset(struct sock *sk, gfp_t priority, + enum sk_rst_reason reason); int tcp_send_synack(struct sock *); void tcp_push_one(struct sock *, unsigned int mss_now); void __tcp_send_ack(struct sock *sk, u32 rcv_nxt); diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index f23b97777ea5..4ec0f4feee00 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -275,6 +275,7 @@ #include #include #include +#include =20 #include #include @@ -2811,7 +2812,8 @@ void __tcp_close(struct sock *sk, long timeout) /* Unread data was tossed, zap the connection. */ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONCLOSE); tcp_set_state(sk, TCP_CLOSE); - tcp_send_active_reset(sk, sk->sk_allocation); + tcp_send_active_reset(sk, sk->sk_allocation, + SK_RST_REASON_NOT_SPECIFIED); } else if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) { /* Check zero linger _after_ checking for unread data. */ sk->sk_prot->disconnect(sk, 0); @@ -2885,7 +2887,8 @@ void __tcp_close(struct sock *sk, long timeout) struct tcp_sock *tp =3D tcp_sk(sk); if (READ_ONCE(tp->linger2) < 0) { tcp_set_state(sk, TCP_CLOSE); - tcp_send_active_reset(sk, GFP_ATOMIC); + tcp_send_active_reset(sk, GFP_ATOMIC, + SK_RST_REASON_NOT_SPECIFIED); __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONLINGER); } else { @@ -2903,7 +2906,8 @@ void __tcp_close(struct sock *sk, long timeout) if (sk->sk_state !=3D TCP_CLOSE) { if (tcp_check_oom(sk, 0)) { tcp_set_state(sk, TCP_CLOSE); - tcp_send_active_reset(sk, GFP_ATOMIC); + tcp_send_active_reset(sk, GFP_ATOMIC, + SK_RST_REASON_NOT_SPECIFIED); __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONMEMORY); } else if (!check_net(sock_net(sk))) { @@ -3007,7 +3011,7 @@ int tcp_disconnect(struct sock *sk, int flags) /* The last check adjusts for discrepancy of Linux wrt. RFC * states */ - tcp_send_active_reset(sk, gfp_any()); + tcp_send_active_reset(sk, gfp_any(), SK_RST_REASON_NOT_SPECIFIED); WRITE_ONCE(sk->sk_err, ECONNRESET); } else if (old_state =3D=3D TCP_SYN_SENT) WRITE_ONCE(sk->sk_err, ECONNRESET); @@ -4564,7 +4568,8 @@ int tcp_abort(struct sock *sk, int err) smp_wmb(); sk_error_report(sk); if (tcp_need_reset(sk->sk_state)) - tcp_send_active_reset(sk, GFP_ATOMIC); + tcp_send_active_reset(sk, GFP_ATOMIC, + SK_RST_REASON_NOT_SPECIFIED); tcp_done(sk); } =20 diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 61119d42b0fd..276d9d541b01 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -3586,7 +3586,8 @@ void tcp_send_fin(struct sock *sk) * was unread data in the receive queue. This behavior is recommended * by RFC 2525, section 2.17. -DaveM */ -void tcp_send_active_reset(struct sock *sk, gfp_t priority) +void tcp_send_active_reset(struct sock *sk, gfp_t priority, + enum sk_rst_reason reason) { struct sk_buff *skb; =20 diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 976db57b95d4..83fe7f62f7f1 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -22,6 +22,7 @@ #include #include #include +#include =20 static u32 tcp_clamp_rto_to_user_timeout(const struct sock *sk) { @@ -127,7 +128,8 @@ static int tcp_out_of_resources(struct sock *sk, bool d= o_reset) (!tp->snd_wnd && !tp->packets_out)) do_reset =3D true; if (do_reset) - tcp_send_active_reset(sk, GFP_ATOMIC); + tcp_send_active_reset(sk, GFP_ATOMIC, + SK_RST_REASON_NOT_SPECIFIED); tcp_done(sk); __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPABORTONMEMORY); return 1; @@ -768,7 +770,7 @@ static void tcp_keepalive_timer (struct timer_list *t) goto out; } } - tcp_send_active_reset(sk, GFP_ATOMIC); + tcp_send_active_reset(sk, GFP_ATOMIC, SK_RST_REASON_NOT_SPECIFIED); goto death; } =20 @@ -795,7 +797,8 @@ static void tcp_keepalive_timer (struct timer_list *t) icsk->icsk_probes_out > 0) || (user_timeout =3D=3D 0 && icsk->icsk_probes_out >=3D keepalive_probes(tp))) { - tcp_send_active_reset(sk, GFP_ATOMIC); + tcp_send_active_reset(sk, GFP_ATOMIC, + SK_RST_REASON_NOT_SPECIFIED); tcp_write_err(sk); goto out; } diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index f8bc34f0d973..065967086492 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -21,6 +21,7 @@ #endif #include #include +#include #include #include "protocol.h" #include "mib.h" @@ -2569,7 +2570,8 @@ static void mptcp_check_fastclose(struct mptcp_sock *= msk) =20 slow =3D lock_sock_fast(tcp_sk); if (tcp_sk->sk_state !=3D TCP_CLOSE) { - tcp_send_active_reset(tcp_sk, GFP_ATOMIC); + tcp_send_active_reset(tcp_sk, GFP_ATOMIC, + SK_RST_REASON_NOT_SPECIFIED); tcp_set_state(tcp_sk, TCP_CLOSE); } unlock_sock_fast(tcp_sk, slow); diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 32fe2ef36d56..ac867d277860 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -414,7 +414,7 @@ void mptcp_subflow_reset(struct sock *ssk) /* must hold: tcp_done() could drop last reference on parent */ sock_hold(sk); =20 - tcp_send_active_reset(ssk, GFP_ATOMIC); + tcp_send_active_reset(ssk, GFP_ATOMIC, SK_RST_REASON_NOT_SPECIFIED); tcp_done(ssk); if (!test_and_set_bit(MPTCP_WORK_CLOSE_SUBFLOW, &mptcp_sk(sk)->flags)) mptcp_schedule_work(sk); @@ -1350,7 +1350,8 @@ static bool subflow_check_data_avail(struct sock *ssk) tcp_set_state(ssk, TCP_CLOSE); while ((skb =3D skb_peek(&ssk->sk_receive_queue))) sk_eat_skb(ssk, skb); - tcp_send_active_reset(ssk, GFP_ATOMIC); + tcp_send_active_reset(ssk, GFP_ATOMIC, + SK_RST_REASON_NOT_SPECIFIED); WRITE_ONCE(subflow->data_avail, false); return false; } --=20 2.37.3 From nobody Sat May 18 18:58:01 2024 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20B868462 for ; Mon, 22 Apr 2024 03:01:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754897; cv=none; b=aU4MPXOTwtj3L54JCl3sYn6OSV/9XkGMlwgd1ruccx0rPCyTRedeogJXFm3aDgVt9Zz3xhGV08UvS29fnwkOCpgzy0SQMHfZ/vCGbjw7RXJ/4z6eze2F4zS5IBcVk3Pg+9NjFNLoa1QnzVSQekGbu5LGLCdV/uEISthCYWKV2SQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754897; c=relaxed/simple; bh=k0ERIGBUgeH1hzUQytdBB0A2E1f9gLeaMQ8795U1+Qc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NAWvdFuZ9P7m0coQKon6Gay/El2Yb63MDsmfxo9tDlaPMx6wB0ymvNqNCQdILf2u4OVM3afXyOt41gi/GsyL/Nwyh4CGaTo8XNpduJzRyJd6oQqeEqZ2KqYfQ+dJbHwmhcHNSFAqf7c65SFSHi9DJ0Zhs0gH8+T7CcL9BRyNn5g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ca1fUUXt; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ca1fUUXt" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1e40042c13eso28141975ad.2 for ; Sun, 21 Apr 2024 20:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713754895; x=1714359695; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wCngxkU1s9o07re7lCIfglS+wHbbPf9d21EG5EVN+Mc=; b=ca1fUUXt87Yh3Feih5iv169x/8KrmYUnBsOyrrd26Aw8w4tRnyyVhs9JE+a8XdFJ8F Tlw9r7oSHP9FlhsOMKY5xFK4kxUzD0VdAw077x5FWY1ju0C2C0h56QRCjzXMEYeYGsgE HOWYTTA+tBQYUIkKmuiDlH3ysR+H+tvAvAu4ZfCK9BqzdvJUf2ap7Qdh/+Qt5to7OmvM UiA5CfxD0QRCxzV+OtAjm7HLkvfxCIKae31jVCitvIRxKRhPjRF3CsdAPOHMRsBeZkkc ANLUZuOr3sZ5s+DNInjSgLss/U1Ekywe9L6pb4vuUCIal9+eIUYOaMdXUnBrqHaR0Uak spbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713754895; x=1714359695; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wCngxkU1s9o07re7lCIfglS+wHbbPf9d21EG5EVN+Mc=; b=iq+W0sjn0AaPprsr9jWB+BIjHpR9Z5oXb6MFfAEfcikWvZRdz7D1HDlU+IAzoK+4+F 6z+q83whlYncXoSL4wpwBtmycGHOrR4ITul1dLxhbGdzKomX+5fUeOByP3aYum4n3MG6 efnlYzho1hRafhhqLijlhIpFxiqZGBevcFFaaxv6GjZrjwU49VBosmXoNmwIWrAzrtKQ ER8jKMg6/orLTKSGX2wSF425bZ8gP7QexTwqx2vF8q2ijeTHp/iLkmiPsO0REkXANy71 /PVJTDCUN6gdSB8EYdrL/3QFrIdebbR5KXYi5/UdpYTh7rdKQAZ6ikhQ6+AG49CYpy6/ bO0g== X-Gm-Message-State: AOJu0YwoQZ281N5GIVafR/xnCxG8dfN3nXoqQ2woexKGDDO9xJXGdYJq j1VpaknKMy5iQ/VcAB/JEmkle5iiDU6b49EvwS9KOL1Shl8UPxEt X-Google-Smtp-Source: AGHT+IHFrBQ6LpYbYQDtrmuEM6FLFdib/x3xhL+60q54S/e5KhAUcWqxvXJEMLq5A42vH4XJeJ/GXA== X-Received: by 2002:a17:902:f547:b0:1e7:d482:9e09 with SMTP id h7-20020a170902f54700b001e7d4829e09mr9853379plf.7.1713754895401; Sun, 21 Apr 2024 20:01:35 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([43.132.141.21]) by smtp.gmail.com with ESMTPSA id b5-20020a170902d60500b001e421f98ebdsm6966009plp.280.2024.04.21.20.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 20:01:34 -0700 (PDT) From: Jason Xing To: edumazet@google.com, dsahern@kernel.org, matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, atenart@kernel.org Cc: mptcp@lists.linux.dev, netdev@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH net-next v7 4/7] tcp: support rstreason for passive reset Date: Mon, 22 Apr 2024 11:01:06 +0800 Message-Id: <20240422030109.12891-5-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240422030109.12891-1-kerneljasonxing@gmail.com> References: <20240422030109.12891-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Xing Reuse the dropreason logic to show the exact reason of tcp reset, so we can finally display the corresponding item in enum sk_reset_reason instead of reinventing new reset reasons. This patch replaces all the prior NOT_SPECIFIED reasons. Signed-off-by: Jason Xing --- net/ipv4/tcp_ipv4.c | 9 +++++---- net/ipv6/tcp_ipv6.c | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 418d11902fa7..06f8a24801b2 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1936,7 +1936,7 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *sk= b) return 0; =20 reset: - tcp_v4_send_reset(rsk, skb, SK_RST_REASON_NOT_SPECIFIED); + tcp_v4_send_reset(rsk, skb, convert_dropreason(reason)); discard: kfree_skb_reason(skb, reason); /* Be careful here. If this function gets more complicated and @@ -2278,7 +2278,8 @@ int tcp_v4_rcv(struct sk_buff *skb) } else { drop_reason =3D tcp_child_process(sk, nsk, skb); if (drop_reason) { - tcp_v4_send_reset(nsk, skb, SK_RST_REASON_NOT_SPECIFIED); + tcp_v4_send_reset(nsk, skb, + convert_dropreason(drop_reason)); goto discard_and_relse; } sock_put(sk); @@ -2357,7 +2358,7 @@ int tcp_v4_rcv(struct sk_buff *skb) bad_packet: __TCP_INC_STATS(net, TCP_MIB_INERRS); } else { - tcp_v4_send_reset(NULL, skb, SK_RST_REASON_NOT_SPECIFIED); + tcp_v4_send_reset(NULL, skb, convert_dropreason(drop_reason)); } =20 discard_it: @@ -2409,7 +2410,7 @@ int tcp_v4_rcv(struct sk_buff *skb) tcp_v4_timewait_ack(sk, skb); break; case TCP_TW_RST: - tcp_v4_send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); + tcp_v4_send_reset(sk, skb, convert_dropreason(drop_reason)); inet_twsk_deschedule_put(inet_twsk(sk)); goto discard_it; case TCP_TW_SUCCESS:; diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 017f6293b5f4..d8c74e90698b 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1680,7 +1680,7 @@ int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *sk= b) return 0; =20 reset: - tcp_v6_send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); + tcp_v6_send_reset(sk, skb, convert_dropreason(reason)); discard: if (opt_skb) __kfree_skb(opt_skb); @@ -1865,7 +1865,8 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff= *skb) } else { drop_reason =3D tcp_child_process(sk, nsk, skb); if (drop_reason) { - tcp_v6_send_reset(nsk, skb, SK_RST_REASON_NOT_SPECIFIED); + tcp_v6_send_reset(nsk, skb, + convert_dropreason(drop_reason)); goto discard_and_relse; } sock_put(sk); @@ -1942,7 +1943,7 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff= *skb) bad_packet: __TCP_INC_STATS(net, TCP_MIB_INERRS); } else { - tcp_v6_send_reset(NULL, skb, SK_RST_REASON_NOT_SPECIFIED); + tcp_v6_send_reset(NULL, skb, convert_dropreason(drop_reason)); } =20 discard_it: @@ -1998,7 +1999,7 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff= *skb) tcp_v6_timewait_ack(sk, skb); break; case TCP_TW_RST: - tcp_v6_send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); + tcp_v6_send_reset(sk, skb, convert_dropreason(drop_reason)); inet_twsk_deschedule_put(inet_twsk(sk)); goto discard_it; case TCP_TW_SUCCESS: --=20 2.37.3 From nobody Sat May 18 18:58:01 2024 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6357EFBFC for ; Mon, 22 Apr 2024 03:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754901; cv=none; b=evGHC8nlSHzalQpFcpQw5N8T8WtVQubD4UATgFoPawr3P5mM/kz1kVBDhS9SmIjt+Cp6k+61m040tpHSVQjntceT2fXhi8FA/IVxHzY+k467hAHUQzCyAHMF7fnZTve5qK3T4cWj4ONrD2x2aIjHff7d1VfdL7n/JLPgGL515HM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754901; c=relaxed/simple; bh=WjxyLjN2XXFGhBWrou1hHCduoG9kiV4eYSnQy4H1J6M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YXmd/LarDlC5I/8zhvZr9E1dqFSQ1ES58J6bt/B9r8ZsEsxYVK+Ybig6Os5jvDpMxLDxTQDpG/OgOgxiSolzADACO6UMid8CQDzur/cAi0tZGecm//3ffX5iueMZKjS1lozNXrq3QYzRa8INNSf3ls28A/HQdLGPnc1Eepud0fU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dnIDpkpm; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dnIDpkpm" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1e4f341330fso31558075ad.0 for ; Sun, 21 Apr 2024 20:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713754900; x=1714359700; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rYeVVW3LSCqlYGBsnga3ls9vjokc9ozCT9CspXhLgec=; b=dnIDpkpmUrNiAJOAqD5tHuSTeEk0DbbsRaxb5TfBCvKEP4U/KKjYl5Sco2imhtc0zo FnHxMyeGQwde6Vl16htwW0XX2EMZSi55G3RhyqS7J4HjheKo7VSeZCywnDFbo37uVMXg bqiusLROVGCVptOEy9akXrV3vfCvOdfzrsuFreEpIuKp5mF04vlRwMPM8cVCtu41ftMv 3MohhvJ/Wc8lgfWMuRk157qFEKsj4Gk/J2uDbImVtZfUxjF8e8l25mBdttH1LfmdM1Q6 vFSbqFeVLV4PzMexpWdUXQxjvsudkKuJEg46wtp4c/oiunMZ9rmINUYUGLp4Fm3+jRXD OonA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713754900; x=1714359700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rYeVVW3LSCqlYGBsnga3ls9vjokc9ozCT9CspXhLgec=; b=rQcU7mqCrlhMYQPemoCTlEzQd82Tlw0nwildfvPLjmBEuiOu9M7JPbJXZyq0STzTeD kjTVtawE+c8ESydRagDE75uHsprIBe5+PHxV4WZZ44gTVguiu77MIVYzIQ3NIAIlesmq zo+XEvF+Fvfq4UytEbj6HHYLI/6nKJt1/9BT1BRV0NbPfU0yQM0QXY3bqKDW6VS9Eq8t d/4r03Ys2QVfNcMbM3U3H54xDm40coxDqcnI69dCjPw5ofOQzEmbhnN4+DG5ulo00TQr b9Y28H8+CcrDJ28UReSyfBXdEmNab/Ch7X+K90SauzSYtq1tlBg0t4uLV2NGZ0YdvUJJ t0RA== X-Gm-Message-State: AOJu0YwxyV2pzDVFFnIyqLiRqzGNLx57EWk/YOhoYc0AURAgQZKeNiqW jRSBHpLcPe0teV797oIb3Pj8OfEBv3E4EXsix+Eh7lHobl7Fr7D4 X-Google-Smtp-Source: AGHT+IGV/c0wsMeQPxLO95FLc5z6vYhPP780ckEi3E8GQHDURTGIlWAooKM5o99muZb1LR2YpdZU+Q== X-Received: by 2002:a17:903:22ca:b0:1e0:b2d5:5f46 with SMTP id y10-20020a17090322ca00b001e0b2d55f46mr10230874plg.46.1713754899605; Sun, 21 Apr 2024 20:01:39 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([43.132.141.21]) by smtp.gmail.com with ESMTPSA id b5-20020a170902d60500b001e421f98ebdsm6966009plp.280.2024.04.21.20.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 20:01:39 -0700 (PDT) From: Jason Xing To: edumazet@google.com, dsahern@kernel.org, matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, atenart@kernel.org Cc: mptcp@lists.linux.dev, netdev@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH net-next v7 5/7] mptcp: support rstreason for passive reset Date: Mon, 22 Apr 2024 11:01:07 +0800 Message-Id: <20240422030109.12891-6-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240422030109.12891-1-kerneljasonxing@gmail.com> References: <20240422030109.12891-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Xing It relys on what reset options in the skb are as rfc8684 says. Reusing this logic can save us much energy. This patch replaces most of the prior NOT_SPECIFIED reasons. Signed-off-by: Jason Xing --- net/mptcp/subflow.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index ac867d277860..54e4b2515517 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -309,8 +309,13 @@ static struct dst_entry *subflow_v4_route_req(const st= ruct sock *sk, return dst; =20 dst_release(dst); - if (!req->syncookie) - tcp_request_sock_ops.send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); + if (!req->syncookie) { + struct mptcp_ext *mpext =3D mptcp_get_ext(skb); + enum sk_rst_reason reason; + + reason =3D convert_mptcpreason(mpext->reset_reason); + tcp_request_sock_ops.send_reset(sk, skb, reason); + } return NULL; } =20 @@ -377,8 +382,13 @@ static struct dst_entry *subflow_v6_route_req(const st= ruct sock *sk, return dst; =20 dst_release(dst); - if (!req->syncookie) - tcp6_request_sock_ops.send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); + if (!req->syncookie) { + struct mptcp_ext *mpext =3D mptcp_get_ext(skb); + enum sk_rst_reason reason; + + reason =3D convert_mptcpreason(mpext->reset_reason); + tcp6_request_sock_ops.send_reset(sk, skb, reason); + } return NULL; } #endif @@ -783,6 +793,7 @@ static struct sock *subflow_syn_recv_sock(const struct = sock *sk, struct mptcp_subflow_request_sock *subflow_req; struct mptcp_options_received mp_opt; bool fallback, fallback_is_fatal; + enum sk_rst_reason reason; struct mptcp_sock *owner; struct sock *child; =20 @@ -913,7 +924,8 @@ static struct sock *subflow_syn_recv_sock(const struct = sock *sk, tcp_rsk(req)->drop_req =3D true; inet_csk_prepare_for_destroy_sock(child); tcp_done(child); - req->rsk_ops->send_reset(sk, skb, SK_RST_REASON_NOT_SPECIFIED); + reason =3D convert_mptcpreason(mptcp_get_ext(skb)->reset_reason); + req->rsk_ops->send_reset(sk, skb, reason); =20 /* The last child reference will be released by the caller */ return child; --=20 2.37.3 From nobody Sat May 18 18:58:01 2024 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5804FD51E for ; Mon, 22 Apr 2024 03:01:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754905; cv=none; b=tpfsMzYBpKV57L99joFHP/DxMDLAYuPyFVDoohkZLF+Xx7+e0WUWLLpaZwvcg/+j8rsqI9LAHByWJ6sm/SYSLq4xISg3lDOuDwkBfH4mqimzTohLcOa0uZWPswE4CXWbP4XExNzXFxCXTohSF6AEzlc115Ue+6AosBuomVD83CQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754905; c=relaxed/simple; bh=RTWw1RJ8Sf7w+SDB/NEHgvuOa2DragyZlMgGDPZ1xOE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=g/sobe58FFaXP+PmZg71gjcy4hsd82NlDvQ9uAaLyw7y37p4wWFT/Br64WYtVVUgg9tcyjHC1lkXFmef0/4QdFpDuviJeKnLMX2yvt1Go3BUZcPQAAQKFTdYi1YZSNmNm9jPs3T5W5ioSL6LgO999xUL9TY919Sn/a3+zAvMkas= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fsd4IlOf; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fsd4IlOf" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1e36b7e7dd2so33058395ad.1 for ; Sun, 21 Apr 2024 20:01:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713754904; x=1714359704; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T4wkux2748y2lve+W5fu/atZMum4Uf95bxiqhm5+aE4=; b=fsd4IlOff4xjQxXJpl6vSLEoIPlb9poEXgs7gZ6IDRZNqFq7q8ZqSxh+Jbp20YrAIF i7doHLg4yxkILHE/yG+GwL151nUHIBkCbvl2CCuLlX+W1W7lCXgXCktYurrrfO+Kt94+ y9fSTORrDL0cYuECxcl9MGiFA7k0Yw2/TVDIwlwT1eQXaLpY/RS7aVeM8wHtyQ50fYSB J2eDCFX6V632SDBq9JtaIrRw69Mmhgw5CzwPj01DhJuqJsWWH4uAJyluU0DxMHnEZm4O ArMgZGy78oXB6bIFs1XkESaIbF+OmwMJY48eu0ZHIaJFLrOxbsejdb+WHaf688y93CCK I++g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713754904; x=1714359704; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T4wkux2748y2lve+W5fu/atZMum4Uf95bxiqhm5+aE4=; b=ohP3naU1T/W+kC9Jbs9MYAadG+nIoQyLOgGms+wWtbrme5DpDchwZrbHV4SwDLt+JW gMfV0GmQ/EmqhdyLQ3fG6MqN6vRH+HbyBoUKPdubduCLGSPaRXnmaXoboFRd3DLoCxy2 zeX/oUMUP1WYvhpfQVcG+tSHx+h5GsnIzsTrcRpJHaLY1TnkT8GP/Wpz98s8eXxv7nMV OW106x5Ee0NixfgnawWrEvrpIwGA8it3hW1KxwDDn8KUtqNyv+RzPTkbsOUrWUBzdGRF dxemEa+lIydJJ3Zdz5a9/lHNYQ8Jjh8HGXUH2yZkcfztoFBxrLNmt6kG98KtxvjnCq0+ k9Kg== X-Gm-Message-State: AOJu0YyV1cRDmrEKC7/qk4b8Imi7rQ/EtsmXgtpKcm8bx1Iz2jrMECJu oRgK+qLO3O2+Vno2owtiy/PETExpekjGIzSuYclIsq5UwXm7Frbm X-Google-Smtp-Source: AGHT+IEtILAJBXJMCNC/pVUC6tjFc4Hym76dZ7HfiyZqXWhrh4H7sB5XUXK/2EZ84XaBHgloMANfUA== X-Received: by 2002:a17:902:d34d:b0:1e5:3554:d9da with SMTP id l13-20020a170902d34d00b001e53554d9damr8008616plk.34.1713754903814; Sun, 21 Apr 2024 20:01:43 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([43.132.141.21]) by smtp.gmail.com with ESMTPSA id b5-20020a170902d60500b001e421f98ebdsm6966009plp.280.2024.04.21.20.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 20:01:43 -0700 (PDT) From: Jason Xing To: edumazet@google.com, dsahern@kernel.org, matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, atenart@kernel.org Cc: mptcp@lists.linux.dev, netdev@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH net-next v7 6/7] mptcp: introducing a helper into active reset logic Date: Mon, 22 Apr 2024 11:01:08 +0800 Message-Id: <20240422030109.12891-7-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240422030109.12891-1-kerneljasonxing@gmail.com> References: <20240422030109.12891-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Xing Since we have mapped every mptcp reset reason definition in enum sk_rst_reason, introducing a new helper can cover some missing places where we have already set the subflow->reset_reason. Note: using SK_RST_REASON_NOT_SPECIFIED is the same as SK_RST_REASON_MPTCP_RST_EUNSPEC. They are both unknown. So we can convert it directly. Suggested-by: Paolo Abeni Signed-off-by: Jason Xing --- Link: https://lore.kernel.org/all/2d3ea199eef53cf6a0c48e21abdee0eefbdee927.= camel@redhat.com/ --- net/mptcp/protocol.c | 4 +--- net/mptcp/protocol.h | 11 +++++++++++ net/mptcp/subflow.c | 6 ++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 065967086492..4b13ca362efa 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -21,7 +21,6 @@ #endif #include #include -#include #include #include "protocol.h" #include "mib.h" @@ -2570,8 +2569,7 @@ static void mptcp_check_fastclose(struct mptcp_sock *= msk) =20 slow =3D lock_sock_fast(tcp_sk); if (tcp_sk->sk_state !=3D TCP_CLOSE) { - tcp_send_active_reset(tcp_sk, GFP_ATOMIC, - SK_RST_REASON_NOT_SPECIFIED); + mptcp_send_active_reset_reason(tcp_sk); tcp_set_state(tcp_sk, TCP_CLOSE); } unlock_sock_fast(tcp_sk, slow); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index fdfa843e2d88..d4f83f1c6880 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -12,6 +12,7 @@ #include #include #include +#include =20 #include "mptcp_pm_gen.h" =20 @@ -581,6 +582,16 @@ mptcp_subflow_ctx_reset(struct mptcp_subflow_context *= subflow) WRITE_ONCE(subflow->local_id, -1); } =20 +static inline void +mptcp_send_active_reset_reason(struct sock *sk) +{ + struct mptcp_subflow_context *subflow =3D mptcp_subflow_ctx(sk); + enum sk_rst_reason reason; + + reason =3D convert_mptcpreason(subflow->reset_reason); + tcp_send_active_reset(sk, GFP_ATOMIC, reason); +} + static inline u64 mptcp_subflow_get_map_offset(const struct mptcp_subflow_context *subflow) { diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 54e4b2515517..423c842086ff 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -20,7 +20,6 @@ #include #endif #include -#include =20 #include "protocol.h" #include "mib.h" @@ -424,7 +423,7 @@ void mptcp_subflow_reset(struct sock *ssk) /* must hold: tcp_done() could drop last reference on parent */ sock_hold(sk); =20 - tcp_send_active_reset(ssk, GFP_ATOMIC, SK_RST_REASON_NOT_SPECIFIED); + mptcp_send_active_reset_reason(ssk); tcp_done(ssk); if (!test_and_set_bit(MPTCP_WORK_CLOSE_SUBFLOW, &mptcp_sk(sk)->flags)) mptcp_schedule_work(sk); @@ -1362,8 +1361,7 @@ static bool subflow_check_data_avail(struct sock *ssk) tcp_set_state(ssk, TCP_CLOSE); while ((skb =3D skb_peek(&ssk->sk_receive_queue))) sk_eat_skb(ssk, skb); - tcp_send_active_reset(ssk, GFP_ATOMIC, - SK_RST_REASON_NOT_SPECIFIED); + mptcp_send_active_reset_reason(ssk); WRITE_ONCE(subflow->data_avail, false); return false; } --=20 2.37.3 From nobody Sat May 18 18:58:01 2024 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF9B3DDBC for ; Mon, 22 Apr 2024 03:01:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754910; cv=none; b=i3L2fPRl5rhu7MNud3ZrYPkclPc05O6B83uz22H3SCgqXFf7opL/IK4BWDbyJFJbWkypf8y8WRerFnXdqRfjv6A070LK2/jDtiVqn+jUNRwJUjuVzYGLi1CNDzOkdO0du0UW6DE36VE14rc/dCfhRuVB5EuxomdhA0Ei8bJCT04= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713754910; c=relaxed/simple; bh=CxYn1VGv9BVyoGnuPJvlhKLzgZNZDmrSRnQIudaVJAg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Dz9xi2BxBBC924KcsVtACe05ZrlEawkvLPNEUpskSjtirHpwAuxIK0em3jC5fBTw3Ph8gQPOAEqg90BoZX+iCnjOxwd7dDhG7sXFDDyq169KpsseBRWsCDN78StiLHt1eFgmSfHezUL8uj8VxI+i/0QTHrLRZEewYjOWSCF1RXs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Top9HmMa; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Top9HmMa" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1e651a9f3ffso20890595ad.1 for ; Sun, 21 Apr 2024 20:01:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713754908; x=1714359708; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5p8+XBCRL6Hrr61VyGsGU7K/4kprn5SAx6dJ5viCQ54=; b=Top9HmMa/zKoSuGotpRU9L3EPlzaHiAbH/kQmJN8JdWpAYo446qBWwTdwBKwYYkikX WTS6TYZF9EI/w/zUgBQKU3HulALr/0t/UKqJxg/Yyq83OgDv9zpHnkXGy0tWZWBDvHBo hNddObmpmQSVRXvDxLG4FAZo/BpKGAaG4K/g03OxZrX3a1jwdm5o2FIfkgfQpN8LaNsG 3Qs9RIivBOXTibikswe/nlQpPm2fbpQ6gRFrgUefl0nPUGQZZBxUICCrNn5sMEJH4XO3 5k+BUCmLUz99yjo73GX+253B1NwzMdZUazQ1IBZlT1Ui65jnSjqvmjqYBaWdLuxSpb4Q /bZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713754908; x=1714359708; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5p8+XBCRL6Hrr61VyGsGU7K/4kprn5SAx6dJ5viCQ54=; b=HA+v+mEef7M2HyL3c2dUTc3go2S5Bc4mfLs8uo/xr3lcg9clRGJaIgLV4HQDVMIdhX VYAuk34hlRxoTKCxsU8EnReFvxHqJOegP/vYFxpvnKRyE+AfIClCn+KZHUMkVHszE7hA C4trpBOYkb1dS0YYHnaGlBPaPeXd1MYm/KwYt1CNwAPOPVHBb4QXOrkWgaL5O4ulrlqV In8I6mfgA9UU3Yky5pGnIhHYi/xbMmHwbWk3SQkJTcegBe5wv9usfbrOEfxuYoIMiF9A CqnkuUdOnkcsC2fPyqp7G+Q128E4QBYQYiJb5n7YbSwFK7oCYdLC4H6+/gQafv9C2Hbo uFAg== X-Gm-Message-State: AOJu0YzJYYq5MW7oLID7r/WRHuT2Ueoa8zEIwR+gmtymI6fkzvDhO+dA Cn/cxsoCxX5U5f7Kp307ekQTd7beawnLQ4XlyyFiYU0E1Dx/Ygd4 X-Google-Smtp-Source: AGHT+IEmXSE6/YbEiEkDZXkV8Th4sWtQd6TKpikTRSCaVLJJfKnpX6D6nSHGbo4EvC969UyO0qiD4A== X-Received: by 2002:a17:903:11d1:b0:1e7:f944:b000 with SMTP id q17-20020a17090311d100b001e7f944b000mr9643112plh.24.1713754908124; Sun, 21 Apr 2024 20:01:48 -0700 (PDT) Received: from KERNELXING-MB0.tencent.com ([43.132.141.21]) by smtp.gmail.com with ESMTPSA id b5-20020a170902d60500b001e421f98ebdsm6966009plp.280.2024.04.21.20.01.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 20:01:47 -0700 (PDT) From: Jason Xing To: edumazet@google.com, dsahern@kernel.org, matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, atenart@kernel.org Cc: mptcp@lists.linux.dev, netdev@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kerneljasonxing@gmail.com, Jason Xing Subject: [PATCH net-next v7 7/7] rstreason: make it work in trace world Date: Mon, 22 Apr 2024 11:01:09 +0800 Message-Id: <20240422030109.12891-8-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240422030109.12891-1-kerneljasonxing@gmail.com> References: <20240422030109.12891-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jason Xing At last, we should let it work by introducing this reset reason in trace world. One of the possible expected outputs is: ... tcp_send_reset: skbaddr=3Dxxx skaddr=3Dxxx src=3Dxxx dest=3Dxxx state=3DTCP_ESTABLISHED reason=3DNOT_SPECIFIED Signed-off-by: Jason Xing Reviewed-by: Steven Rostedt (Google) --- include/trace/events/tcp.h | 26 ++++++++++++++++++++++---- net/ipv4/tcp_ipv4.c | 2 +- net/ipv4/tcp_output.c | 2 +- net/ipv6/tcp_ipv6.c | 2 +- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h index 5c04a61a11c2..49b5ee091cf6 100644 --- a/include/trace/events/tcp.h +++ b/include/trace/events/tcp.h @@ -11,6 +11,7 @@ #include #include #include +#include =20 /* * tcp event with arguments sk and skb @@ -74,20 +75,32 @@ DEFINE_EVENT(tcp_event_sk_skb, tcp_retransmit_skb, TP_ARGS(sk, skb) ); =20 +#undef FN +#define FN(reason) TRACE_DEFINE_ENUM(SK_RST_REASON_##reason); +DEFINE_RST_REASON(FN, FN) + +#undef FN +#undef FNe +#define FN(reason) { SK_RST_REASON_##reason, #reason }, +#define FNe(reason) { SK_RST_REASON_##reason, #reason } + /* * skb of trace_tcp_send_reset is the skb that caused RST. In case of * active reset, skb should be NULL */ TRACE_EVENT(tcp_send_reset, =20 - TP_PROTO(const struct sock *sk, const struct sk_buff *skb), + TP_PROTO(const struct sock *sk, + const struct sk_buff *skb, + const enum sk_rst_reason reason), =20 - TP_ARGS(sk, skb), + TP_ARGS(sk, skb, reason), =20 TP_STRUCT__entry( __field(const void *, skbaddr) __field(const void *, skaddr) __field(int, state) + __field(enum sk_rst_reason, reason) __array(__u8, saddr, sizeof(struct sockaddr_in6)) __array(__u8, daddr, sizeof(struct sockaddr_in6)) ), @@ -113,14 +126,19 @@ TRACE_EVENT(tcp_send_reset, */ TP_STORE_ADDR_PORTS_SKB(skb, th, entry->daddr, entry->saddr); } + __entry->reason =3D reason; ), =20 - TP_printk("skbaddr=3D%p skaddr=3D%p src=3D%pISpc dest=3D%pISpc state=3D%s= ", + TP_printk("skbaddr=3D%p skaddr=3D%p src=3D%pISpc dest=3D%pISpc state=3D%s= reason=3D%s", __entry->skbaddr, __entry->skaddr, __entry->saddr, __entry->daddr, - __entry->state ? show_tcp_state_name(__entry->state) : "UNKNOWN") + __entry->state ? show_tcp_state_name(__entry->state) : "UNKNOWN", + __print_symbolic(__entry->reason, DEFINE_RST_REASON(FN, FNe))) ); =20 +#undef FN +#undef FNe + /* * tcp event with arguments sk * diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 06f8a24801b2..5db2d55b65af 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -871,7 +871,7 @@ static void tcp_v4_send_reset(const struct sock *sk, st= ruct sk_buff *skb, if (sk) arg.bound_dev_if =3D sk->sk_bound_dev_if; =20 - trace_tcp_send_reset(sk, skb); + trace_tcp_send_reset(sk, skb, reason); =20 BUILD_BUG_ON(offsetof(struct sock, sk_bound_dev_if) !=3D offsetof(struct inet_timewait_sock, tw_bound_dev_if)); diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 276d9d541b01..b08ffb17d5a0 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -3612,7 +3612,7 @@ void tcp_send_active_reset(struct sock *sk, gfp_t pri= ority, /* skb of trace_tcp_send_reset() keeps the skb that caused RST, * skb here is different to the troublesome skb, so use NULL */ - trace_tcp_send_reset(sk, NULL); + trace_tcp_send_reset(sk, NULL, SK_RST_REASON_NOT_SPECIFIED); } =20 /* Send a crossed SYN-ACK during socket establishment. diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index d8c74e90698b..966a6a9b0f44 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1133,7 +1133,7 @@ static void tcp_v6_send_reset(const struct sock *sk, = struct sk_buff *skb, label =3D ip6_flowlabel(ipv6h); } =20 - trace_tcp_send_reset(sk, skb); + trace_tcp_send_reset(sk, skb, reason); =20 tcp_v6_send_response(sk, skb, seq, ack_seq, 0, 0, 0, oif, 1, ipv6_get_dsfield(ipv6h), label, priority, txhash, --=20 2.37.3