Skip to contentSkip to conversation

BPF packet scheduler updates part 4

RFC Superseded Geliang Tang 4 participants 12 messages Aug 23, 2023 – Sep 1, 2023

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover BPF packet scheduler updates part 4

v2:
- keep sched API unchanged.
- use bpf_sk_storage_lookup to get snd_burst from BPF context.
- applied after "add bpf_stale scheduler v3" serise.

v1:

There's a bug in bpf_burst. snd_burst stored in mptcp_burst_storage in BPF context is not used. msk->snd_burst is still used in kernel space. To fix this, add two new interfaces in mptcp_sched_ops to get and set scheduler's paramters from BPF context to kernel space.

Geliang Tang (2):
mptcp: add set/get params wrappers
mptcp: add bpf_burst set/get params

 include/net/bpf_sk_storage.h |  7 +++++
 net/core/bpf_sk_storage.c    |  2 +-
 net/mptcp/protocol.c         |  8 ++---
 net/mptcp/protocol.h         |  2 ++
 net/mptcp/sched.c            | 57 ++++++++++++++++++++++++++++++++++++
 5 files changed, 71 insertions(+), 5 deletions(-)
Signature · 1 line
2.35.3
#1 lore raw

RFC v2 1/2 mptcp: add set/get params wrappers

Add two sched params wrappers: mptcp_sched_set_params() and mptcp_sched_set_params(). Use these wrappers instead of get and set msk->snd_burst directly.

---
 net/mptcp/protocol.c |  8 ++++----
 net/mptcp/protocol.h |  2 ++
 net/mptcp/sched.c    | 18 ++++++++++++++++++
 3 files changed, 24 insertions(+), 4 deletions(-)
net/mptcp/protocol.c +4 -4
index ab3aaf6cacc5..7c1e72bc5576 100644
@@ -1436,7 +1436,7 @@ struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk)
 	subflow->avg_pacing_rate = div_u64((u64)subflow->avg_pacing_rate * wmem +
 					   READ_ONCE(ssk->sk_pacing_rate) * burst,
 					   burst + wmem);
-	msk->snd_burst = burst;
+	mptcp_sched_set_params(msk, burst);
 	return ssk;
 }
 
