All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-next v2 0/3] fullmesh flag setting support
@ 2022-01-11  2:42 Geliang Tang
  2022-01-11  2:42 ` [PATCH mptcp-next v2 1/3] mptcp: set fullmesh flag in pm_netlink Geliang Tang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Geliang Tang @ 2022-01-11  2:42 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

v2:
 - add MPTCP_PM_ADDR_FLAG_NOFULLMESH instead of MPTCP_PM_CMD_CLEAR_FLAGS

Added the fullmesh flag setting support:
 # pm_nl_ctl set 10.0.1.1 flags fullmesh
 # pm_nl_ctl set 10.0.1.1 flags nofullmesh

Geliang Tang (3):
  mptcp: set fullmesh flag in pm_netlink
  selftests: mptcp: set fullmesh flag in pm_nl_ctl
  selftests: mptcp: add fullmesh setting tests

 include/uapi/linux/mptcp.h                    |  1 +
 net/mptcp/pm_netlink.c                        | 27 +++++++++++++-----
 .../testing/selftests/net/mptcp/mptcp_join.sh | 28 +++++++++++++++----
 tools/testing/selftests/net/mptcp/pm_nl_ctl.c |  6 +++-
 4 files changed, 49 insertions(+), 13 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH mptcp-next v2 1/3] mptcp: set fullmesh flag in pm_netlink
  2022-01-11  2:42 [PATCH mptcp-next v2 0/3] fullmesh flag setting support Geliang Tang
@ 2022-01-11  2:42 ` Geliang Tang
  2022-01-11  9:32   ` Paolo Abeni
  2022-01-11  2:42 ` [PATCH mptcp-next v2 2/3] selftests: mptcp: set fullmesh flag in pm_nl_ctl Geliang Tang
  2022-01-11  2:42 ` [PATCH mptcp-next v2 3/3] selftests: mptcp: add fullmesh setting tests Geliang Tang
  2 siblings, 1 reply; 6+ messages in thread
From: Geliang Tang @ 2022-01-11  2:42 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

This patch added the fullmesh flag setting support in pm_netlink.

If the fullmesh flag of the address is changed, remove all the related
subflows, update the fullmesh flag and create subflows again.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 include/uapi/linux/mptcp.h |  1 +
 net/mptcp/pm_netlink.c     | 27 ++++++++++++++++++++-------
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
index f106a3941cdf..16758e124e51 100644
--- a/include/uapi/linux/mptcp.h
+++ b/include/uapi/linux/mptcp.h
@@ -81,6 +81,7 @@ enum {
 #define MPTCP_PM_ADDR_FLAG_SUBFLOW			(1 << 1)
 #define MPTCP_PM_ADDR_FLAG_BACKUP			(1 << 2)
 #define MPTCP_PM_ADDR_FLAG_FULLMESH			(1 << 3)
+#define MPTCP_PM_ADDR_FLAG_NOFULLMESH			(1 << 4)
 
 enum {
 	MPTCP_PM_CMD_UNSPEC,
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 47ad00d01cf2..1cdaa774cafc 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1743,13 +1743,17 @@ static int mptcp_nl_cmd_set_flags(struct sk_buff *skb, struct genl_info *info)
 	struct pm_nl_pernet *pernet = genl_info_pm_nl(info);
 	struct net *net = sock_net(skb->sk);
 	u8 bkup = 0, lookup_by_id = 0;
+	u8 fullmesh = 0;
 	int ret;
 
 	ret = mptcp_pm_parse_addr(attr, info, false, &addr);
 	if (ret < 0)
 		return ret;
 
-	if (addr.flags & MPTCP_PM_ADDR_FLAG_BACKUP)
+	if (addr.flags & MPTCP_PM_ADDR_FLAG_FULLMESH ||
+	    addr.flags & MPTCP_PM_ADDR_FLAG_NOFULLMESH)
+		fullmesh = 1;
+	else if (addr.flags & MPTCP_PM_ADDR_FLAG_BACKUP)
 		bkup = 1;
 	if (addr.addr.family == AF_UNSPEC) {
 		lookup_by_id = 1;
@@ -1760,12 +1764,21 @@ static int mptcp_nl_cmd_set_flags(struct sk_buff *skb, struct genl_info *info)
 	list_for_each_entry(entry, &pernet->local_addr_list, list) {
 		if ((!lookup_by_id && addresses_equal(&entry->addr, &addr.addr, true)) ||
 		    (lookup_by_id && entry->addr.id == addr.addr.id)) {
-			mptcp_nl_addr_backup(net, &entry->addr, bkup);
-
-			if (bkup)
-				entry->flags |= MPTCP_PM_ADDR_FLAG_BACKUP;
-			else
-				entry->flags &= ~MPTCP_PM_ADDR_FLAG_BACKUP;
+			if (fullmesh) {
+				mptcp_nl_remove_subflow_and_signal_addr(net, &entry->addr);
+				if (addr.flags & MPTCP_PM_ADDR_FLAG_FULLMESH)
+					entry->flags |= MPTCP_PM_ADDR_FLAG_FULLMESH;
+				else
+					entry->flags &= ~MPTCP_PM_ADDR_FLAG_FULLMESH;
+				mptcp_nl_add_subflow_or_signal_addr(net);
+			} else {
+				mptcp_nl_addr_backup(net, &entry->addr, bkup);
+
+				if (bkup)
+					entry->flags |= MPTCP_PM_ADDR_FLAG_BACKUP;
+				else
+					entry->flags &= ~MPTCP_PM_ADDR_FLAG_BACKUP;
+			}
 		}
 	}
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH mptcp-next v2 2/3] selftests: mptcp: set fullmesh flag in pm_nl_ctl
  2022-01-11  2:42 [PATCH mptcp-next v2 0/3] fullmesh flag setting support Geliang Tang
  2022-01-11  2:42 ` [PATCH mptcp-next v2 1/3] mptcp: set fullmesh flag in pm_netlink Geliang Tang
