[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202110011030.FOWD91L0-lkp@intel.com>
Date: Fri, 1 Oct 2021 10:51:31 +0800
From: kernel test robot <lkp@...el.com>
To: Wei Wang <weiwan@...gle.com>
Cc: kbuild-all@...ts.01.org, netdev@...r.kernel.org,
Eric Dumazet <edumazet@...gle.com>
Subject: [net-next:master 415/423] net/core/sock.c:1417:14: error:
'SO_RESERVE_MEM' undeclared
tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head: b05173028cc52384be42dcf81abdb4133caccfa5
commit: 2bb2f5fb21b0486ff69b7b4a1fe03a760527d133 [415/423] net: add new socket option SO_RESERVE_MEM
config: sparc-defconfig (attached as .config)
compiler: sparc-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://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=2bb2f5fb21b0486ff69b7b4a1fe03a760527d133
git remote add net-next https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
git fetch --no-tags net-next master
git checkout 2bb2f5fb21b0486ff69b7b4a1fe03a760527d133
# 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=sparc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.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
Download attachment ".config.gz" of type "application/gzip" (13474 bytes)
Powered by blists - more mailing lists