[PATCH mptcp-next v2 04/30] mptcp: use mptcp_wnd_end helper

Geliang Tang posted 30 patches 11 months, 3 weeks ago
Maintainers: Matthieu Baerts <matthieu.baerts@tessares.net>, Mat Martineau <martineau@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>, Florian Westphal <fw@strlen.de>, Kishen Maloor <kishen.maloor@intel.com>
There is a newer version of this series
[PATCH mptcp-next v2 04/30] mptcp: use mptcp_wnd_end helper
Posted by Geliang Tang 11 months, 3 weeks ago
Use mptcp_wnd_end() helper defined in net/mptcp/protocol.c, instead of
open-coding it in ack_update_msk().

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 net/mptcp/options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index cd15ec73073e..f40381557788 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -1059,7 +1059,7 @@ static void ack_update_msk(struct mptcp_sock *msk,
 		msk->wnd_end = new_wnd_end;
 
 	/* this assumes mptcp_incoming_options() is invoked after tcp_ack() */
-	if (after64(msk->wnd_end, READ_ONCE(msk->snd_nxt)))
+	if (after64(mptcp_wnd_end(msk), READ_ONCE(msk->snd_nxt)))
 		__mptcp_check_push(sk, ssk);
 
 	if (after64(new_snd_una, old_snd_una)) {
-- 
2.35.3
Re: [PATCH mptcp-next v2 04/30] mptcp: use mptcp_wnd_end helper
Posted by kernel test robot 11 months, 3 weeks ago
Hi Geliang,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.6-rc2 next-20230920]
[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/Geliang-Tang/mptcp-drop-useless-ssk-in-pm_subflow_check_next/20230919-120834
base:   linus/master
patch link:    https://lore.kernel.org/r/61179b15016da6055cc5a33dfdaacdaa30883cfb.1695095289.git.geliang.tang%40suse.com
patch subject: [PATCH mptcp-next v2 04/30] mptcp: use mptcp_wnd_end helper
config: csky-allmodconfig (https://download.01.org/0day-ci/archive/20230921/202309210337.Gf1gTgm6-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230921/202309210337.Gf1gTgm6-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/202309210337.Gf1gTgm6-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from net/mptcp/options.c:13:
   net/mptcp/options.c: In function 'ack_update_msk':
>> net/mptcp/options.c:1062:21: error: implicit declaration of function 'mptcp_wnd_end'; did you mean 'tcp_wnd_end'? [-Werror=implicit-function-declaration]
    1062 |         if (after64(mptcp_wnd_end(msk), READ_ONCE(msk->snd_nxt)))
         |                     ^~~~~~~~~~~~~
   net/mptcp/protocol.h:141:48: note: in definition of macro 'after64'
     141 | #define after64(seq2, seq1)     before64(seq1, seq2)
         |                                                ^~~~
   cc1: some warnings being treated as errors


vim +1062 net/mptcp/options.c

  1034	
  1035	static void ack_update_msk(struct mptcp_sock *msk,
  1036				   struct sock *ssk,
  1037				   struct mptcp_options_received *mp_opt)
  1038	{
  1039		u64 new_wnd_end, new_snd_una, snd_nxt = READ_ONCE(msk->snd_nxt);
  1040		struct sock *sk = (struct sock *)msk;
  1041		u64 old_snd_una;
  1042	
  1043		mptcp_data_lock(sk);
  1044	
  1045		/* avoid ack expansion on update conflict, to reduce the risk of
  1046		 * wrongly expanding to a future ack sequence number, which is way
  1047		 * more dangerous than missing an ack
  1048		 */
  1049		old_snd_una = msk->snd_una;
  1050		new_snd_una = mptcp_expand_seq(old_snd_una, mp_opt->data_ack, mp_opt->ack64);
  1051	
  1052		/* ACK for data not even sent yet? Ignore.*/
  1053		if (unlikely(after64(new_snd_una, snd_nxt)))
  1054			new_snd_una = old_snd_una;
  1055	
  1056		new_wnd_end = new_snd_una + tcp_sk(ssk)->snd_wnd;
  1057	
  1058		if (after64(new_wnd_end, msk->wnd_end))
  1059			msk->wnd_end = new_wnd_end;
  1060	
  1061		/* this assumes mptcp_incoming_options() is invoked after tcp_ack() */
> 1062		if (after64(mptcp_wnd_end(msk), READ_ONCE(msk->snd_nxt)))
  1063			__mptcp_check_push(sk, ssk);
  1064	
  1065		if (after64(new_snd_una, old_snd_una)) {
  1066			__mptcp_snd_una_update(msk, new_snd_una);
  1067			__mptcp_data_acked(sk);
  1068		}
  1069		mptcp_data_unlock(sk);
  1070	
  1071		trace_ack_update_msk(mp_opt->data_ack,
  1072				     old_snd_una, new_snd_una,
  1073				     new_wnd_end, msk->wnd_end);
  1074	}
  1075	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki