Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp464108lqg; Fri, 1 Mar 2024 10:19:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUvP6xN9+r7IkKZ39F0J65Y3skHdCWWWrTGJ7v83XqtscIq95yH7V6PNxouA6dK50zmDs+v7byf4+8j+c7DtqCLRavOWD4Wf6R5eaClug== X-Google-Smtp-Source: AGHT+IFQY7eTkunrS2tH1BOh+UjQ4d7WUhWTW3AB2dSnOkncRcJr7P9rVl1WW0Vi9YEf0bx8rbjN X-Received: by 2002:ad4:46ca:0:b0:68f:f0ab:23c3 with SMTP id pm10-20020ad446ca000000b0068ff0ab23c3mr2611138qvb.38.1709317189487; Fri, 01 Mar 2024 10:19:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709317189; cv=pass; d=google.com; s=arc-20160816; b=1JCQ2cS2xiEpW36bGyhKmpeogXLpfdcJwMkttBhxiGq6aQbrovUxRAo2l7DUl8ZRb7 1SB+do625Uyo/80uO5CACFgfG/hKgP9TA6TTGDTLGnD2zQ4RHZElYS4PEDaUo3lkFQDy QC3SVzKF3qZkdOSsiC5hUp2GKi/ezaFJXiYThG/8JscIVCjlVNwz+5uYRFheqj3SAzXh L8rcfj1q3RWsc2OAVVi5vu1dDb++lVtGlTm4As6ahWJv/qgDyKThrw2d75CYAIHdSbsZ sxntYXE6zTovNU0v3hYjaNsA3ocFtJ+azttHwI5ijoOo0O+6S84qZwWZhirPt1Du5hIo ft+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=PfiyO0UuCSnRx3EHo/KIglrBKd8k4E6etZOxI3R8Ks8=; fh=i1fHfqb3ms9PQICjX9LbYyHHX00fft5d6t57sCy1Fok=; b=oHf4BYBzFtGyETe8Pw/RBf5NKgBicVo1QUotcyjwbLPSAQeXcvEpemoBs6HDaNEQfQ uOCBHgpiWxmvybBEsWm792jiLDOdyz8t5h9C+BVaDU7pYkVLtYJOT/olJniCjuhgpQD/ tfO/Fuxt+lGpsbmu6H9uc6eAarY1Cy4iWEn+A2Z1jTdagkgd1+gtmrw9PGZxa4Vs10sb Fw8US4ZEEZIq6bEsXYTJFeFOiV02c3IvERkZGFbNuNFpa9Xb0FXW8I7lVypg7c6eMOAl FD5cSvmu1hxS+DfBkCDR0urXCI7F2gW2qHR/wvfgvirV59KACgQWqc94WOd4eb/GTvfo QnRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OZGU6REx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-88899-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88899-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id m12-20020ad45dcc000000b0068ffe94f96csi4018106qvh.603.2024.03.01.10.19.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 10:19:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88899-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OZGU6REx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-88899-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88899-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 17F401C22B29 for ; Fri, 1 Mar 2024 18:19:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A742E27473; Fri, 1 Mar 2024 18:18:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OZGU6REx" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9508C39FEF; Fri, 1 Mar 2024 18:18:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709317118; cv=none; b=P4gPn6BeuG23H70wFmp5Gpq5cH2gd9yg1l+hYS9+GJNavnN/97FvoKobzYZ3E3l9cKfztEztRpqQM8mTC17Az60WH9d7YwekLVRo77m3xQUWFzxHpWQ3oQKLTln1zRhhXf1HAZ7IAudp45JzuWbhUXm30otjsWWD6yhGmspw2DU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709317118; c=relaxed/simple; bh=eScPtd27k6a2RMCsmgXPa3fVzwLEszi4ZWB1Hb7/NkM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VcUSFlHzYZNEwulHyYKJ09+B2ntfo3hJtTjF88zik9qT2LhyISpLFYS1UeNyktJsoWurljfZq/qOjkBlERtvUfB2F35zZnePVuGenCX700cCPPTYylM34pk479FM8vcLZWkxXg/v745/on9AORvI1ejc8AF3RDT8aCtLXdPZBAM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OZGU6REx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D6AEC43390; Fri, 1 Mar 2024 18:18:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709317118; bh=eScPtd27k6a2RMCsmgXPa3fVzwLEszi4ZWB1Hb7/NkM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=OZGU6RExEJhoQaXKKrHO6opllpxZlqOmnKeDFyfBsBXFPvoMnhKmvK5QAWCIRsBz8 9dX8pOrXMO6v5WmlZHnrzI61e982AYzOb3ET3z1tGSG3jsiB6luFRi/8macRJpB5k4 bMtnxoAiLjrzROxDJlz6687h5aKh+C2s8nUCTvZ4DzgKJ+Ggx6k9kCYGVBqwI1mwvi iZ+wpD561/TYl5OdnrhZH8Zu5KBtKohgQSEMvIhYRjjwFxd2nMjKJL3nIHuyvcnriU YPuP6Pug+mRngtiXbSbvcM+UafxxUVE4FVTZCjIAOZfZicuqaIImQ7uBvHsLWB6ndz uOYSZyOTudOvw== From: "Matthieu Baerts (NGI0)" Date: Fri, 01 Mar 2024 19:18:26 +0100 Subject: [PATCH net-next 02/15] mptcp: export mptcp_genl_family & mptcp_nl_fill_addr Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240301-upstream-net-next-20240301-mptcp-userspace-pm-dump-addr-v1-2-dc30a420b3a0@kernel.org> References: <20240301-upstream-net-next-20240301-mptcp-userspace-pm-dump-addr-v1-0-dc30a420b3a0@kernel.org> In-Reply-To: <20240301-upstream-net-next-20240301-mptcp-userspace-pm-dump-addr-v1-0-dc30a420b3a0@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: Geliang Tang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2543; i=matttbe@kernel.org; h=from:subject:message-id; bh=wqCWze8v4zdWHeq1IXu4TPUkM/xqaWNcPQAM2nOwuyA=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBl4hv0RAbW8CCvneg/shfdH2PXLY/tcVDkWkLXx uFkaYeBueKJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZeIb9AAKCRD2t4JPQmmg c7vPD/wKT3FbQK5LVP6HMMrXdtrBBUGk5t2G08+0nnwmajDd2WcJGkplj/orpRVTDrFbkUjUoxa 1mRkI+oAlFYo7jjFfED582DL/D6xsvXI+i6q7BOSUsGR0+5af3yalAiNwgBLjWddPztSKLIQD1T iVTPhC2s7Pxp0QpAeFW1UGEkvB0RRJ+/6lbFOwN6YDyumZ/uldoozkmepaxMRCBlR20YWBDYGDX L8fgmlL36ay6hl8c0rv20olMOE/+wbtW4jhVVclspFFfA6w8lnj3WsErL6B136eSc3D77HHgFxB i1wGUevJST699DXvSurmY0Pja3IkPmzgMUfzDkv/lDo+fgIQB49CC1qrfsIZD7tiS/ZHFvWhQPO k68EdlO3MxFZdKM1GTwlPekgfT8Hv8ObMvJD88khxjq9PXomQ4/VP+PU3gaW1Ssb2I4jynO4t9q xLndkbGszDTSo7z31CAdkhU1rOvfqPQVJZyaAeh2Mx11mE68JNnZm+tQ0/df0oTe0ke2n/4D3UD Ar0Q1FSnK3YUML2Qf7lzkqpomcxvpRwFbloIjsprXNkWGevtVAl8nnuDm4jD3n4yYp325btOOsk +ufsdutiZH9YJPd/QSRgGey2cC7lel023XR8rgXIhvWYrIejlo3ISNPlvrGTgguQPJMZ6ZxpTE6 6/Ptx6JbkC98AOw== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 From: Geliang Tang This patch exports struct mptcp_genl_family and mptcp_nl_fill_addr() helper to allow them can be used in pm_userspace.c. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_netlink.c | 9 +++------ net/mptcp/protocol.h | 4 ++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 80c537659922..e8cb887561e0 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -18,9 +18,6 @@ #include "protocol.h" #include "mib.h" -/* forward declaration */ -static struct genl_family mptcp_genl_family; - static int pm_nl_pernet_id; struct mptcp_pm_add_entry { @@ -1636,8 +1633,8 @@ int mptcp_pm_nl_flush_addrs_doit(struct sk_buff *skb, struct genl_info *info) return 0; } -static int mptcp_nl_fill_addr(struct sk_buff *skb, - struct mptcp_pm_addr_entry *entry) +int mptcp_nl_fill_addr(struct sk_buff *skb, + struct mptcp_pm_addr_entry *entry) { struct mptcp_addr_info *addr = &entry->addr; struct nlattr *attr; @@ -2281,7 +2278,7 @@ void mptcp_event(enum mptcp_event_type type, const struct mptcp_sock *msk, nlmsg_free(skb); } -static struct genl_family mptcp_genl_family __ro_after_init = { +struct genl_family mptcp_genl_family __ro_after_init = { .name = MPTCP_PM_NAME, .version = MPTCP_PM_VER, .netnsok = true, diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index b85d1a8d111b..d70fb3bf5076 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -343,6 +343,8 @@ struct mptcp_sock { #define mptcp_for_each_subflow_safe(__msk, __subflow, __tmp) \ list_for_each_entry_safe(__subflow, __tmp, &((__msk)->conn_list), node) +extern struct genl_family mptcp_genl_family; + static inline void msk_owned_by_me(const struct mptcp_sock *msk) { sock_owned_by_me((const struct sock *)msk); @@ -974,6 +976,8 @@ void __mptcp_fastopen_gen_msk_ackseq(struct mptcp_sock *msk, struct mptcp_subflo const struct mptcp_options_received *mp_opt); void mptcp_fastopen_subflow_synack_set_params(struct mptcp_subflow_context *subflow, struct request_sock *req); +int mptcp_nl_fill_addr(struct sk_buff *skb, + struct mptcp_pm_addr_entry *entry); static inline bool mptcp_pm_should_add_signal(struct mptcp_sock *msk) { -- 2.43.0