misc changes for rtrs
Subsystems (2)
cover misc changes for rtrs
Hi,
Pls review the three patches.
Thanks,
Guoqing
Guoqing Jiang (3):
RDMA/rtrs: Update comments for MAX_SESS_QUEUE_DEPTH RDMA/rtrs-clt: Break the loop once one path is connected RDMA/rtrs-clt: Kill xchg_paths
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 18 +++++------------- drivers/infiniband/ulp/rtrs/rtrs-pri.h | 7 +++---- 2 files changed, 8 insertions(+), 17 deletions(-)
Signature · 1 line
2.31.1
PATCH 1/3 RDMA/rtrs: Update comments for MAX_SESS_QUEUE_DEPTH
The maximum queue_depth should be 65535 per check_module_params, also update other relevant comments.
--- drivers/infiniband/ulp/rtrs/rtrs-pri.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/infiniband/ulp/rtrs/rtrs-pri.h +3 -4
@@ -26,11 +26,10 @@/* * Max IB immediate data size is 2^28 (MAX_IMM_PAYL_BITS) * and the minimum chunk size is 4096 (2^12). -* So the maximum sess_queue_depth is 65536 (2^16) in theory. -* But mempool_create, create_qp and ib_post_send fail with -* "cannot allocate memory" error if sess_queue_depth is too big. +* So the maximum sess_queue_depth is 65535 (2^16 - 1) in theory +* since queue_depth in rtrs_msg_conn_rsp is defined as le16. * Therefore the pratical max value of sess_queue_depth is -* somewhere between 1 and 65534 and it depends on the system. +* somewhere between 1 and 65535 and it depends on the system. */ #define MAX_SESS_QUEUE_DEPTH 65535
Signature · 1 line
2.31.1
PATCH 2/3 RDMA/rtrs-clt: Break the loop once one path is connected
In reply to Guoqing JiangNo need to iterate all paths after find one connected path.
--- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/rtrs/rtrs-clt.c +4 -1
@@ -54,7 +54,10 @@ static inline bool rtrs_clt_is_connected(const struct rtrs_clt_sess *clt)rcu_read_lock ();list_for_each_entry_rcu (clt_path, &clt->paths_list, s.entry) - connected |=READ_ONCE (clt_path->state) ==RTRS_CLT_CONNECTED ; +if (READ_ONCE (clt_path->state) ==RTRS_CLT_CONNECTED ) { + connected = true; +break ; + }rcu_read_unlock ();return connected;
Signature · 1 line
2.31.1
PATCH 3/3 RDMA/rtrs-clt: Kill xchg_paths
In reply to Guoqing JiangLet's call try_cmpxchg directly for the same purpose.
--- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/infiniband/ulp/rtrs/rtrs-clt.c +1 -12
@@ -2220,17 +2220,6 @@ static void rtrs_clt_stop_and_destroy_conns(struct rtrs_clt_path *clt_path) } } -static inline bool xchg_paths (struct rtrs_clt_path __rcu **rcu_ppcpu_path, -struct rtrs_clt_path *clt_path, -struct rtrs_clt_path *next) -{ -struct rtrs_clt_path **ppcpu_path; - -/* Call cmpxchg() without sparse warnings */ - ppcpu_path = (typeof (ppcpu_path ))rcu_ppcpu_path; -return clt_path ==cmpxchg (ppcpu_path, clt_path, next); -} -static void rtrs_clt_remove_path_from_arr (struct rtrs_clt_path *clt_path) {struct rtrs_clt_sess *clt = clt_path->clt;
@@ -2305,7 +2294,7 @@ static void rtrs_clt_remove_path_from_arr(struct rtrs_clt_path *clt_path)* We race with IO code path, which also changes pointer, * thus we have to be careful not to overwrite it. */ -if (xchg_paths (ppcpu_path, clt_path, next)) +if (try_cmpxchg ((typeof (ppcpu_path ))ppcpu_path, clt_path, next))/* * @ppcpu_path was successfully replaced with @next, * that means that someone could also pick up the
Signature · 1 line
2.31.1
kernel test robot
build botRe: [PATCH 3/3] RDMA/rtrs-clt: Kill xchg_paths
Thank you for the patch! Yet something to improve:
Hi Guoqing,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on rdma/for-next]
[also build test ERROR on linus/master v6.0-rc3 next-20220901] [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/Guoqing-Jiang/misc-changes-for-rtrs/20220902-182137 base: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next config: parisc64-allmodconfig (https://download.01.org/0day-ci/archive/20220903/[email protected]/config) compiler: hppa-linux-gcc (GCC) 12.1.0
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/intel-lab-lkp/linux/commit/1cb28fde63a272543476132ec83f6eb121111fae
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Guoqing-Jiang/misc-changes-for-rtrs/20220902-182137
git checkout 1cb28fde63a272543476132ec83f6eb121111fae
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash drivers/infiniband/ulp/rtrs/
If you fix the issue, kindly add following tag where applicable
All errors (new ones prefixed by >>):
In file included from include/linux/atomic.h:80,
from arch/parisc/include/asm/bitops.h:13,
from include/linux/bitops.h:67,
from include/linux/log2.h:12,
from include/asm-generic/div64.h:55,
from ./arch/parisc/include/generated/asm/div64.h:1,
from include/linux/math.h:6,
from include/linux/math64.h:6,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/infiniband/ulp/rtrs/rtrs-clt.c:13:
drivers/infiniband/ulp/rtrs/rtrs-clt.c: In function 'rtrs_clt_remove_path_from_arr':
>> include/linux/atomic/atomic-arch-fallback.h:90:34: error: initialization of 'struct rtrs_clt_path **' from incompatible pointer type 'struct rtrs_clt_path *' [-Werror=incompatible-pointer-types]
90 | typeof(*(_ptr)) *___op = (_oldp), ___o = *___op, ___r; \
| ^
include/linux/atomic/atomic-instrumented.h:1978:9: note: in expansion of macro 'arch_try_cmpxchg'
1978 | arch_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
| ^~~~~~~~~~~~~~~~ drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: note: in expansion of macro 'try_cmpxchg'
2297 | if (try_cmpxchg((typeof(ppcpu_path))ppcpu_path, clt_path, next))
| ^~~~~~~~~~~
cc1: some warnings being treated as errors
vim +90 include/linux/atomic/atomic-arch-fallback.h
29f006fdefe6f8 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-08-29 86
29f006fdefe6f8 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-08-29 87 #ifndef arch_try_cmpxchg
29f006fdefe6f8 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-08-29 88 #define arch_try_cmpxchg(_ptr, _oldp, _new) \
29f006fdefe6f8 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-08-29 89 ({ \
29f006fdefe6f8 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-08-29 @90 typeof(*(_ptr)) *___op = (_oldp), ___o = *___op, ___r; \
29f006fdefe6f8 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-08-29 91 ___r = arch_cmpxchg((_ptr), ___o, (_new)); \
29f006fdefe6f8 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-08-29 92 if (unlikely(___r != ___o)) \
29f006fdefe6f8 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-08-29 93 *___op = ___r; \
29f006fdefe6f8 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-08-29 94 likely(___r == ___o); \
29f006fdefe6f8 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-08-29 95 })
29f006fdefe6f8 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-08-29 96 #endif /* arch_try_cmpxchg */29f006fdefe6f8 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-08-29 97
Signature · 2 lines
0-DAY CI Kernel Test Service https://01.org/lkp
Re: [PATCH 3/3] RDMA/rtrs-clt: Kill xchg_paths
Quoted 44 lines · kernel test robot
Hi Guoqing,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on rdma/for-next]
[also build test ERROR on linus/master v6.0-rc3 next-20220901] [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/Guoqing-Jiang/misc-changes-for-rtrs/20220902-182137 base: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next config: parisc64-allmodconfig (https://download.01.org/0day-ci/archive/20220903/202209030331.GmBYWKZb-lkp(a)intel.com/config) compiler: hppa-linux-gcc (GCC) 12.1.0reproduce (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/intel-lab-lkp/linux/commit/1cb28fde63a272543476132ec83f6eb121111fae
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Guoqing-Jiang/misc-changes-for-rtrs/20220902-182137
git checkout1cb28fde63a272543476132ec83f6eb121111fae
# save the config file
mkdirbuild_dir&& cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bashdrivers/infiniband/ulp/rtrs/If you fix the issue, kindly add following tag where applicable
Reported-by kernel test robot <[email protected]>All errors (new ones prefixed by >>):
In file included from include/linux/atomic.h:80, from arch/parisc/include/asm/bitops.h:13, from include/linux/bitops.h:67, from include/linux/log2.h:12, from include/asm-generic/div64.h:55, from ./arch/parisc/include/generated/asm/div64.h:1, from include/linux/math.h:6, from include/linux/math64.h:6, from include/linux/time.h:6, from include/linux/stat.h:19, from include/linux/module.h:13, from drivers/infiniband/ulp/rtrs/rtrs-clt.c:13: drivers/infiniband/ulp/rtrs/rtrs-clt.c: In function 'rtrs_clt_remove_path_from_arr':Quoted 1 line
Quoted 1 line
include/linux/atomic/atomic-arch-fallback.h:90:34: error: initialization of 'structrtrs_clt_path**' from incompatible pointer type 'structrtrs_clt_path*' [-Werror=incompatible-pointer-types]
Quoted 9 lines
90 | typeof(*(_ptr))
*___op= (_oldp),___o=*___op,___r; \
| ^
include/linux/atomic/atomic-instrumented.h:1978:9: note: in expansion of macro 'arch_try_cmpxchg'
1978 |arch_try_cmpxchg(__ai_ptr, __ai_oldp, __VA_ARGS__); \
| ^~~~~~~~~~~~~~~~
drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: note: in expansion of macro 'try_cmpxchg'
2297 | if (try_cmpxchg((typeof(ppcpu_path))ppcpu_path, clt_path, next))
| ^~~~~~~~~~~
cc1: some warnings being treated as errors
My bad, thanks for the report!
Guoqing
PATCH 3/3 RDMA/rtrs-clt: Kill xchg_paths
In reply to Guoqing JiangLet's call try_cmpxchg directly for the same purpose.
--- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/infiniband/ulp/rtrs/rtrs-clt.c +1 -12
@@ -2220,17 +2220,6 @@ static void rtrs_clt_stop_and_destroy_conns(struct rtrs_clt_path *clt_path) } } -static inline bool xchg_paths (struct rtrs_clt_path __rcu **rcu_ppcpu_path, -struct rtrs_clt_path *clt_path, -struct rtrs_clt_path *next) -{ -struct rtrs_clt_path **ppcpu_path; - -/* Call cmpxchg() without sparse warnings */ - ppcpu_path = (typeof (ppcpu_path ))rcu_ppcpu_path; -return clt_path ==cmpxchg (ppcpu_path, clt_path, next); -} -static void rtrs_clt_remove_path_from_arr (struct rtrs_clt_path *clt_path) {struct rtrs_clt_sess *clt = clt_path->clt;
@@ -2305,7 +2294,7 @@ static void rtrs_clt_remove_path_from_arr(struct rtrs_clt_path *clt_path)* We race with IO code path, which also changes pointer, * thus we have to be careful not to overwrite it. */ -if (xchg_paths (ppcpu_path, clt_path, next)) +if (try_cmpxchg ((typeof (ppcpu_path ))ppcpu_path, &clt_path, next))/* * @ppcpu_path was successfully replaced with @next, * that means that someone could also pick up the
Signature · 1 line
2.31.1
Quoted 7 lines · Guoqing Jiang
Hi,
Pls review the three patches.
Thanks,
Guoqing
Quoted 8 lines
Guoqing Jiang (3):
RDMA/rtrs: Update comments forMAX_SESS_QUEUE_DEPTHRDMA/rtrs-clt: Break the loop once one path is connected RDMA/rtrs-clt: Killxchg_pathsdrivers/infiniband/ulp/rtrs/rtrs-clt.c | 18 +++++------------- drivers/infiniband/ulp/rtrs/rtrs-pri.h | 7 +++---- 2 files changed, 8 insertions(+), 17 deletions(-)
The third patch still generates warnings.
➜ kernel git:(wip/leon-for-next) mkt ci ^[[A^[[A^[[Ad9b137e23d31 (HEAD -> build) RDMA/rtrs-clt: Kill xchg_paths
WARNING: line length of 81 exceeds 80 columns
#43: FILE: drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:
+ if (try_cmpxchg((typeof(ppcpu_path))ppcpu_path, &clt_path, next))
drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: warning: incorrect type in initializer (different address spaces)drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: expected struct rtrs_clt_path [noderef] __rcu *__newdrivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: got struct rtrs_clt_path *[assigned] next
Quoted 4 lines
Signature · 2 lines
-- 2.31.1
Hi Leon,
Quoted 13 lines · Leon Romanovsky
Quoted 12 lines · Guoqing Jiang
Hi,
Pls review the three patches.
Thanks,
GuoqingGuoqing Jiang (3):
RDMA/rtrs: Update comments forMAX_SESS_QUEUE_DEPTHRDMA/rtrs-clt: Break the loop once one path is connected RDMA/rtrs-clt: Killxchg_paths
Quoted 4 lines
Quoted 3 lines
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 18 +++++------------- drivers/infiniband/ulp/rtrs/rtrs-pri.h | 7 +++---- 2 files changed, 8 insertions(+), 17 deletions(-)The third patch still generates warnings.
Sorry, I didn't run sparse check, 😅.
Quoted 9 lines
➜ kernel git:(wip/leon-for-next) mkt ci ^[[A^[[A^[[Ad9b137e23d31 (HEAD -> build) RDMA/rtrs-clt: Kill
xchg_paths
WARNING: line length of 81 exceeds 80 columns
#43: FILE:drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:(quoted diff) +1
-0+ if (try_cmpxchg((typeof(ppcpu_path))ppcpu_path, &clt_path, next))
drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: warning: incorrect type in initializer (different address spaces)drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: expected structrtrs_clt_path[noderef]__rcu*__newdrivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: got structrtrs_clt_path*[assigned] next
Before send new version, could you help to check whether the incremental change works or not? Otherwise let's drop the third one.
drivers/infiniband/ulp/rtrs/rtrs-clt.c +0 -0
@@ -2294,7 +2294,8 @@ static void rtrs_clt_remove_path_from_arr(struct rtrs_clt_path *clt_path)
* We race with IO code path, which also changes pointer,
* thus we have to be careful not to overwrite it. */
- if (try_cmpxchg((typeof(ppcpu_path))ppcpu_path, clt_path, next)) + if (try_cmpxchg((struct rtrs_clt_path **)ppcpu_path, + clt_path, next))
/*
* @ppcpu_path was successfully replaced with @next,
* that means that someone could also pick up the
Thanks,
Guoqing
Quoted 29 lines · Guoqing Jiang
Hi Leon,
Quoted 13 lines · Leon Romanovsky
Quoted 12 lines · Guoqing Jiang
Hi,
Pls review the three patches.
Thanks,
GuoqingGuoqing Jiang (3):
RDMA/rtrs: Update comments forMAX_SESS_QUEUE_DEPTHRDMA/rtrs-clt: Break the loop once one path is connected RDMA/rtrs-clt: Killxchg_pathsQuoted 4 lines
Quoted 3 lines
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 18 +++++------------- drivers/infiniband/ulp/rtrs/rtrs-pri.h | 7 +++---- 2 files changed, 8 insertions(+), 17 deletions(-)The third patch still generates warnings.
Sorry, I didn't run sparse check, 😅.
Quoted 6 lines
➜ kernel git:(wip/leon-for-next) mkt ci ^[[A^[[A^[[Ad9b137e23d31 (HEAD -> build) RDMA/rtrs-clt: Kill
xchg_paths
WARNING: line length of 81 exceeds 80 columns
#43: FILE:drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:(quoted diff) +1
-0+ if (try_cmpxchg((typeof(ppcpu_path))ppcpu_path, &clt_path, next))
Quoted 6 lines
Quoted 3 lines
drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: warning: incorrect type in initializer (different address spaces)drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: expected structrtrs_clt_path[noderef]__rcu*__newdrivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: got structrtrs_clt_path*[assigned] nextBefore send new version, could you help to check whether the incremental change works or not? Otherwise let's drop the third one.
Thanks, it worked.
Quoted 21 lines
drivers/infiniband/ulp/rtrs/rtrs-clt.c +2
-1@@ -2294,7 +2294,8 @@ static void rtrs_clt_remove_path_from_arr(structrtrs_clt_path *clt_path) * We race with IO code path, which also changes pointer, * thus we have to be careful not to overwrite it. */ - if (try_cmpxchg((typeof(ppcpu_path))ppcpu_path, clt_path, next)) + if (try_cmpxchg((struct rtrs_clt_path **)ppcpu_path, + clt_path, next)) /** @ppcpu_path was successfully replaced with @next,
* that means that someone could also pick up theThanks,
Guoqing
Quoted 31 lines · Leon Romanovsky
Quoted 29 lines · Guoqing Jiang
Hi Leon,
Quoted 13 lines · Leon Romanovsky
Quoted 12 lines · Guoqing Jiang
Hi,
Pls review the three patches.
Thanks,
GuoqingGuoqing Jiang (3):
RDMA/rtrs: Update comments forMAX_SESS_QUEUE_DEPTHRDMA/rtrs-clt: Break the loop once one path is connected RDMA/rtrs-clt: Killxchg_pathsQuoted 4 lines
Quoted 3 lines
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 18 +++++------------- drivers/infiniband/ulp/rtrs/rtrs-pri.h | 7 +++---- 2 files changed, 8 insertions(+), 17 deletions(-)The third patch still generates warnings.
Sorry, I didn't run sparse check, 😅.
Quoted 6 lines
➜ kernel git:(wip/leon-for-next) mkt ci ^[[A^[[A^[[Ad9b137e23d31 (HEAD -> build) RDMA/rtrs-clt: Kill
xchg_paths
WARNING: line length of 81 exceeds 80 columns
#43: FILE:drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:
+ if (try_cmpxchg((typeof(ppcpu_path))ppcpu_path, &clt_path, next))
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: warning: incorrect type in initializer (different address spaces)drivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: expected structrtrs_clt_path[noderef]__rcu*__newdrivers/infiniband/ulp/rtrs/rtrs-clt.c:2297:21: got structrtrs_clt_path*[assigned] nextBefore send new version, could you help to check whether the incremental change works or not? Otherwise let's drop the third one.
Thanks, it worked.
Looks good.
For all 3 patches (3rd one with the latest changes). Thanks.
Quoted 22 lines
Quoted 22 lines
drivers/infiniband/ulp/rtrs/rtrs-clt.c +2
-1@@ -2294,7 +2294,8 @@ static void rtrs_clt_remove_path_from_arr(structrtrs_clt_path *clt_path) * We race with IO code path, which also changes pointer, * thus we have to be careful not to overwrite it. */ -if (try_cmpxchg ((typeof (ppcpu_path ))ppcpu_path, clt_path, next)) +if (try_cmpxchg ((struct rtrs_clt_path **)ppcpu_path, + clt_path, next))/* * @ppcpu_path was successfully replaced with @next,
* that means that someone could also pick up theThanks,
Guoqing