From: Geliang Tang <geliangtang@gmail.com>
To: mptcp@lists.linux.dev
Cc: Geliang Tang <geliangtang@gmail.com>
Subject: [MPTCP][PATCH v2 mptcp-next] Squash to "mptcp: fix ADD_ADDR and RM_ADDR maybe flush addr_signal each other"
Date: Tue, 13 Jul 2021 14:44:43 +0800 [thread overview]
Message-ID: <756dcceaa255c54b7bd195c719ede1f7ae791eb3.1626158100.git.geliangtang@gmail.com> (raw)
This line 'if ((msk->pm.addr_signal & BIT(MPTCP_ADD_ADDR_ECHO)))' should
be:
if (msk->pm.addr_signal & BIT(MPTCP_ADD_ADDR_ECHO))
Since I'll keep the echo argument in mptcp_pm_add_addr_signal(), just use
*echo here.
Like the 'rm_addr' variable in mptcp_pm_rm_addr_signal(), use a new
variable 'add_addr' in mptcp_pm_add_addr_signal() too.
v2:
- drop READ_ONCE()
- drop mptcp_pm_should_add_signal_echo()
- use & instead of &=
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
net/mptcp/pm.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index c9622696716e..792940dbe662 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -257,6 +257,7 @@ bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
struct mptcp_addr_info *saddr, bool *echo, bool *port)
{
int ret = false;
+ u8 add_addr;
spin_lock_bh(&msk->pm.lock);
@@ -271,10 +272,11 @@ bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
goto out_unlock;
*saddr = msk->pm.local;
- if ((msk->pm.addr_signal & BIT(MPTCP_ADD_ADDR_ECHO)))
- WRITE_ONCE(msk->pm.addr_signal, msk->pm.addr_signal & ~BIT(MPTCP_ADD_ADDR_ECHO));
+ if (*echo)
+ add_addr = msk->pm.addr_signal & ~BIT(MPTCP_ADD_ADDR_ECHO);
else
- WRITE_ONCE(msk->pm.addr_signal, msk->pm.addr_signal & ~BIT(MPTCP_ADD_ADDR_SIGNAL));
+ add_addr = msk->pm.addr_signal & ~BIT(MPTCP_ADD_ADDR_SIGNAL);
+ WRITE_ONCE(msk->pm.addr_signal, add_addr);
ret = true;
out_unlock:
--
2.31.1
next reply other threads:[~2021-07-13 6:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-13 6:44 Geliang Tang [this message]
2021-07-13 6:44 ` [MPTCP][PATCH v2 mptcp-next] Squash to "mptcp: build ADD_ADDR/echo-ADD_ADDR option according pm.add_signal" Geliang Tang
2021-07-13 7:32 ` Geliang Tang
2021-07-13 20:39 ` Mat Martineau
2021-07-15 3:17 ` Geliang Tang
2021-07-13 10:30 ` Yonglong Li
2021-07-13 6:44 ` [MPTCP][PATCH mptcp-next] Squash to "mptcp: remove MPTCP_ADD_ADDR_IPV6 and MPTCP_ADD_ADDR_PORT" Geliang Tang
2021-07-13 10:30 ` Yonglong Li
2021-07-14 3:10 ` Geliang Tang
2021-07-14 9:49 ` Yonglong Li
2021-07-15 3:45 ` Geliang Tang
2021-07-15 6:13 ` Yonglong Li
2021-07-13 7:30 ` [MPTCP][PATCH v2 mptcp-next] Squash to "mptcp: fix ADD_ADDR and RM_ADDR maybe flush addr_signal each other" Geliang Tang
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=756dcceaa255c54b7bd195c719ede1f7ae791eb3.1626158100.git.geliangtang@gmail.com \
--to=geliangtang@gmail.com \
--cc=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;
as well as URLs for NNTP newsgroup(s).