@ 2022-01-11  2:42 ` Geliang Tang
  2022-01-11  2:42 ` [PATCH mptcp-next v2 3/3] selftests: mptcp: add fullmesh setting tests Geliang Tang
  2 siblings, 0 replies; 6+ messages in thread
From: Geliang Tang @ 2022-01-11  2:42 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

This patch added the fullmesh flag setting and clearing support in
pm_nl_ctl:

 # pm_nl_ctl set ip flags fullmesh
 # pm_nl_ctl set ip flags nofullmesh

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
index 354784512748..db8b9fdb49d6 100644
--- a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
+++ b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
@@ -28,7 +28,7 @@ static void syntax(char *argv[])
 	fprintf(stderr, "\tadd [flags signal|subflow|backup|fullmesh] [id <nr>] [dev <name>] <ip>\n");
 	fprintf(stderr, "\tdel <id> [<ip>]\n");
 	fprintf(stderr, "\tget <id>\n");
-	fprintf(stderr, "\tset <ip> [flags backup|nobackup]\n");
+	fprintf(stderr, "\tset <ip> [flags backup|nobackup|fullmesh|nofullmesh]\n");
 	fprintf(stderr, "\tflush\n");
 	fprintf(stderr, "\tdump\n");
 	fprintf(stderr, "\tlimits [<rcv addr max> <subflow max>]\n");
