MPTCP Linux Development
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [MPTCP][PATCH v3 mptcp-next] mptcp: add local addr info in mptcp_info
Date: Wed, 03 Feb 2021 16:00:22 -0800	[thread overview]
Message-ID: <72e6de2-a737-a1fd-b9fa-5c879213c8@linux.intel.com> (raw)
In-Reply-To: 074e92470b7b18bbaf55b56d114e6616ed437a45.1612319252.git.geliangtang@gmail.com

[-- Attachment #1: Type: text/plain, Size: 3733 bytes --]

On Wed, 3 Feb 2021, Geliang Tang wrote:

> Add mptcpi_local_addr_used and mptcpi_local_addr_max in struct mptcp_info.
>
> Signed-off-by: Geliang Tang <geliangtang(a)gmail.com>
> ---
> v3:
> - keep mptcpi_add_addr_signal unchanged

Looks good for the export branch, thanks!

Reviewed-by: Mat Martineau <mathew.j.martineau(a)linux.intel.com>


Mat


>
> v2:
> - append new fields in the end of struct mptcp_info.
> - This patch is split from "add trace events" patch set as a single one
> as Paolo suggested.
> - tag: export/20210131T062218
> ---
> include/uapi/linux/mptcp.h | 2 ++
> net/mptcp/mptcp_diag.c     | 2 ++
> net/mptcp/pm_netlink.c     | 3 ++-
> net/mptcp/protocol.h       | 1 +
> 4 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
> index c91578aaab32..e1172c1ffdfd 100644
> --- a/include/uapi/linux/mptcp.h
> +++ b/include/uapi/linux/mptcp.h
> @@ -103,6 +103,8 @@ struct mptcp_info {
> 	__u64	mptcpi_write_seq;
> 	__u64	mptcpi_snd_una;
> 	__u64	mptcpi_rcv_nxt;
> +	__u8	mptcpi_local_addr_used;
> +	__u8	mptcpi_local_addr_max;
> };
>
> /*
> diff --git a/net/mptcp/mptcp_diag.c b/net/mptcp/mptcp_diag.c
> index 00ed742f48a4..f16d9b5ee978 100644
> --- a/net/mptcp/mptcp_diag.c
> +++ b/net/mptcp/mptcp_diag.c
> @@ -128,11 +128,13 @@ static void mptcp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
> 	info->mptcpi_subflows = READ_ONCE(msk->pm.subflows);
> 	info->mptcpi_add_addr_signal = READ_ONCE(msk->pm.add_addr_signaled);
> 	info->mptcpi_add_addr_accepted = READ_ONCE(msk->pm.add_addr_accepted);
> +	info->mptcpi_local_addr_used = READ_ONCE(msk->pm.local_addr_used);
> 	info->mptcpi_subflows_max = mptcp_pm_get_subflows_max(msk);
> 	val = mptcp_pm_get_add_addr_signal_max(msk);
> 	info->mptcpi_add_addr_signal_max = val;
> 	val = mptcp_pm_get_add_addr_accept_max(msk);
> 	info->mptcpi_add_addr_accepted_max = val;
> +	info->mptcpi_local_addr_max = mptcp_pm_get_local_addr_max(msk);
> 	if (test_bit(MPTCP_FALLBACK_DONE, &msk->flags))
> 		flags |= MPTCP_INFO_FLAG_FALLBACK;
> 	if (READ_ONCE(msk->can_ack))
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index 6b6dacd0e03a..75ab3d308ab5 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -228,13 +228,14 @@ unsigned int mptcp_pm_get_subflows_max(struct mptcp_sock *msk)
> }
> EXPORT_SYMBOL_GPL(mptcp_pm_get_subflows_max);
>
> -static unsigned int mptcp_pm_get_local_addr_max(struct mptcp_sock *msk)
> +unsigned int mptcp_pm_get_local_addr_max(struct mptcp_sock *msk)
> {
> 	struct pm_nl_pernet *pernet;
>
> 	pernet = net_generic(sock_net((struct sock *)msk), pm_nl_pernet_id);
> 	return READ_ONCE(pernet->local_addr_max);
> }
> +EXPORT_SYMBOL_GPL(mptcp_pm_get_local_addr_max);
>
> static void check_work_pending(struct mptcp_sock *msk)
> {
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index 92658c34f091..d385651ff6a9 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -736,6 +736,7 @@ int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct sock_common *skc);
> unsigned int mptcp_pm_get_add_addr_signal_max(struct mptcp_sock *msk);
> unsigned int mptcp_pm_get_add_addr_accept_max(struct mptcp_sock *msk);
> unsigned int mptcp_pm_get_subflows_max(struct mptcp_sock *msk);
> +unsigned int mptcp_pm_get_local_addr_max(struct mptcp_sock *msk);
>
> static inline struct mptcp_ext *mptcp_get_ext(struct sk_buff *skb)
> {
> -- 
> 2.29.2
> _______________________________________________
> mptcp mailing list -- mptcp(a)lists.01.org
> To unsubscribe send an email to mptcp-leave(a)lists.01.org
>

--
Mat Martineau
Intel

             reply	other threads:[~2021-02-04  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04  0:00 Mat Martineau [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-02-06 10:49 [MPTCP] Re: [MPTCP][PATCH v3 mptcp-next] mptcp: add local addr info in mptcp_info Matthieu Baerts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72e6de2-a737-a1fd-b9fa-5c879213c8@linux.intel.com \
    --to=mptcp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox