All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kishen Maloor <kishen.maloor@intel.com>
To: kishen.maloor@intel.com, mptcp@lists.linux.dev
Subject: [PATCH mptcp-next v3 02/14] mptcp: allow ADD_ADDR reissuance by userspace PMs
Date: Thu, 27 Jan 2022 19:38:24 -0500	[thread overview]
Message-ID: <20220128003836.2732694-3-kishen.maloor@intel.com> (raw)
In-Reply-To: <20220128003836.2732694-1-kishen.maloor@intel.com>

This change allows userspace PM implementations to reissue ADD_ADDR
announcements (if necessary) based on their chosen policy.

Signed-off-by: Kishen Maloor <kishen.maloor@intel.com>
---
 net/mptcp/pm_netlink.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 882988e43d76..726dc0a56fca 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -479,8 +479,16 @@ static bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk,
 
 	lockdep_assert_held(&msk->pm.lock);
 
-	if (mptcp_lookup_anno_list_by_saddr(msk, &entry->addr))
-		return false;
+	add_entry = mptcp_lookup_anno_list_by_saddr(msk, &entry->addr);
+
+	if (add_entry) {
+		if (READ_ONCE(msk->pm.pm_type) == MPTCP_PM_TYPE_KERNEL)
+			return false;
+
+		sk_reset_timer(sk, &add_entry->add_timer,
+			       jiffies + mptcp_get_add_addr_timeout(net));
+		return true;
+	}
 
 	add_entry = kmalloc(sizeof(*add_entry), GFP_ATOMIC);
 	if (!add_entry)
-- 
2.31.1


  parent reply	other threads:[~2022-01-28  0:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28  0:38 [PATCH mptcp-next v3 00/14] mptcp: APIs and self-tests for userspace path management Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 01/14] mptcp: add sysctl param to limit userspace PM activity Kishen Maloor
2022-01-28  6:38   ` Geliang Tang
2022-01-31 22:23     ` Kishen Maloor
2022-02-01 11:49       ` Paolo Abeni
2022-02-01 21:20         ` Kishen Maloor
2022-01-28  0:38 ` Kishen Maloor [this message]
2022-01-28  0:38 ` [PATCH mptcp-next v3 03/14] mptcp: handle local addrs announced by userspace PMs Kishen Maloor
2022-02-01 11:58   ` Paolo Abeni
2022-02-01 21:21     ` Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 04/14] mptcp: read attributes of addr entries managed " Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 05/14] mptcp: netlink: split mptcp_pm_parse_addr into two functions Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 06/14] mptcp: netlink: Add MPTCP_PM_CMD_ANNOUNCE Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 07/14] mptcp: selftests: support MPTCP_PM_CMD_ANNOUNCE Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 08/14] mptcp: netlink: Add MPTCP_PM_CMD_REMOVE Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 09/14] mptcp: selftests: support MPTCP_PM_CMD_REMOVE Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 10/14] mptcp: netlink: allow userspace-driven subflow establishment Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 11/14] mptcp: selftests: support MPTCP_PM_CMD_SUBFLOW_CREATE Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 12/14] mptcp: selftests: support MPTCP_PM_CMD_SUBFLOW_DESTROY Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 13/14] mptcp: selftests: capture netlink events Kishen Maloor
2022-01-28  0:38 ` [PATCH mptcp-next v3 14/14] selftests: mptcp: functional tests for the userspace PM type Kishen Maloor
2022-01-28  6:51   ` Geliang Tang
2022-01-28 19:48     ` Mat Martineau
2022-01-31 22:24       ` Kishen Maloor

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=20220128003836.2732694-3-kishen.maloor@intel.com \
    --to=kishen.maloor@intel.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 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.