All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Krystad <peter.krystad at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] [PATCH] mptcp: Refine some comments
Date: Fri, 17 Jan 2020 17:44:31 -0800	[thread overview]
Message-ID: <20200118014431.9925-1-peter.krystad@linux.intel.com> (raw)

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

squashto: Associate MPTCP context with TCP socket

Signed-off-by: Peter Krystad <peter.krystad(a)linux.intel.com>
---
 net/mptcp/protocol.c | 9 ++++-----
 net/mptcp/subflow.c  | 5 ++++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index ed8f7afd43db..fe5f813b4c13 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -71,10 +71,9 @@ static struct socket *__mptcp_fallback_to_tcp(struct mptcp_sock *msk,
 	return sock;
 }
 
-/* if msk has a single subflow socket, and the mp_capable handshake is not
- * completed yet or has failed - that is, the socket is Not MP Capable,
- * returns it.
- * Otherwise returns NULL
+/* If msk has an initial subflow socket, and the MP_CAPABLE handshake has not
+ * completed yet or has failed, return the subflow socket.
+ * Otherwise return NULL.
  */
 static struct socket *__mptcp_nmpc_socket(const struct mptcp_sock *msk)
 {
@@ -139,7 +138,7 @@ static struct socket *__mptcp_socket_create(struct mptcp_sock *msk, int state)
 	msk->subflow = ssock;
 	subflow = mptcp_subflow_ctx(ssock->sk);
 	list_add(&subflow->node, &msk->conn_list);
-	subflow->request_mptcp = 1; /* @@ if MPTCP enabled */
+	subflow->request_mptcp = 1;
 
 set_state:
 	if (state != MPTCP_SAME_STATE)
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 34ccaa7bbacd..b36c72ba3dd8 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -841,7 +841,9 @@ int mptcp_subflow_create_socket(struct sock *sk, struct socket **new_sock)
 		return err;
 
 	lock_sock(sf->sk);
-	/* kern socket do not acquire by default net ref, but TCP timer need it
+
+	/* kernel sockets do not by default acquire net ref, but TCP timer
+	 * needs it.
 	 */
 	sf->sk->sk_net_refcnt = 1;
 	get_net(net);
@@ -871,6 +873,7 @@ static struct mptcp_subflow_context *subflow_create_ctx(struct sock *sk,
 	ctx = kzalloc(sizeof(*ctx), priority);
 	if (!ctx)
 		return NULL;
+
 	rcu_assign_pointer(icsk->icsk_ulp_data, ctx);
 	INIT_LIST_HEAD(&ctx->node);
 
-- 
2.17.2

                 reply	other threads:[~2020-01-18  1:44 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=20200118014431.9925-1-peter.krystad@linux.intel.com \
    --to=unknown@example.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.