Re: [PATCH net 2/2] net/smc: Use correct buffer sizes when switching between TCP and SMC

From: kernel test robot
Date: Wed Aug 02 2023 - 19:18:55 EST


Hi Gerd,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]
[also build test ERROR on linus/master v6.5-rc4 next-20230802]
[cannot apply to net/main]
[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/Gerd-Bayer/net-smc-Fix-setsockopt-and-sysctl-to-specify-same-buffer-size-again/20230802-193805
base: net-next/main
patch link: https://lore.kernel.org/r/20230802093313.1501605-3-gbayer%40linux.ibm.com
patch subject: [PATCH net 2/2] net/smc: Use correct buffer sizes when switching between TCP and SMC
config: nios2-randconfig-r006-20230731 (https://download.01.org/0day-ci/archive/20230803/202308030722.dV3X9uUQ-lkp@xxxxxxxxx/config)
compiler: nios2-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230803/202308030722.dV3X9uUQ-lkp@xxxxxxxxx/reproduce)

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

All errors (new ones prefixed by >>):

net/smc/af_smc.c: In function 'smc_adjust_sock_bufsizes':
>> net/smc/af_smc.c:465:27: error: 'possible_net_t' has no member named 'net'
465 | nnet = nsk->sk_net.net;
| ^


vim +465 net/smc/af_smc.c

438
439 /* copy only relevant settings and flags of SOL_SOCKET level from smc to
440 * clc socket (since smc is not called for these options from net/core)
441 */
442
443 #define SK_FLAGS_SMC_TO_CLC ((1UL << SOCK_URGINLINE) | \
444 (1UL << SOCK_KEEPOPEN) | \
445 (1UL << SOCK_LINGER) | \
446 (1UL << SOCK_BROADCAST) | \
447 (1UL << SOCK_TIMESTAMP) | \
448 (1UL << SOCK_DBG) | \
449 (1UL << SOCK_RCVTSTAMP) | \
450 (1UL << SOCK_RCVTSTAMPNS) | \
451 (1UL << SOCK_LOCALROUTE) | \
452 (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE) | \
453 (1UL << SOCK_RXQ_OVFL) | \
454 (1UL << SOCK_WIFI_STATUS) | \
455 (1UL << SOCK_NOFCS) | \
456 (1UL << SOCK_FILTER_LOCKED) | \
457 (1UL << SOCK_TSTAMP_NEW))
458
459 /* if set, use value set by setsockopt() - else use IPv4 or SMC sysctl value */
460 static void smc_adjust_sock_bufsizes(struct sock *nsk, struct sock *osk,
461 unsigned long mask)
462 {
463 struct net *nnet;
464
> 465 nnet = nsk->sk_net.net;
466
467 nsk->sk_userlocks = osk->sk_userlocks;
468
469 if (osk->sk_userlocks & SOCK_SNDBUF_LOCK) {
470 nsk->sk_sndbuf = osk->sk_sndbuf;
471 } else {
472 if (mask == SK_FLAGS_SMC_TO_CLC)
473 WRITE_ONCE(nsk->sk_sndbuf,
474 READ_ONCE(nnet->ipv4.sysctl_tcp_wmem[1]));
475 else
476 WRITE_ONCE(nsk->sk_sndbuf,
477 2 * READ_ONCE(nnet->smc.sysctl_wmem));
478 }
479 if (osk->sk_userlocks & SOCK_RCVBUF_LOCK) {
480 nsk->sk_rcvbuf = osk->sk_rcvbuf;
481 } else {
482 if (mask == SK_FLAGS_SMC_TO_CLC)
483 WRITE_ONCE(nsk->sk_rcvbuf,
484 READ_ONCE(nnet->ipv4.sysctl_tcp_rmem[1]));
485 else
486 WRITE_ONCE(nsk->sk_rcvbuf,
487 2 * READ_ONCE(nnet->smc.sysctl_rmem));
488 }
489 }
490

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