From: Mat Martineau <mathew.j.martineau at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [MPTCP][PATCH v2 mptcp-next 2/5] mptcp: simplify mptcp_pm_nl_add_addr_send_ack debug log
Date: Fri, 15 Jan 2021 16:59:22 -0800 [thread overview]
Message-ID: <14718d73-c348-ba1a-c33-64e57c6ef3ab@linux.intel.com> (raw)
In-Reply-To: 7e16f6bc56bb1f0fb9f6253ee67f1f74832f1cce.1610602400.git.geliangtang@gmail.com
[-- Attachment #1: Type: text/plain, Size: 1395 bytes --]
On Thu, 14 Jan 2021, Geliang Tang wrote:
> Print out the debug log of mptcp_pm_nl_add_addr_send_ack in a single line
> when more than one mptcp_addr_signal_status are set.
>
> Signed-off-by: Geliang Tang <geliangtang(a)gmail.com>
> ---
> net/mptcp/pm_netlink.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index ed4231efa822..8f4bd2457a97 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -500,13 +500,15 @@ void mptcp_pm_nl_add_addr_send_ack(struct mptcp_sock *msk)
> subflow = list_first_entry_or_null(&msk->conn_list, typeof(*subflow), node);
> if (subflow) {
> struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
> + char buf[32] = { 0 };
> u8 add_addr;
>
> spin_unlock_bh(&msk->pm.lock);
> if (mptcp_pm_should_add_signal_ipv6(msk))
> - pr_debug("send ack for add_addr6");
> + strcat(buf, "[ipv6]");
> if (mptcp_pm_should_add_signal_port(msk))
> - pr_debug("send ack for add_addr_port");
> + strcat(buf, "[port]");
> + pr_debug("send ack for add_addr %s", buf);
pr_debug() calls can be compiled out or involve dynamic debug, so it's
better to avoid using a buffer on the stack and strcat() like this when
building the debug output.
>
> lock_sock(ssk);
> tcp_send_ack(ssk);
> --
> 2.29.2
--
Mat Martineau
Intel
reply other threads:[~2021-01-16 0:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=14718d73-c348-ba1a-c33-64e57c6ef3ab@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