@@ -709,6 +709,10 @@ int set_flags(int fd, int pm_family, int argc, char *argv[])
 			     str = NULL) {
 				if (!strcmp(tok, "backup"))
 					flags |= MPTCP_PM_ADDR_FLAG_BACKUP;
+				else if (!strcmp(tok, "fullmesh"))
+					flags |= MPTCP_PM_ADDR_FLAG_FULLMESH;
+				else if (!strcmp(tok, "nofullmesh"))
+					flags |= MPTCP_PM_ADDR_FLAG_NOFULLMESH;
 				else if (strcmp(tok, "nobackup"))
 					error(1, errno,
 					      "unknown flag %s", argv[arg]);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH mptcp-next v2 3/3] selftests: mptcp: add fullmesh setting tests
  2022-01-11  2:42 [PATCH mptcp-next v2 0/3] fullmesh flag setting support Geliang Tang
  2022-01-11  2:42 ` [PATCH mptcp-next v2 1/3] mptcp: set fullmesh flag in pm_netlink Geliang Tang
  2022-01-11  2:42 ` [PATCH mptcp-next v2 2/3] selftests: mptcp: set fullmesh flag in pm_nl_ctl Geliang Tang
@ 2022-01-11  2:42 ` Geliang Tang
  2 siblings, 0 replies; 6+ messages in thread
From: Geliang Tang @ 2022-01-11  2:42 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

This patch added the fullmesh setting and clearing selftests in
mptcp_join.sh.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 .../testing/selftests/net/mptcp/mptcp_join.sh | 28 +++++++++++++++----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index e48ce23d2386..2868e2657ca1 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -289,7 +289,7 @@ do_transfer()
 	addr_nr_ns1="$7"
 	addr_nr_ns2="$8"
 	speed="$9"
-	bkup="${10}"
+	sflags="${10}"
 
 	port=$((10000+$TEST_COUNT))
 	TEST_COUNT=$((TEST_COUNT+1))
@@ -461,13 +461,13 @@ do_transfer()
 		fi
 	fi
 
-	if [ ! -z $bkup ]; then
+	if [ ! -z $sflags ]; then
 		sleep 1
 		for netns in "$ns1" "$ns2"; do
 			dump=(`ip netns exec $netns ./pm_nl_ctl dump`)
 			if [ ${#dump[@]} -gt 0 ]; then
 				addr=${dump[${#dump[@]} - 1]}
-				backup="ip netns exec $netns ./pm_nl_ctl set $addr flags $bkup"
+				backup="ip netns exec $netns ./pm_nl_ctl set $addr flags $sflags"
 				$backup
 			fi
 		done
@@ -545,7 +545,7 @@ run_tests()
 	addr_nr_ns1="${5:-0}"
 	addr_nr_ns2="${6:-0}"
 	speed="${7:-fast}"
-	bkup="${8:-""}"
+	sflags="${8:-""}"
 	lret=0
 	oldin=""
 
@@ -574,7 +574,7 @@ run_tests()
 	fi
 
 	do_transfer ${listener_ns} ${connector_ns} MPTCP MPTCP ${connect_addr} \
-		${test_linkfail} ${addr_nr_ns1} ${addr_nr_ns2} ${speed} ${bkup}
+		${test_linkfail} ${addr_nr_ns1} ${addr_nr_ns2} ${speed} ${sflags}
 	lret=$?
 }
 
@@ -1921,6 +1921,24 @@ fullmesh_tests()
 	run_tests $ns1 $ns2 10.0.1.1 0 0 fullmesh_2 slow
 	chk_join_nr "fullmesh test 1x2, limited" 4 4 4
 	chk_add_nr 1 1
+
+	# set fullmesh flag
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 4 4
+	ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags subflow
+	ip netns exec $ns2 ./pm_nl_ctl limits 4 4
+	run_tests $ns1 $ns2 10.0.1.1 0 0 1 slow fullmesh
+	chk_join_nr "set fullmesh flag test" 2 2 2
+	chk_rm_nr 1 1
+
+	# set nofullmesh flag
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 4 4
+	ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags subflow,fullmesh
+	ip netns exec $ns2 ./pm_nl_ctl limits 4 4
+	run_tests $ns1 $ns2 10.0.1.1 0 0 fullmesh_1 slow nofullmesh
+	chk_join_nr "set nofullmesh flag test" 2 2 2
+	chk_rm_nr 1 1
 }
 
 userspace_tests()
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH mptcp-next v2 1/3] mptcp: set fullmesh flag in pm_netlink
  2022-01-11  2:42 ` [PATCH mptcp-next v2 1/3] mptcp: set fullmesh flag in pm_netlink Geliang Tang
