mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-04-03 12:05:13 +02:00
mptcp: pm: in-kernel: rename 'local_addr_list' to 'endp_list'
A few variables linked to the in-kernel Path-Manager are confusing, and it would help current and future developers, to clarify them. One of them is 'local_addr_list', which in fact represents the list of endpoints, and not only the 'subflow' endpoints. No functional changes intended. Reviewed-by: Geliang Tang <geliang@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20250925-net-next-mptcp-c-flag-laminar-v1-10-ad126cc47c6b@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
e7757b6d3a
commit
35e71e43a5
@@ -17,7 +17,7 @@ static int pm_nl_pernet_id;
|
||||
struct pm_nl_pernet {
|
||||
/* protects pernet updates */
|
||||
spinlock_t lock;
|
||||
struct list_head local_addr_list;
|
||||
struct list_head endp_list;
|
||||
unsigned int addrs;
|
||||
unsigned int stale_loss_cnt;
|
||||
unsigned int endp_signal_max;
|
||||
@@ -110,7 +110,7 @@ select_local_address(const struct pm_nl_pernet *pernet,
|
||||
msk_owned_by_me(msk);
|
||||
|
||||
rcu_read_lock();
|
||||
list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) {
|
||||
list_for_each_entry_rcu(entry, &pernet->endp_list, list) {
|
||||
if (!(entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW))
|
||||
continue;
|
||||
|
||||
@@ -141,7 +141,7 @@ select_signal_address(struct pm_nl_pernet *pernet, const struct mptcp_sock *msk,
|
||||
* Note: removal from the local address list during the msk life-cycle
|
||||
* can lead to additional addresses not being announced.
|
||||
*/
|
||||
list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) {
|
||||
list_for_each_entry_rcu(entry, &pernet->endp_list, list) {
|
||||
if (!test_bit(entry->addr.id, msk->pm.id_avail_bitmap))
|
||||
continue;
|
||||
|
||||
@@ -250,7 +250,7 @@ __lookup_addr_by_id(struct pm_nl_pernet *pernet, unsigned int id)
|
||||
{
|
||||
struct mptcp_pm_addr_entry *entry;
|
||||
|
||||
list_for_each_entry_rcu(entry, &pernet->local_addr_list, list,
|
||||
list_for_each_entry_rcu(entry, &pernet->endp_list, list,
|
||||
lockdep_is_held(&pernet->lock)) {
|
||||
if (entry->addr.id == id)
|
||||
return entry;
|
||||
@@ -263,7 +263,7 @@ __lookup_addr(struct pm_nl_pernet *pernet, const struct mptcp_addr_info *info)
|
||||
{
|
||||
struct mptcp_pm_addr_entry *entry;
|
||||
|
||||
list_for_each_entry_rcu(entry, &pernet->local_addr_list, list,
|
||||
list_for_each_entry_rcu(entry, &pernet->endp_list, list,
|
||||
lockdep_is_held(&pernet->lock)) {
|
||||
if (mptcp_addresses_equal(&entry->addr, info, entry->addr.port))
|
||||
return entry;
|
||||
@@ -413,7 +413,7 @@ fill_local_addresses_vec_fullmesh(struct mptcp_sock *msk,
|
||||
limit_extra_subflows = mptcp_pm_get_limit_extra_subflows(msk);
|
||||
|
||||
rcu_read_lock();
|
||||
list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) {
|
||||
list_for_each_entry_rcu(entry, &pernet->endp_list, list) {
|
||||
bool is_id0;
|
||||
|
||||
if (!(entry->flags & MPTCP_PM_ADDR_FLAG_FULLMESH))
|
||||
@@ -650,7 +650,7 @@ static int mptcp_pm_nl_append_new_local_addr(struct pm_nl_pernet *pernet,
|
||||
*/
|
||||
if (!address_use_port(entry))
|
||||
entry->addr.port = 0;
|
||||
list_for_each_entry(cur, &pernet->local_addr_list, list) {
|
||||
list_for_each_entry(cur, &pernet->endp_list, list) {
|
||||
if (mptcp_addresses_equal(&cur->addr, &entry->addr,
|
||||
cur->addr.port || entry->addr.port)) {
|
||||
/* allow replacing the exiting endpoint only if such
|
||||
@@ -712,9 +712,9 @@ find_next:
|
||||
|
||||
pernet->addrs++;
|
||||
if (!entry->addr.port)
|
||||
list_add_tail_rcu(&entry->list, &pernet->local_addr_list);
|
||||
list_add_tail_rcu(&entry->list, &pernet->endp_list);
|
||||
else
|
||||
list_add_rcu(&entry->list, &pernet->local_addr_list);
|
||||
list_add_rcu(&entry->list, &pernet->endp_list);
|
||||
ret = entry->addr.id;
|
||||
|
||||
out:
|
||||
@@ -1199,7 +1199,7 @@ int mptcp_pm_nl_flush_addrs_doit(struct sk_buff *skb, struct genl_info *info)
|
||||
LIST_HEAD(free_list);
|
||||
|
||||
spin_lock_bh(&pernet->lock);
|
||||
list_splice_init(&pernet->local_addr_list, &free_list);
|
||||
list_splice_init(&pernet->endp_list, &free_list);
|
||||
__reset_counters(pernet);
|
||||
pernet->next_id = 1;
|
||||
bitmap_zero(pernet->id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1);
|
||||
@@ -1464,7 +1464,7 @@ static int __net_init pm_nl_init_net(struct net *net)
|
||||
{
|
||||
struct pm_nl_pernet *pernet = pm_nl_get_pernet(net);
|
||||
|
||||
INIT_LIST_HEAD_RCU(&pernet->local_addr_list);
|
||||
INIT_LIST_HEAD_RCU(&pernet->endp_list);
|
||||
|
||||
/* Cit. 2 subflows ought to be enough for anybody. */
|
||||
pernet->limit_extra_subflows = 2;
|
||||
@@ -1490,7 +1490,7 @@ static void __net_exit pm_nl_exit_net(struct list_head *net_list)
|
||||
* other modifiers, also netns core already waited for a
|
||||
* RCU grace period.
|
||||
*/
|
||||
__flush_addrs(&pernet->local_addr_list);
|
||||
__flush_addrs(&pernet->endp_list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user