@@ -1454,7 +1454,7 @@ static void mptcp_update_post_push(struct mptcp_sock *msk,
 
 	dfrag->already_sent += sent;
 
-	msk->snd_burst -= sent;
+	mptcp_sched_set_params(msk, mptcp_sched_get_params(msk) - sent);
 
 	snd_nxt_new += dfrag->already_sent;
 
@@ -1507,7 +1507,7 @@ static int __subflow_push_pending(struct sock *sk, struct sock *ssk,
 		}
 		WRITE_ONCE(msk->first_pending, mptcp_send_next(sk));
 
-		if (msk->snd_burst <= 0 ||
+		if (mptcp_sched_get_params(msk) <= 0 ||
 		    !sk_stream_memory_free(ssk) ||
 		    !mptcp_subflow_active(mptcp_subflow_ctx(ssk))) {
 			err = copied;
@@ -2291,7 +2291,7 @@ bool __mptcp_retransmit_pending_data(struct sock *sk)
 	mptcp_data_unlock(sk);
 
 	msk->first_pending = rtx_head;
-	msk->snd_burst = 0;
+	mptcp_sched_set_params(msk, 0);
 
 	/* be sure to clear the "sent status" on all re-injected fragments */
 	list_for_each_entry(cur, &msk->rtx_queue, list) {
net/mptcp/protocol.h +2 -0
index 12d70ce24843..dbd1881f8f28 100644
@@ -678,6 +678,8 @@ void mptcp_sched_data_set_contexts(const struct mptcp_sock *msk,
 				   struct mptcp_sched_data *data);
 struct mptcp_subflow_context *
 mptcp_subflow_ctx_by_pos(const struct mptcp_sched_data *data, unsigned int pos);
+int mptcp_sched_get_params(struct mptcp_sock *msk);
+int mptcp_sched_set_params(struct mptcp_sock *msk, int burst);
 
 static inline bool __tcp_can_send(const struct sock *ssk)
 {
net/mptcp/sched.c +18 -0
index 2ae3f33bd244..c78ed61290d2 100644
@@ -199,3 +199,21 @@ mptcp_subflow_ctx_by_pos(const struct mptcp_sched_data *data, unsigned int pos)
 		return NULL;
 	return data->contexts[pos];
 }
+
+int mptcp_sched_get_params(struct mptcp_sock *msk)
+{
+	if (msk->sched == &mptcp_sched_default)
+		return msk->snd_burst;
+
+	return 0;
+}
+
+int mptcp_sched_set_params(struct mptcp_sock *msk, int burst)
+{
+	if (msk->sched == &mptcp_sched_default) {
+		msk->snd_burst = burst;
+		return 0;
+	}
+
+	return 0;
+}
Signature · 1 line
2.35.3
#2 lore raw

RFC v2 2/2 mptcp: add bpf_burst set/get params

In reply to Geliang Tang

This patch implements the set/get params interfaces for bpf_burst scheduler.

Export bpf_sk_storage_lookup(), use it to get bpf_local_storage_data from sk->sk_bpf_storage, then get or set its params ptr->snd_burst.

---
 include/net/bpf_sk_storage.h |  7 +++++++
 net/core/bpf_sk_storage.c    |  2 +-
 net/mptcp/sched.c            | 39 ++++++++++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+), 1 deletion(-)
include/net/bpf_sk_storage.h +7 -0
index 2926f1f00d65..805142d59d02 100644
@@ -37,6 +37,8 @@ int bpf_sk_storage_diag_put(struct bpf_sk_storage_diag *diag,
 			    struct sock *sk, struct sk_buff *skb,
 			    int stg_array_type,
 			    unsigned int *res_diag_size);
+struct bpf_local_storage_data *
+bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit);
 #else
 static inline int bpf_sk_storage_clone(const struct sock *sk,
 				       struct sock *newsk)
@@ -58,6 +60,11 @@ static inline int bpf_sk_storage_diag_put(struct bpf_sk_storage_diag *diag,
 {
 	return 0;
 }
+struct bpf_local_storage_data *
+bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit)
+{
+	return NULL;
+}
 #endif
 
 #endif /* _BPF_SK_STORAGE_H */
net/core/bpf_sk_storage.c +1 -1
index cca7594be92e..1c023f65017f 100644
@@ -17,7 +17,7 @@
 
 DEFINE_BPF_STORAGE_CACHE(sk_cache);
 
-static struct bpf_local_storage_data *
+struct bpf_local_storage_data *
 bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit)
 {
 	struct bpf_local_storage *sk_storage;
net/mptcp/sched.c +39 -0
index c78ed61290d2..067df28899a6 100644
@@ -11,6 +11,7 @@
 #include <linux/list.h>
 #include <linux/rculist.h>
 #include <linux/spinlock.h>
+#include <net/bpf_sk_storage.h>
 #include "protocol.h"
 
 static DEFINE_SPINLOCK(mptcp_sched_list_lock);
@@ -202,18 +203,56 @@ mptcp_subflow_ctx_by_pos(const struct mptcp_sched_data *data, unsigned int pos)
 
 int mptcp_sched_get_params(struct mptcp_sock *msk)
 {
+	struct sock *sk = (struct sock *)msk;
+
 	if (msk->sched == &mptcp_sched_default)
 		return msk->snd_burst;
 
+	if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
+	    !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
+		struct bpf_local_storage_data *sdata;
+
+		sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
+		if (sdata) {
+			struct mptcp_burst_storage {
+				int snd_burst;
+			} *ptr;
+
+			ptr = (struct mptcp_burst_storage *)sdata->data;
+			if (ptr)
+				return ptr->snd_burst;
+		}
+	}
+
 	return 0;
 }
 
 int mptcp_sched_set_params(struct mptcp_sock *msk, int burst)
 {
+	struct sock *sk = (struct sock *)msk;
+
 	if (msk->sched == &mptcp_sched_default) {
 		msk->snd_burst = burst;
 		return 0;
 	}
 
+	if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
+	    !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
+		struct bpf_local_storage_data *sdata;
+
+		sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
+		if (sdata) {
+			struct mptcp_burst_storage {
+				int snd_burst;
+			} *ptr;
+
+			ptr = (struct mptcp_burst_storage *)sdata->data;
+			if (ptr) {
+				ptr->snd_burst = burst;
+				return 0;
+			}
+		}
+	}
+
 	return 0;
 }
Signature · 1 line
2.35.3
#3 lore raw

Re: mptcp: add bpf_burst set/get params: Build Failure

Hi Geliang,

Thank you for your modifications, that's great!

But sadly, our CI spotted some issues with it when trying to build it.

You can find more details there:

https://patchwork.kernel.org/project/mptcp/patch/486891cb494ba4e9eeb02b6e220ca670dbc80866.1692788531.git.geliang.tang@suse.com/
https://github.com/multipath-tcp/mptcp_net-next/actions/runs/5950638723

Status: failure
Initiator: MPTCPimporter
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/ac786dd759ba

Feel free to reply to this email if you cannot access logs, if you need some support to fix the error, if this doesn't seem to be caused by your modifications or if the error is a false positive one.

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)

#4 lore raw

Re: mptcp: add bpf_burst set/get params: Tests Results

In reply to Geliang Tang

Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join):
- Unstable: 1 failed test(s): selftest_simult_flows 🔴:
- Task: https://cirrus-ci.com/task/5518608940400640
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5518608940400640/summary/summary.txt

- KVM Validation: debug (only selftest_mptcp_join):
- Unstable: 1 failed test(s): selftest_mptcp_join 🔴:
- Task: https://cirrus-ci.com/task/5729715172933632
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5729715172933632/summary/summary.txt