@ 2022-01-11  9:32   ` Paolo Abeni
  0 siblings, 0 replies; 6+ messages in thread
From: Paolo Abeni @ 2022-01-11  9:32 UTC (permalink / raw)
  To: Geliang Tang, mptcp

Hello,

On Tue, 2022-01-11 at 10:42 +0800, Geliang Tang wrote:
> This patch added the fullmesh flag setting support in pm_netlink.
> 
> If the fullmesh flag of the address is changed, remove all the related
> subflows, update the fullmesh flag and create subflows again.
> 
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
>  include/uapi/linux/mptcp.h |  1 +
>  net/mptcp/pm_netlink.c     | 27 ++++++++++++++++++++-------
>  2 files changed, 21 insertions(+), 7 deletions(-)
> 
> diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
> index f106a3941cdf..16758e124e51 100644
> --- a/include/uapi/linux/mptcp.h
> +++ b/include/uapi/linux/mptcp.h
> @@ -81,6 +81,7 @@ enum {
>  #define MPTCP_PM_ADDR_FLAG_SUBFLOW			(1 << 1)
>  #define MPTCP_PM_ADDR_FLAG_BACKUP			(1 << 2)
>  #define MPTCP_PM_ADDR_FLAG_FULLMESH			(1 << 3)
> +#define MPTCP_PM_ADDR_FLAG_NOFULLMESH			(1 << 4)
>  
>  enum {
>  	MPTCP_PM_CMD_UNSPEC,
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index 47ad00d01cf2..1cdaa774cafc 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -1743,13 +1743,17 @@ static int mptcp_nl_cmd_set_flags(struct sk_buff *skb, struct genl_info *info)
>  	struct pm_nl_pernet *pernet = genl_info_pm_nl(info);
>  	struct net *net = sock_net(skb->sk);
>  	u8 bkup = 0, lookup_by_id = 0;
> +	u8 fullmesh = 0;
>  	int ret;
>  
>  	ret = mptcp_pm_parse_addr(attr, info, false, &addr);
>  	if (ret < 0)
>  		return ret;
>  
> -	if (addr.flags & MPTCP_PM_ADDR_FLAG_BACKUP)
> +	if (addr.flags & MPTCP_PM_ADDR_FLAG_FULLMESH ||
> +	    addr.flags & MPTCP_PM_ADDR_FLAG_NOFULLMESH)
> +		fullmesh = 1;
> +	else if (addr.flags & MPTCP_PM_ADDR_FLAG_BACKUP)
>  		bkup = 1;

if I read correctly this is somewhat halfway the two ideas discussed
yday and additionally allows to change either the backup or the
fullmesh flag, but not both simultanusly. I think we we can support
changing both flags with a single command and I think it's better to
stuck with one schema. Just:

	if (addr.flags & MPTCP_PM_ADDR_FLAG_FULLMESH)
		fullmesh = 1;


>  	if (addr.addr.family == AF_UNSPEC) {
>  		lookup_by_id = 1;
> @@ -1760,12 +1764,21 @@ static int mptcp_nl_cmd_set_flags(struct sk_buff *skb, struct genl_info *info)
>  	list_for_each_entry(entry, &pernet->local_addr_list, list) {

Here there is a pre-existing problem, I think. 'local_addr_list' is
protected by pernet->lock or RCU, but this chunk of code does not hold
any of them. The fix will conflict with this series.

>  		if ((!lookup_by_id && addresses_equal(&entry->addr, &addr.addr, true)) ||
>  		    (lookup_by_id && entry->addr.id == addr.addr.id)) {
> -			mptcp_nl_addr_backup(net, &entry->addr, bkup);
> -
> -			if (bkup)
> -				entry->flags |= MPTCP_PM_ADDR_FLAG_BACKUP;
> -			else
> -				entry->flags &= ~MPTCP_PM_ADDR_FLAG_BACKUP;
			
I think here it would be better to expand the mptcp_nl_addr_backup()
helper to cope with fullmesh, too (so we traverse the msk socket hash
only once);

static void mptcp_nl_addr_flags(struct net *net,
                                struct mptcp_addr_info *addr,
                                u8 bkup, u8 fullmesh)
{
        long s_slot = 0, s_num = 0;
        struct mptcp_sock *msk;

        while ((msk = mptcp_token_iter_next(net, &s_slot, &s_num)) != NULL) {
                struct sock *sk = (struct sock *)msk;

                if (list_empty(&msk->conn_list) || mptcp_pm_is_userspace(msk))
                        goto next;

                lock_sock(sk);
                spin_lock_bh(&msk->pm.lock);
                mptcp_pm_nl_mp_prio_send_ack(msk, addr, bkup);

		/* this should create/delete subflows as needed.
		  if 'addr' is MPTCP_PM_ADDR_FLAG_SIGNAL is a no-op 
*/
		mptcp_pm_nl_fullmesh(msk, addr, fullmesh);
                spin_unlock_bh(&msk->pm.lock);
                release_sock(sk);

next:
                sock_put(sk);
                cond_resched();
        }
}



> +			if (fullmesh) {
> +				mptcp_nl_remove_subflow_and_signal_addr(net, &entry->addr);
> +				if (addr.flags & MPTCP_PM_ADDR_FLAG_FULLMESH)
> +					entry->flags |= MPTCP_PM_ADDR_FLAG_FULLMESH;
> +				else
> +					entry->flags &= ~MPTCP_PM_ADDR_FLAG_FULLMESH;
> +				mptcp_nl_add_subflow_or_signal_addr(net);
> +			} else {
> +				mptcp_nl_addr_backup(net, &entry->addr, bkup);
> +
> +				if (bkup)
> +					entry->flags |= MPTCP_PM_ADDR_FLAG_BACKUP;
> +				else
> +					entry->flags &= ~MPTCP_PM_ADDR_FLAG_BACKUP;
> +			}
>  		}
>  	}
>  


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH mptcp-next v2 1/3] mptcp: set fullmesh flag in pm_netlink
@ 2022-01-15 13:00 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-01-15 13:00 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <503652e15fb983e53f4b20a95eb24dbde773e12e.1641868545.git.geliang.tang@suse.com>
References: <503652e15fb983e53f4b20a95eb24dbde773e12e.1641868545.git.geliang.tang@suse.com>
TO: Geliang Tang <geliang.tang@suse.com>

Hi Geliang,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on mptcp/export]
[also build test WARNING on linus/master next-20220115]
[cannot apply to shuah-kselftest/next v5.16]
[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]

url:    https://github.com/0day-ci/linux/commits/Geliang-Tang/fullmesh-flag-setting-support/20220111-104417
base:   https://github.com/multipath-tcp/mptcp_net-next.git export
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: i386-randconfig-c001 (https://download.01.org/0day-ci/archive/20220115/202201152053.18RZ72y4-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 84654f2733f63dc725a7b3d7c55d56849d2d9358)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/83615876cb132bd3d75b44a28869443648e64a08
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Geliang-Tang/fullmesh-flag-setting-support/20220111-104417
        git checkout 83615876cb132bd3d75b44a28869443648e64a08
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   net/mptcp/pm_netlink.c:63:2: note: Taking false branch
           if (a->family == b->family) {
           ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   net/mptcp/pm_netlink.c:69:16: note: Field 'family' is not equal to 2
           } else if (a->family == AF_INET) {
                         ^
   net/mptcp/pm_netlink.c:69:9: note: '?' condition is false
           } else if (a->family == AF_INET) {
                  ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^
   net/mptcp/pm_netlink.c:69:16: note: Field 'family' is not equal to 2
           } else if (a->family == AF_INET) {
                         ^
   net/mptcp/pm_netlink.c:69:9: note: '?' condition is false
           } else if (a->family == AF_INET) {
                  ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   net/mptcp/pm_netlink.c:69:9: note: Taking false branch
           } else if (a->family == AF_INET) {
                  ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   net/mptcp/pm_netlink.c:72:13: note: Assuming field 'family' is equal to 2
           } else if (b->family == AF_INET) {
                      ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   net/mptcp/pm_netlink.c:72:9: note: '?' condition is false
           } else if (b->family == AF_INET) {
                  ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^
   net/mptcp/pm_netlink.c:72:16: note: Field 'family' is equal to 2
           } else if (b->family == AF_INET) {
                         ^
   net/mptcp/pm_netlink.c:72:9: note: '?' condition is true
           } else if (b->family == AF_INET) {
                  ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   net/mptcp/pm_netlink.c:72:9: note: Taking true branch
           } else if (b->family == AF_INET) {
                  ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   net/mptcp/pm_netlink.c:73:7: note: Calling 'ipv6_addr_v4mapped'
                   if (ipv6_addr_v4mapped(&a->addr6))
                       ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   include/net/ipv6.h:696:43: note: The left operand of '|' is a garbage value
                   (__force unsigned long)(a->s6_addr32[0] | a->s6_addr32[1]) |
                                           ~~~~~~~~~~~~~~~ ^
>> net/mptcp/pm_netlink.c:274:2: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
           list_for_each_entry(entry, &msk->pm.anno_list, list) {
           ^
   include/linux/list.h:632:13: note: expanded from macro 'list_for_each_entry'
                pos = list_next_entry(pos, member))
                      ^
   include/linux/list.h:557:2: note: expanded from macro 'list_next_entry'
           list_entry((pos)->member.next, typeof(*(pos)), member)
           ^
   include/linux/list.h:513:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/container_of.h:18:25: note: expanded from macro 'container_of'
           void *__mptr = (void *)(ptr);                                   \
                                  ^
   net/mptcp/pm_netlink.c:514:15: note: Assuming the condition is false
           if (unlikely(!(msk->pm.status & BIT(MPTCP_PM_MPC_ENDPOINT_ACCOUNTED))) && msk->first) {
                        ^
   include/linux/compiler.h:48:41: note: expanded from macro 'unlikely'
   #  define unlikely(x)   (__branch_check__(x, 0, __builtin_constant_p(x)))
                                             ^
   include/linux/compiler.h:33:34: note: expanded from macro '__branch_check__'
                           ______r = __builtin_expect(!!(x), expect);      \
                                                         ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   net/mptcp/pm_netlink.c:514:73: note: Left side of '&&' is false
           if (unlikely(!(msk->pm.status & BIT(MPTCP_PM_MPC_ENDPOINT_ACCOUNTED))) && msk->first) {
                                                                                  ^
   net/mptcp/pm_netlink.c:514:2: note: '?' condition is false
           if (unlikely(!(msk->pm.status & BIT(MPTCP_PM_MPC_ENDPOINT_ACCOUNTED))) && msk->first) {
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^
   net/mptcp/pm_netlink.c:514:73: note: Left side of '&&' is false
           if (unlikely(!(msk->pm.status & BIT(MPTCP_PM_MPC_ENDPOINT_ACCOUNTED))) && msk->first) {
                                                                                  ^
   net/mptcp/pm_netlink.c:514:2: note: '?' condition is false
           if (unlikely(!(msk->pm.status & BIT(MPTCP_PM_MPC_ENDPOINT_ACCOUNTED))) && msk->first) {
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   net/mptcp/pm_netlink.c:514:2: note: Taking false branch
           if (unlikely(!(msk->pm.status & BIT(MPTCP_PM_MPC_ENDPOINT_ACCOUNTED))) && msk->first) {
           ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   net/mptcp/pm_netlink.c:526:2: note: '?' condition is false
           pr_debug("local %d:%d signal %d:%d subflows %d:%d\n",
           ^
   include/linux/printk.h:574:2: note: expanded from macro 'pr_debug'
           dynamic_pr_debug(fmt, ##__VA_ARGS__)
           ^
   include/linux/dynamic_debug.h:162:2: note: expanded from macro 'dynamic_pr_debug'
           _dynamic_func_call(fmt, __dynamic_pr_debug,             \
           ^
   include/linux/dynamic_debug.h:152:2: note: expanded from macro '_dynamic_func_call'
           __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
           ^
   include/linux/dynamic_debug.h:133:2: note: expanded from macro '__dynamic_func_call'
           if (DYNAMIC_DEBUG_BRANCH(id))                   \
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^
   net/mptcp/pm_netlink.c:526:2: note: '?' condition is false
           pr_debug("local %d:%d signal %d:%d subflows %d:%d\n",
           ^
   include/linux/printk.h:574:2: note: expanded from macro 'pr_debug'
           dynamic_pr_debug(fmt, ##__VA_ARGS__)
           ^
   include/linux/dynamic_debug.h:162:2: note: expanded from macro 'dynamic_pr_debug'
           _dynamic_func_call(fmt, __dynamic_pr_debug,             \
           ^
   include/linux/dynamic_debug.h:152:2: note: expanded from macro '_dynamic_func_call'
           __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
           ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'

vim +274 net/mptcp/pm_netlink.c

01cacb00b35cb6 Paolo Abeni      2020-03-27  265  
d88c476f4a7dd6 Geliang Tang     2021-03-26  266  struct mptcp_pm_add_entry *
d88c476f4a7dd6 Geliang Tang     2021-03-26  267  mptcp_lookup_anno_list_by_saddr(struct mptcp_sock *msk,
b6c08380860b92 Geliang Tang     2020-09-24  268  				struct mptcp_addr_info *addr)
b6c08380860b92 Geliang Tang     2020-09-24  269  {
0abd40f823cbd3 Geliang Tang     2020-09-24  270  	struct mptcp_pm_add_entry *entry;
b6c08380860b92 Geliang Tang     2020-09-24  271  
3abc05d9ef6fe9 Florian Westphal 2021-02-04  272  	lockdep_assert_held(&msk->pm.lock);
3abc05d9ef6fe9 Florian Westphal 2021-02-04  273  
b6c08380860b92 Geliang Tang     2020-09-24 @274  	list_for_each_entry(entry, &msk->pm.anno_list, list) {
60b57bf76cfff5 Geliang Tang     2021-02-01  275  		if (addresses_equal(&entry->addr, addr, true))
00cfd77b9063dc Geliang Tang     2020-09-24  276  			return entry;
b6c08380860b92 Geliang Tang     2020-09-24  277  	}
b6c08380860b92 Geliang Tang     2020-09-24  278  
00cfd77b9063dc Geliang Tang     2020-09-24  279  	return NULL;
00cfd77b9063dc Geliang Tang     2020-09-24  280  }
00cfd77b9063dc Geliang Tang     2020-09-24  281  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-15 13:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11  2:42 [PATCH mptcp-next v2 0/3] fullmesh flag setting support Geliang Tang
2022-01-11  2:42 ` [PATCH mptcp-next v2 1/3] mptcp: set fullmesh flag in pm_netlink Geliang Tang
2022-01-11  9:32   ` Paolo Abeni
2022-01-11  2:42 ` [PATCH mptcp-next v2 2/3] selftests: mptcp: set fullmesh flag in pm_nl_ctl Geliang Tang
2022-01-11  2:42 ` [PATCH mptcp-next v2 3/3] selftests: mptcp: add fullmesh setting tests Geliang Tang
2022-01-15 13:00 [PATCH mptcp-next v2 1/3] mptcp: set fullmesh flag in pm_netlink kernel test robot

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.