From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH net-next 1/3] net: add new socket option SO_RESERVE_MEM
Date: Fri, 12 Nov 2021 21:13:28 +0800 [thread overview]
Message-ID: <202111122153.GmR4u0vp-lkp@intel.com> (raw)
In-Reply-To: <20210927182523.2704818-2-weiwan@google.com>
[-- Attachment #1: Type: text/plain, Size: 5727 bytes --]
Hi Wei,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net/master]
[also build test ERROR on horms-ipvs/master v5.15]
[cannot apply to net-next/master linus/master next-20211112]
[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/Wei-Wang/net-add-new-socket-option-SO_RESERVE_MEM/20210929-124516
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git f936bb42aeb94a069bec7c9e04100d199c372956
config: mips-loongson2k_defconfig (attached as .config)
compiler: mips64el-linux-gcc (GCC) 11.2.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/0day-ci/linux/commit/e60de1697822b3d6384c6bc620d7048c05fca819
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Wei-Wang/net-add-new-socket-option-SO_RESERVE_MEM/20210929-124516
git checkout e60de1697822b3d6384c6bc620d7048c05fca819
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash net/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
net/core/sock.c: In function 'sock_setsockopt':
>> net/core/sock.c:1417:14: error: 'SO_RESERVE_MEM' undeclared (first use in this function)
1417 | case SO_RESERVE_MEM:
| ^~~~~~~~~~~~~~
net/core/sock.c:1417:14: note: each undeclared identifier is reported only once for each function it appears in
net/core/sock.c: In function 'sock_getsockopt':
net/core/sock.c:1800:14: error: 'SO_RESERVE_MEM' undeclared (first use in this function)
1800 | case SO_RESERVE_MEM:
| ^~~~~~~~~~~~~~
vim +/SO_RESERVE_MEM +1417 net/core/sock.c
1330
1331 case SO_MAX_PACING_RATE:
1332 {
1333 unsigned long ulval = (val == ~0U) ? ~0UL : (unsigned int)val;
1334
1335 if (sizeof(ulval) != sizeof(val) &&
1336 optlen >= sizeof(ulval) &&
1337 copy_from_sockptr(&ulval, optval, sizeof(ulval))) {
1338 ret = -EFAULT;
1339 break;
1340 }
1341 if (ulval != ~0UL)
1342 cmpxchg(&sk->sk_pacing_status,
1343 SK_PACING_NONE,
1344 SK_PACING_NEEDED);
1345 sk->sk_max_pacing_rate = ulval;
1346 sk->sk_pacing_rate = min(sk->sk_pacing_rate, ulval);
1347 break;
1348 }
1349 case SO_INCOMING_CPU:
1350 WRITE_ONCE(sk->sk_incoming_cpu, val);
1351 break;
1352
1353 case SO_CNX_ADVICE:
1354 if (val == 1)
1355 dst_negative_advice(sk);
1356 break;
1357
1358 case SO_ZEROCOPY:
1359 if (sk->sk_family == PF_INET || sk->sk_family == PF_INET6) {
1360 if (!((sk->sk_type == SOCK_STREAM &&
1361 sk->sk_protocol == IPPROTO_TCP) ||
1362 (sk->sk_type == SOCK_DGRAM &&
1363 sk->sk_protocol == IPPROTO_UDP)))
1364 ret = -ENOTSUPP;
1365 } else if (sk->sk_family != PF_RDS) {
1366 ret = -ENOTSUPP;
1367 }
1368 if (!ret) {
1369 if (val < 0 || val > 1)
1370 ret = -EINVAL;
1371 else
1372 sock_valbool_flag(sk, SOCK_ZEROCOPY, valbool);
1373 }
1374 break;
1375
1376 case SO_TXTIME:
1377 if (optlen != sizeof(struct sock_txtime)) {
1378 ret = -EINVAL;
1379 break;
1380 } else if (copy_from_sockptr(&sk_txtime, optval,
1381 sizeof(struct sock_txtime))) {
1382 ret = -EFAULT;
1383 break;
1384 } else if (sk_txtime.flags & ~SOF_TXTIME_FLAGS_MASK) {
1385 ret = -EINVAL;
1386 break;
1387 }
1388 /* CLOCK_MONOTONIC is only used by sch_fq, and this packet
1389 * scheduler has enough safe guards.
1390 */
1391 if (sk_txtime.clockid != CLOCK_MONOTONIC &&
1392 !ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) {
1393 ret = -EPERM;
1394 break;
1395 }
1396 sock_valbool_flag(sk, SOCK_TXTIME, true);
1397 sk->sk_clockid = sk_txtime.clockid;
1398 sk->sk_txtime_deadline_mode =
1399 !!(sk_txtime.flags & SOF_TXTIME_DEADLINE_MODE);
1400 sk->sk_txtime_report_errors =
1401 !!(sk_txtime.flags & SOF_TXTIME_REPORT_ERRORS);
1402 break;
1403
1404 case SO_BINDTOIFINDEX:
1405 ret = sock_bindtoindex_locked(sk, val);
1406 break;
1407
1408 case SO_BUF_LOCK:
1409 if (val & ~SOCK_BUF_LOCK_MASK) {
1410 ret = -EINVAL;
1411 break;
1412 }
1413 sk->sk_userlocks = val | (sk->sk_userlocks &
1414 ~SOCK_BUF_LOCK_MASK);
1415 break;
1416
> 1417 case SO_RESERVE_MEM:
1418 {
1419 int delta;
1420
1421 if (val < 0) {
1422 ret = -EINVAL;
1423 break;
1424 }
1425
1426 delta = val - sk->sk_reserved_mem;
1427 if (delta < 0)
1428 sock_release_reserved_memory(sk, -delta);
1429 else
1430 ret = sock_reserve_memory(sk, delta);
1431 break;
1432 }
1433
1434 default:
1435 ret = -ENOPROTOOPT;
1436 break;
1437 }
1438 release_sock(sk);
1439 return ret;
1440 }
1441 EXPORT_SYMBOL(sock_setsockopt);
1442
1443
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30680 bytes --]
next prev parent reply other threads:[~2021-11-12 13:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-27 18:25 [PATCH net-next 0/3] net: add new socket option SO_RESERVE_MEM Wei Wang
2021-09-27 18:25 ` [PATCH net-next 1/3] " Wei Wang
2021-11-12 13:13 ` kernel test robot [this message]
2021-09-27 18:25 ` [PATCH net-next 2/3] tcp: adjust sndbuf according to sk_reserved_mem Wei Wang
2021-09-27 18:25 ` [PATCH net-next 3/3] tcp: adjust rcv_ssthresh " Wei Wang
2021-09-28 0:50 ` [PATCH net-next 0/3] net: add new socket option SO_RESERVE_MEM Jakub Kicinski
2021-09-28 3:33 ` Wei Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202111122153.GmR4u0vp-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.