- KVM Validation: normal (only selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/6644508847243264
- Summary: https://api.cirrus-ci.com/v1/artifact/task/6644508847243264/summary/summary.txt

- KVM Validation: debug (except selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/4603815266091008
- Summary: https://api.cirrus-ci.com/v1/artifact/task/4603815266091008/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/ac786dd759ba

If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker

Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)

#5 lore raw

Re: [RFC mptcp-next v2 2/2] mptcp: add bpf_burst set/get params

In reply to Geliang Tang
kernel test robot noticed the following build warnings:

Hi Geliang,

[This is a private test report for your RFC patch.] kernel test robot noticed the following build warnings:

[auto build test WARNING on mptcp/export]
[cannot apply to mptcp/export-net linus/master v6.5-rc7 next-20230823] [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-add-set-get-params-wrappers/20230823-190626
base:   https://github.com/multipath-tcp/mptcp_net-next.git export
patch link:    https://lore.kernel.org/r/486891cb494ba4e9eeb02b6e220ca670dbc80866.1692788531.git.geliang.tang%40suse.com
patch subject: [RFC mptcp-next v2 2/2] mptcp: add bpf_burst set/get params
config: sparc64-defconfig (https://download.01.org/0day-ci/archive/20230824/[email protected]/config)
compiler: sparc64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230824/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

In file included from net/mptcp/sched.c:14:

>> include/net/bpf_sk_storage.h:64:1: warning: no previous prototype for 'bpf_sk_storage_lookup' [-Wmissing-prototypes]
      64 | bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit)
         | ^~~~~~~~~~~~~~~~~~~~~
   net/mptcp/sched.c: In function 'mptcp_sched_get_params':
   net/mptcp/sched.c:211:15: error: 'struct sock' has no member named 'sk_bpf_storage'
     211 |         if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
         |               ^~
   net/mptcp/sched.c:211:37: error: 'struct sock' has no member named 'sk_bpf_storage'
     211 |         if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
         |                                     ^~
   net/mptcp/sched.c:212:23: error: 'struct sock' has no member named 'sk_bpf_storage'
     212 |             !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
         |                       ^~
   net/mptcp/sched.c:215:54: error: 'struct sock' has no member named 'sk_bpf_storage'
     215 |                 sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
         |                                                      ^~
   net/mptcp/sched.c: In function 'mptcp_sched_set_params':
   net/mptcp/sched.c:239:15: error: 'struct sock' has no member named 'sk_bpf_storage'
     239 |         if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
         |               ^~
   net/mptcp/sched.c:239:37: error: 'struct sock' has no member named 'sk_bpf_storage'
     239 |         if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
         |                                     ^~
   net/mptcp/sched.c:240:23: error: 'struct sock' has no member named 'sk_bpf_storage'
     240 |             !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
         |                       ^~
   net/mptcp/sched.c:243:54: error: 'struct sock' has no member named 'sk_bpf_storage'
     243 |                 sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
         |                                                      ^~

vim +/bpf_sk_storage_lookup +64 include/net/bpf_sk_storage.h

    30	
    31	#ifdef CONFIG_BPF_SYSCALL
    32	int bpf_sk_storage_clone(const struct sock *sk, struct sock *newsk);
    33	struct bpf_sk_storage_diag *
    34	bpf_sk_storage_diag_alloc(const struct nlattr *nla_stgs);
    35	void bpf_sk_storage_diag_free(struct bpf_sk_storage_diag *diag);
    36	int bpf_sk_storage_diag_put(struct bpf_sk_storage_diag *diag,
    37				    struct sock *sk, struct sk_buff *skb,
    38				    int stg_array_type,
    39				    unsigned int *res_diag_size);
    40	struct bpf_local_storage_data *
    41	bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit);
    42	#else
    43	static inline int bpf_sk_storage_clone(const struct sock *sk,
    44					       struct sock *newsk)
    45	{
    46		return 0;
    47	}
    48	static inline struct bpf_sk_storage_diag *
    49	bpf_sk_storage_diag_alloc(const struct nlattr *nla)
    50	{
    51		return NULL;
    52	}
    53	static inline void bpf_sk_storage_diag_free(struct bpf_sk_storage_diag *diag)
    54	{
    55	}
    56	static inline int bpf_sk_storage_diag_put(struct bpf_sk_storage_diag *diag,
    57						  struct sock *sk, struct sk_buff *skb,
    58						  int stg_array_type,
    59						  unsigned int *res_diag_size)
    60	{
    61		return 0;
    62	}
    63	struct bpf_local_storage_data *
  > 64	bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit)
    65	{
    66		return NULL;
    67	}
    68	#endif
    69	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#6 lore raw

Re: [RFC mptcp-next v2 2/2] mptcp: add bpf_burst set/get params

In reply to Geliang Tang
kernel test robot noticed the following build warnings:

Hi Geliang,

