[PATCH mptcp-net v2 5/5] mptcp: remove pr_fallback()

Paolo Abeni posted 5 patches 2 months, 2 weeks ago
There is a newer version of this series
[PATCH mptcp-net v2 5/5] mptcp: remove pr_fallback()
Posted by Paolo Abeni 2 months, 2 weeks ago
We can now track fully the fallback status of a given connection
via the relevant mibs, the mentioned helper is redundant. Remove
it completely.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/mptcp/options.c  | 1 -
 net/mptcp/protocol.c | 1 -
 net/mptcp/protocol.h | 3 ---
 net/mptcp/subflow.c  | 2 --
 4 files changed, 7 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index c9e1f3ec3772..878bb147409c 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -980,7 +980,6 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
 		subflow->mp_capable = 0;
 		if (mptcp_do_fallback(ssk, MPTCP_MIB_DATA_FALLBACK))
 			goto reset;
-		pr_fallback(msk);
 		return false;
 	}
 
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 5f99f02c827c..397a135cb811 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1166,7 +1166,6 @@ static void mptcp_update_infinite_map(struct mptcp_sock *msk,
 	}
 
 	mptcp_subflow_ctx(ssk)->send_infinite_map = 0;
-	pr_fallback(msk);
 }
 
 #define MPTCP_MAX_GSO_SIZE (GSO_LEGACY_MAX_SIZE - (MAX_TCP_HEADER + 1))
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index ceb2f2ba2cc7..d39991c90582 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1254,13 +1254,10 @@ static inline bool mptcp_do_fallback(struct sock *ssk, int fb_mib)
 	return true;
 }
 
-#define pr_fallback(a) pr_debug("%s:fallback to TCP (msk=%p)\n", __func__, a)
-
 static inline void mptcp_early_fallback(struct mptcp_sock *msk,
 					struct mptcp_subflow_context *subflow,
 					int fb_mib)
 {
-	pr_fallback(msk);
 	subflow->request_mptcp = 0;
 	__mptcp_do_fallback(msk, fb_mib);
 }
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index e140d032eb3e..af9f09b8736a 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -548,7 +548,6 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
 					    MPTCP_MIB_MPCAPABLEACTIVEFALLBACK))
 				goto do_reset;
 
-			pr_fallback(msk);
 			goto fallback;
 		}
 
@@ -1859,7 +1858,6 @@ static void subflow_state_change(struct sock *sk)
 	msk = mptcp_sk(parent);
 	if (subflow_simultaneous_connect(sk)) {
 		mptcp_do_fallback(sk, MPTCP_MIB_SIMULT_FALLBACK);
-		pr_fallback(msk);
 		subflow->conn_finished = 1;
 		mptcp_propagate_state(parent, sk, subflow, NULL);
 	}
-- 
2.49.0
Re: [PATCH mptcp-net v2 5/5] mptcp: remove pr_fallback()
Posted by kernel test robot 2 months, 2 weeks ago
Hi Paolo,

kernel test robot noticed the following build warnings:

[auto build test WARNING on mptcp/export]
[also build test WARNING on mptcp/export-net linus/master v6.16-rc4 next-20250704]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paolo-Abeni/mptcp-make-fallback-action-and-fallback-decision-atomic/20250705-152610
base:   https://github.com/multipath-tcp/mptcp_net-next.git export
patch link:    https://lore.kernel.org/r/189eef71d3406ce2931e6d9442c0c5bba1df42fa.1751700000.git.pabeni%40redhat.com
patch subject: [PATCH mptcp-net v2 5/5] mptcp: remove pr_fallback()
config: arm-randconfig-001-20250705 (https://download.01.org/0day-ci/archive/20250706/202507060115.0WOIqNXG-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250706/202507060115.0WOIqNXG-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507060115.0WOIqNXG-lkp@intel.com/

All warnings (new ones prefixed by >>):

   net/mptcp/subflow.c: In function 'subflow_state_change':
>> net/mptcp/subflow.c:1854:28: warning: variable 'msk' set but not used [-Wunused-but-set-variable]
    1854 |         struct mptcp_sock *msk;
         |                            ^~~


vim +/msk +1854 net/mptcp/subflow.c

648ef4b88673dad Mat Martineau    2020-01-21  1849  
648ef4b88673dad Mat Martineau    2020-01-21  1850  static void subflow_state_change(struct sock *sk)
648ef4b88673dad Mat Martineau    2020-01-21  1851  {
648ef4b88673dad Mat Martineau    2020-01-21  1852  	struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
dc093db5cc052b7 Paolo Abeni      2020-03-13  1853  	struct sock *parent = subflow->conn;
81c1d029016001f Paolo Abeni      2023-06-20 @1854  	struct mptcp_sock *msk;
648ef4b88673dad Mat Martineau    2020-01-21  1855  
648ef4b88673dad Mat Martineau    2020-01-21  1856  	__subflow_state_change(sk);
648ef4b88673dad Mat Martineau    2020-01-21  1857  
81c1d029016001f Paolo Abeni      2023-06-20  1858  	msk = mptcp_sk(parent);
8fd738049ac3d67 Davide Caratti   2020-06-29  1859  	if (subflow_simultaneous_connect(sk)) {
be9cad90d7343cf Paolo Abeni      2025-07-05  1860  		mptcp_do_fallback(sk, MPTCP_MIB_SIMULT_FALLBACK);
8fd738049ac3d67 Davide Caratti   2020-06-29  1861  		subflow->conn_finished = 1;
e4a0fa47e816e18 Paolo Abeni      2024-02-08  1862  		mptcp_propagate_state(parent, sk, subflow, NULL);
8fd738049ac3d67 Davide Caratti   2020-06-29  1863  	}
8fd738049ac3d67 Davide Caratti   2020-06-29  1864  
648ef4b88673dad Mat Martineau    2020-01-21  1865  	/* as recvmsg() does not acquire the subflow socket for ssk selection
648ef4b88673dad Mat Martineau    2020-01-21  1866  	 * a fin packet carrying a DSS can be unnoticed if we don't trigger
648ef4b88673dad Mat Martineau    2020-01-21  1867  	 * the data available machinery here.
648ef4b88673dad Mat Martineau    2020-01-21  1868  	 */
e1ff9e82e2ea53d Davide Caratti   2020-06-29  1869  	if (mptcp_subflow_data_available(sk))
2e52213c79c0b94 Florian Westphal 2020-02-26  1870  		mptcp_data_ready(parent, sk);
499ada5073361c6 Paolo Abeni      2021-06-10  1871  	else if (unlikely(sk->sk_err))
499ada5073361c6 Paolo Abeni      2021-06-10  1872  		subflow_error_report(sk);
648ef4b88673dad Mat Martineau    2020-01-21  1873  
40947e13997a1cb Florian Westphal 2021-02-12  1874  	subflow_sched_work_if_closed(mptcp_sk(parent), sk);
648ef4b88673dad Mat Martineau    2020-01-21  1875  }
648ef4b88673dad Mat Martineau    2020-01-21  1876  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH mptcp-net v2 5/5] mptcp: remove pr_fallback()
Posted by Matthieu Baerts 2 months, 1 week ago
Hi Paolo,

On 05/07/2025 09:24, Paolo Abeni wrote:
> We can now track fully the fallback status of a given connection
> via the relevant mibs, the mentioned helper is redundant. Remove
> it completely.

I don't often use the pr_debug(), but I don't know about the other devs.

If removing this helper is an issue, we could either move this
pr_fallback() in __mptcp_do_fallback(), or also add a pr_debug() in the
macro to incrementing any MPTCP MIB counter?

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.