[This is a private test report for your RFC patch.] kernel test robot noticed the following build warnings:

[auto build test WARNING on mptcp/export]
[cannot apply to mptcp/export-net linus/master v6.5-rc7 next-20230823] [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-add-set-get-params-wrappers/20230823-190626
base:   https://github.com/multipath-tcp/mptcp_net-next.git export
patch link:    https://lore.kernel.org/r/486891cb494ba4e9eeb02b6e220ca670dbc80866.1692788531.git.geliang.tang%40suse.com
patch subject: [RFC mptcp-next v2 2/2] mptcp: add bpf_burst set/get params
config: um-randconfig-r014-20230823 (https://download.01.org/0day-ci/archive/20230824/[email protected]/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230824/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

In file included from net/mptcp/sched.c:14:
In file included from include/net/bpf_sk_storage.h:11:
In file included from include/linux/bpf.h:31:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:26:
In file included from include/linux/kernel_stat.h:9:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/um/include/asm/hardirq.h:5:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]

     547 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     560 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from net/mptcp/sched.c:14:
   In file included from include/net/bpf_sk_storage.h:11:
   In file included from include/linux/bpf.h:31:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/um/include/asm/hardirq.h:5:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     573 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from net/mptcp/sched.c:14:
   In file included from include/net/bpf_sk_storage.h:11:
   In file included from include/linux/bpf.h:31:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/um/include/asm/hardirq.h:5:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     584 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     594 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     604 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     692 |         readsb(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     700 |         readsw(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     708 |         readsl(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     717 |         writesb(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     726 |         writesw(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     735 |         writesl(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   In file included from net/mptcp/sched.c:14:
>> include/net/bpf_sk_storage.h:64:1: warning: no previous prototype for function 'bpf_sk_storage_lookup' [-Wmissing-prototypes]
      64 | bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit)
         | ^
   include/net/bpf_sk_storage.h:63:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
      63 | struct bpf_local_storage_data *
         | ^
         | static 

net/mptcp/sched.c:211:10: error: no member named 'sk_bpf_storage' in 'struct sock'
211 | if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
| ~~ ^
net/mptcp/sched.c:211:32: error: no member named 'sk_bpf_storage' in 'struct sock'
211 | if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
| ~~ ^
net/mptcp/sched.c:212:18: error: no member named 'sk_bpf_storage' in 'struct sock'
212 | !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
| ~~ ^
net/mptcp/sched.c:215:42: error: no member named 'sk_bpf_storage' in 'struct sock'
215 | sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
| ~~ ^
net/mptcp/sched.c:239:10: error: no member named 'sk_bpf_storage' in 'struct sock'
239 | if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
| ~~ ^
net/mptcp/sched.c:239:32: error: no member named 'sk_bpf_storage' in 'struct sock'
239 | if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
| ~~ ^
net/mptcp/sched.c:240:18: error: no member named 'sk_bpf_storage' in 'struct sock'
240 | !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
| ~~ ^
net/mptcp/sched.c:243:42: error: no member named 'sk_bpf_storage' in 'struct sock'
243 | sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
| ~~ ^
13 warnings and 8 errors generated.
--
In file included from net/core/sock.c:91:
In file included from include/linux/errqueue.h:6:
In file included from include/net/ip.h:22:
In file included from include/linux/ip.h:16:
In file included from include/linux/skbuff.h:17:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:12:
In file included from include/linux/hardirq.h:11:
In file included from arch/um/include/asm/hardirq.h:5:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]

     547 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     560 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from net/core/sock.c:91:
   In file included from include/linux/errqueue.h:6:
   In file included from include/net/ip.h:22:
   In file included from include/linux/ip.h:16:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/um/include/asm/hardirq.h:5:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     573 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from net/core/sock.c:91:
   In file included from include/linux/errqueue.h:6:
   In file included from include/net/ip.h:22:
   In file included from include/linux/ip.h:16:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/um/include/asm/hardirq.h:5:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     584 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     594 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     604 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     692 |         readsb(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     700 |         readsw(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     708 |         readsl(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     717 |         writesb(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     726 |         writesw(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     735 |         writesl(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   In file included from net/core/sock.c:138:
>> include/net/bpf_sk_storage.h:64:1: warning: no previous prototype for function 'bpf_sk_storage_lookup' [-Wmissing-prototypes]
      64 | bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit)
         | ^
   include/net/bpf_sk_storage.h:63:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
      63 | struct bpf_local_storage_data *
         | ^
         | static 

13 warnings generated.

vim +/bpf_sk_storage_lookup +64 include/net/bpf_sk_storage.h

    30	
    31	#ifdef CONFIG_BPF_SYSCALL
    32	int bpf_sk_storage_clone(const struct sock *sk, struct sock *newsk);
    33	struct bpf_sk_storage_diag *
    34	bpf_sk_storage_diag_alloc(const struct nlattr *nla_stgs);
    35	void bpf_sk_storage_diag_free(struct bpf_sk_storage_diag *diag);
    36	int bpf_sk_storage_diag_put(struct bpf_sk_storage_diag *diag,
    37				    struct sock *sk, struct sk_buff *skb,
    38				    int stg_array_type,
    39				    unsigned int *res_diag_size);
    40	struct bpf_local_storage_data *
    41	bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit);
    42	#else
    43	static inline int bpf_sk_storage_clone(const struct sock *sk,
    44					       struct sock *newsk)
    45	{
    46		return 0;
    47	}
    48	static inline struct bpf_sk_storage_diag *
    49	bpf_sk_storage_diag_alloc(const struct nlattr *nla)
    50	{
    51		return NULL;
    52	}
    53	static inline void bpf_sk_storage_diag_free(struct bpf_sk_storage_diag *diag)
    54	{
    55	}
    56	static inline int bpf_sk_storage_diag_put(struct bpf_sk_storage_diag *diag,
    57						  struct sock *sk, struct sk_buff *skb,
    58						  int stg_array_type,
    59						  unsigned int *res_diag_size)
    60	{
    61		return 0;
    62	}
    63	struct bpf_local_storage_data *
  > 64	bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit)
    65	{
    66		return NULL;
    67	}
    68	#endif
    69	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#7 lore raw

Re: [RFC mptcp-next v2 2/2] mptcp: add bpf_burst set/get params

In reply to Geliang Tang
kernel test robot noticed the following build errors:

Hi Geliang,

[This is a private test report for your RFC patch.] kernel test robot noticed the following build errors:

[auto build test ERROR on mptcp/export]
[cannot apply to mptcp/export-net linus/master v6.5-rc7 next-20230823] [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-add-set-get-params-wrappers/20230823-190626
base:   https://github.com/multipath-tcp/mptcp_net-next.git export
patch link:    https://lore.kernel.org/r/486891cb494ba4e9eeb02b6e220ca670dbc80866.1692788531.git.geliang.tang%40suse.com
patch subject: [RFC mptcp-next v2 2/2] mptcp: add bpf_burst set/get params
config: um-randconfig-r014-20230823 (https://download.01.org/0day-ci/archive/20230824/[email protected]/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230824/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from net/mptcp/sched.c:14:
In file included from include/net/bpf_sk_storage.h:11:
In file included from include/linux/bpf.h:31:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:26:
In file included from include/linux/kernel_stat.h:9:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/um/include/asm/hardirq.h:5:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]

     547 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     560 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from net/mptcp/sched.c:14:
   In file included from include/net/bpf_sk_storage.h:11:
   In file included from include/linux/bpf.h:31:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/um/include/asm/hardirq.h:5:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     573 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from net/mptcp/sched.c:14:
   In file included from include/net/bpf_sk_storage.h:11:
   In file included from include/linux/bpf.h:31:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/um/include/asm/hardirq.h:5:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     584 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     594 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     604 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     692 |         readsb(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     700 |         readsw(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     708 |         readsl(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     717 |         writesb(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     726 |         writesw(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     735 |         writesl(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   In file included from net/mptcp/sched.c:14:
   include/net/bpf_sk_storage.h:64:1: warning: no previous prototype for function 'bpf_sk_storage_lookup' [-Wmissing-prototypes]
      64 | bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit)
         | ^
   include/net/bpf_sk_storage.h:63:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
      63 | struct bpf_local_storage_data *
         | ^
         | static 
>> net/mptcp/sched.c:211:10: error: no member named 'sk_bpf_storage' in 'struct sock'

211 | if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
| ~~ ^
net/mptcp/sched.c:211:32: error: no member named 'sk_bpf_storage' in 'struct sock'
211 | if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
| ~~ ^
net/mptcp/sched.c:212:18: error: no member named 'sk_bpf_storage' in 'struct sock'
212 | !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
| ~~ ^
net/mptcp/sched.c:215:42: error: no member named 'sk_bpf_storage' in 'struct sock'
215 | sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
| ~~ ^
net/mptcp/sched.c:239:10: error: no member named 'sk_bpf_storage' in 'struct sock'
239 | if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
| ~~ ^
net/mptcp/sched.c:239:32: error: no member named 'sk_bpf_storage' in 'struct sock'
239 | if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
| ~~ ^
net/mptcp/sched.c:240:18: error: no member named 'sk_bpf_storage' in 'struct sock'
240 | !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
| ~~ ^
net/mptcp/sched.c:243:42: error: no member named 'sk_bpf_storage' in 'struct sock'
243 | sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
| ~~ ^
13 warnings and 8 errors generated.

vim +211 net/mptcp/sched.c

203
204 int mptcp_sched_get_params(struct mptcp_sock *msk)
205 {
206 struct sock *sk = (struct sock *)msk;
207
208 if (msk->sched == &mptcp_sched_default)
209 return msk->snd_burst;
210

 > 211		if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&

212 !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
213 struct bpf_local_storage_data *sdata;
214
215 sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
216 if (sdata) {
217 struct mptcp_burst_storage {
218 int snd_burst;
219 } *ptr;
220
221 ptr = (struct mptcp_burst_storage *)sdata->data;
222 if (ptr)
223 return ptr->snd_burst;
224 }
225 }
226
227 return 0;
228 }
229

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#8 lore raw

Re: [RFC mptcp-next v2 2/2] mptcp: add bpf_burst set/get params

In reply to Geliang Tang
kernel test robot noticed the following build errors:

Hi Geliang,

[This is a private test report for your RFC patch.] kernel test robot noticed the following build errors:

[auto build test ERROR on mptcp/export]
[cannot apply to mptcp/export-net linus/master v6.5-rc7 next-20230823] [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-add-set-get-params-wrappers/20230823-190626
base:   https://github.com/multipath-tcp/mptcp_net-next.git export
patch link:    https://lore.kernel.org/r/486891cb494ba4e9eeb02b6e220ca670dbc80866.1692788531.git.geliang.tang%40suse.com
patch subject: [RFC mptcp-next v2 2/2] mptcp: add bpf_burst set/get params
config: sparc64-defconfig (https://download.01.org/0day-ci/archive/20230824/[email protected]/config)
compiler: sparc64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230824/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from net/mptcp/sched.c:14:
include/net/bpf_sk_storage.h:64:1: warning: no previous prototype for 'bpf_sk_storage_lookup' [-Wmissing-prototypes]
64 | bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit)
| ^~~~~~~~~~~~~~~~~~~~~
net/mptcp/sched.c: In function 'mptcp_sched_get_params':

>> net/mptcp/sched.c:211:15: error: 'struct sock' has no member named 'sk_bpf_storage'
     211 |         if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
         |               ^~
   net/mptcp/sched.c:211:37: error: 'struct sock' has no member named 'sk_bpf_storage'
     211 |         if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
         |                                     ^~
   net/mptcp/sched.c:212:23: error: 'struct sock' has no member named 'sk_bpf_storage'
     212 |             !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
         |                       ^~
   net/mptcp/sched.c:215:54: error: 'struct sock' has no member named 'sk_bpf_storage'
     215 |                 sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
         |                                                      ^~
   net/mptcp/sched.c: In function 'mptcp_sched_set_params':
   net/mptcp/sched.c:239:15: error: 'struct sock' has no member named 'sk_bpf_storage'
     239 |         if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
         |               ^~
   net/mptcp/sched.c:239:37: error: 'struct sock' has no member named 'sk_bpf_storage'
     239 |         if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
         |                                     ^~
   net/mptcp/sched.c:240:23: error: 'struct sock' has no member named 'sk_bpf_storage'
     240 |             !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
         |                       ^~
   net/mptcp/sched.c:243:54: error: 'struct sock' has no member named 'sk_bpf_storage'
     243 |                 sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
         |                                                      ^~

vim +211 net/mptcp/sched.c

203
204 int mptcp_sched_get_params(struct mptcp_sock *msk)
205 {
206 struct sock *sk = (struct sock *)msk;
207
208 if (msk->sched == &mptcp_sched_default)
209 return msk->snd_burst;
210

 > 211		if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&

212 !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
213 struct bpf_local_storage_data *sdata;
214
215 sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
216 if (sdata) {
217 struct mptcp_burst_storage {
218 int snd_burst;
219 } *ptr;
220
221 ptr = (struct mptcp_burst_storage *)sdata->data;
222 if (ptr)
223 return ptr->snd_burst;
224 }
225 }
226
227 return 0;
228 }
229

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#9 lore raw

Re: [RFC mptcp-next v2 2/2] mptcp: add bpf_burst set/get params

In reply to Geliang Tang
kernel test robot noticed the following build warnings:

Hi Geliang,

[This is a private test report for your RFC patch.] kernel test robot noticed the following build warnings:

[auto build test WARNING on mptcp/export]
[cannot apply to mptcp/export-net linus/master v6.5-rc7 next-20230825] [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-add-set-get-params-wrappers/20230823-190626
base:   https://github.com/multipath-tcp/mptcp_net-next.git export
patch link:    https://lore.kernel.org/r/486891cb494ba4e9eeb02b6e220ca670dbc80866.1692788531.git.geliang.tang%40suse.com
patch subject: [RFC mptcp-next v2 2/2] mptcp: add bpf_burst set/get params
config: powerpc-randconfig-r131-20230823 (https://download.01.org/0day-ci/archive/20230826/[email protected]/config)
compiler: powerpc-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230826/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)

>> net/mptcp/sched.c:212:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected char const * @@     got char [noderef] __rcu * @@
   net/mptcp/sched.c:212:39: sparse:     expected char const *
   net/mptcp/sched.c:212:39: sparse:     got char [noderef] __rcu *
>> net/mptcp/sched.c:215:70: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct bpf_map *map @@     got struct bpf_map [noderef] __rcu * @@
   net/mptcp/sched.c:215:70: sparse:     expected struct bpf_map *map
   net/mptcp/sched.c:215:70: sparse:     got struct bpf_map [noderef] __rcu *
   net/mptcp/sched.c:240:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected char const * @@     got char [noderef] __rcu * @@
   net/mptcp/sched.c:240:39: sparse:     expected char const *
   net/mptcp/sched.c:240:39: sparse:     got char [noderef] __rcu *
   net/mptcp/sched.c:243:70: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct bpf_map *map @@     got struct bpf_map [noderef] __rcu * @@
   net/mptcp/sched.c:243:70: sparse:     expected struct bpf_map *map
   net/mptcp/sched.c:243:70: sparse:     got struct bpf_map [noderef] __rcu *
>> net/mptcp/sched.c:211:37: sparse: sparse: dereference of noderef expression

net/mptcp/sched.c:212:23: sparse: sparse: dereference of noderef expression net/mptcp/sched.c:215:54: sparse: sparse: dereference of noderef expression net/mptcp/sched.c:239:37: sparse: sparse: dereference of noderef expression net/mptcp/sched.c:240:23: sparse: sparse: dereference of noderef expression net/mptcp/sched.c:243:54: sparse: sparse: dereference of noderef expression

vim +212 net/mptcp/sched.c

203
204 int mptcp_sched_get_params(struct mptcp_sock *msk)
205 {
206 struct sock *sk = (struct sock *)msk;
207
208 if (msk->sched == &mptcp_sched_default)
209 return msk->snd_burst;
210

 > 211		if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
 > 212		    !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
   213			struct bpf_local_storage_data *sdata;
   214	
 > 215			sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);

216 if (sdata) {
217 struct mptcp_burst_storage {
218 int snd_burst;
219 } *ptr;
220
221 ptr = (struct mptcp_burst_storage *)sdata->data;
222 if (ptr)
223 return ptr->snd_burst;
224 }
225 }
226
227 return 0;
228 }
229

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#10 lore raw

Re: [RFC mptcp-next v2 2/2] mptcp: add bpf_burst set/get params

In reply to Geliang Tang
kernel test robot noticed the following build warnings:

Hi Geliang,

[This is a private test report for your RFC patch.] kernel test robot noticed the following build warnings:

[auto build test WARNING on mptcp/export]
[cannot apply to mptcp/export-net linus/master v6.5-rc7 next-20230825] [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-add-set-get-params-wrappers/20230823-190626
base:   https://github.com/multipath-tcp/mptcp_net-next.git export
patch link:    https://lore.kernel.org/r/486891cb494ba4e9eeb02b6e220ca670dbc80866.1692788531.git.geliang.tang%40suse.com
patch subject: [RFC mptcp-next v2 2/2] mptcp: add bpf_burst set/get params
config: i386-randconfig-061-20230823 (https://download.01.org/0day-ci/archive/20230826/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230826/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)

>> net/mptcp/sched.c:212:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected char const *cs @@     got char [noderef] __rcu * @@

net/mptcp/sched.c:212:39: sparse: expected char const *cs
net/mptcp/sched.c:212:39: sparse: got char [noderef] __rcu *
net/mptcp/sched.c:215:70: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct bpf_map *map @@ got struct bpf_map [noderef] __rcu * @@
net/mptcp/sched.c:215:70: sparse: expected struct bpf_map *map
net/mptcp/sched.c:215:70: sparse: got struct bpf_map [noderef] __rcu *
net/mptcp/sched.c:240:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *cs @@ got char [noderef] __rcu * @@
net/mptcp/sched.c:240:39: sparse: expected char const *cs
net/mptcp/sched.c:240:39: sparse: got char [noderef] __rcu *
net/mptcp/sched.c:243:70: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct bpf_map *map @@ got struct bpf_map [noderef] __rcu * @@
net/mptcp/sched.c:243:70: sparse: expected struct bpf_map *map
net/mptcp/sched.c:243:70: sparse: got struct bpf_map [noderef] __rcu *
net/mptcp/sched.c:211:37: sparse: sparse: dereference of noderef expression net/mptcp/sched.c:212:23: sparse: sparse: dereference of noderef expression net/mptcp/sched.c:215:54: sparse: sparse: dereference of noderef expression net/mptcp/sched.c:239:37: sparse: sparse: dereference of noderef expression net/mptcp/sched.c:240:23: sparse: sparse: dereference of noderef expression net/mptcp/sched.c:243:54: sparse: sparse: dereference of noderef expression

vim +212 net/mptcp/sched.c

203
204 int mptcp_sched_get_params(struct mptcp_sock *msk)
205 {
206 struct sock *sk = (struct sock *)msk;
207
208 if (msk->sched == &mptcp_sched_default)
209 return msk->snd_burst;
210
211 if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&

 > 212		    !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {

213 struct bpf_local_storage_data *sdata;
214
215 sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
216 if (sdata) {
217 struct mptcp_burst_storage {
218 int snd_burst;
219 } *ptr;
220
221 ptr = (struct mptcp_burst_storage *)sdata->data;
222 if (ptr)
223 return ptr->snd_burst;
224 }
225 }
226
227 return 0;
228 }
229

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
maintainer
#11 lore raw

Re: [RFC mptcp-next v2 2/2] mptcp: add bpf_burst set/get params

In reply to Geliang Tang
Quoted 80 lines · Geliang Tang

This patch implements the set/get params interfaces for bpf_burst scheduler.

Export bpf_sk_storage_lookup(), use it to get bpf_local_storage_data from sk->sk_bpf_storage, then get or set its params ptr->snd_burst.

---

include/net/bpf_sk_storage.h |  7 +++++++
net/core/bpf_sk_storage.c    |  2 +-
net/mptcp/sched.c            | 39 ++++++++++++++++++++++++++++++++++++
3 files changed, 47 insertions(+), 1 deletion(-)
include/net/bpf_sk_storage.h +7 -0
index 2926f1f00d65..805142d59d02 100644
@@ -37,6 +37,8 @@ int bpf_sk_storage_diag_put(struct bpf_sk_storage_diag *diag,
 			    struct sock *sk, struct sk_buff *skb,
 			    int stg_array_type,
 			    unsigned int *res_diag_size);
+struct bpf_local_storage_data *
+bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit);
 #else
 static inline int bpf_sk_storage_clone(const struct sock *sk,
 				       struct sock *newsk)
@@ -58,6 +60,11 @@ static inline int bpf_sk_storage_diag_put(struct bpf_sk_storage_diag *diag,
 {
 	return 0;
 }
+struct bpf_local_storage_data *
+bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit)
+{
+	return NULL;
+}
 #endif
 
 #endif /* _BPF_SK_STORAGE_H */
net/core/bpf_sk_storage.c +1 -1
index cca7594be92e..1c023f65017f 100644
@@ -17,7 +17,7 @@
 
 DEFINE_BPF_STORAGE_CACHE(sk_cache);
 
-static struct bpf_local_storage_data *
+struct bpf_local_storage_data *
 bpf_sk_storage_lookup(struct sock *sk, struct bpf_map *map, bool cacheit_lockit)
 {
 	struct bpf_local_storage *sk_storage;
net/mptcp/sched.c +11 -0
index c78ed61290d2..067df28899a6 100644
@@ -11,6 +11,7 @@
 #include <linux/list.h>
 #include <linux/rculist.h>
 #include <linux/spinlock.h>
+#include <net/bpf_sk_storage.h>
 #include "protocol.h"
 
 static DEFINE_SPINLOCK(mptcp_sched_list_lock);
@@ -202,18 +203,56 @@ mptcp_subflow_ctx_by_pos(const struct mptcp_sched_data *data, unsigned int pos)
 
 int mptcp_sched_get_params(struct mptcp_sock *msk)
 {
+	struct sock *sk = (struct sock *)msk;
+
 	if (msk->sched == &mptcp_sched_default)
 		return msk->snd_burst;
 
+	if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
+	    !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
+		struct bpf_local_storage_data *sdata;
+
+		sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
+		if (sdata) {
+			struct mptcp_burst_storage {
+				int snd_burst;

net/mptcp/sched.c mptcp_subflow_ctx_by_pos(const struct mptcp_sched_data *data, unsigned int pos) · line 228

Quoted 10 lines
net/mptcp/sched.c +8 -0
+			} *ptr;
+
+			ptr = (struct mptcp_burst_storage *)sdata->data;
+			if (ptr)
+				return ptr->snd_burst;
+		}
+	}
+
 	return 0;
 }

This seems very complex. Why implement it this way versus adding snd_burst to 'struct mptcp_sock' in bpf_tcp_helpers.h?

- Mat

Quoted 35 lines
net/mptcp/sched.c +20 -0
 int mptcp_sched_set_params(struct mptcp_sock *msk, int burst)
 {
+	struct sock *sk = (struct sock *)msk;
+
 	if (msk->sched == &mptcp_sched_default) {
 		msk->snd_burst = burst;
 		return 0;
 	}
 
+	if (sk->sk_bpf_storage && sk->sk_bpf_storage->smap &&
+	    !strcmp(sk->sk_bpf_storage->smap->map.name, "mptcp_burst_map")) {
+		struct bpf_local_storage_data *sdata;
+
+		sdata = bpf_sk_storage_lookup(sk, &sk->sk_bpf_storage->smap->map, true);
+		if (sdata) {
+			struct mptcp_burst_storage {
+				int snd_burst;
+			} *ptr;
+
+			ptr = (struct mptcp_burst_storage *)sdata->data;
+			if (ptr) {
+				ptr->snd_burst = burst;
+				return 0;
+			}
+		}
+	}
+
 	return 0;
 }
Signature · 1 line
2.35.3