All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v2 net-next] net: introduce SO_RCVBUFAUTO to let the rcv_buf tune automatically
Date: Wed, 16 Feb 2022 16:47:07 +0800	[thread overview]
Message-ID: <202202161604.JJGbw1Fl-lkp@intel.com> (raw)
In-Reply-To: <20220216050320.3222-1-kerneljasonxing@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 11500 bytes --]

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/kerneljasonxing-gmail-com/net-introduce-SO_RCVBUFAUTO-to-let-the-rcv_buf-tune-automatically/20220216-130549
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git b0471c26108160217fc17acec4a9fdce92aaeeea
config: nios2-defconfig (https://download.01.org/0day-ci/archive/20220216/202202161604.JJGbw1Fl-lkp(a)intel.com/config)
compiler: nios2-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/83d2852811bd798510fe870fd596d4aadfa87692
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review kerneljasonxing-gmail-com/net-introduce-SO_RCVBUFAUTO-to-let-the-rcv_buf-tune-automatically/20220216-130549
        git checkout 83d2852811bd798510fe870fd596d4aadfa87692
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=nios2 SHELL=/bin/bash

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:1458:9: error: duplicate case value
    1458 |         case SO_TXREHASH:
         |         ^~~~
   net/core/sock.c:1125:9: note: previously used here
    1125 |         case SO_RCVBUFAUTO:
         |         ^~~~


vim +1458 net/core/sock.c

62748f32d501f5d Eric Dumazet           2013-09-24  1355  
62748f32d501f5d Eric Dumazet           2013-09-24  1356  	case SO_MAX_PACING_RATE:
6bdef102dae9d24 Eric Dumazet           2019-02-28  1357  		{
700465fd338fe5d Ke Li                  2020-10-22  1358  		unsigned long ulval = (val == ~0U) ? ~0UL : (unsigned int)val;
6bdef102dae9d24 Eric Dumazet           2019-02-28  1359  
6bdef102dae9d24 Eric Dumazet           2019-02-28  1360  		if (sizeof(ulval) != sizeof(val) &&
6bdef102dae9d24 Eric Dumazet           2019-02-28  1361  		    optlen >= sizeof(ulval) &&
c8c1bbb6eb49810 Christoph Hellwig      2020-07-23  1362  		    copy_from_sockptr(&ulval, optval, sizeof(ulval))) {
6bdef102dae9d24 Eric Dumazet           2019-02-28  1363  			ret = -EFAULT;
6bdef102dae9d24 Eric Dumazet           2019-02-28  1364  			break;
6bdef102dae9d24 Eric Dumazet           2019-02-28  1365  		}
6bdef102dae9d24 Eric Dumazet           2019-02-28  1366  		if (ulval != ~0UL)
218af599fa635b1 Eric Dumazet           2017-05-16  1367  			cmpxchg(&sk->sk_pacing_status,
218af599fa635b1 Eric Dumazet           2017-05-16  1368  				SK_PACING_NONE,
218af599fa635b1 Eric Dumazet           2017-05-16  1369  				SK_PACING_NEEDED);
6bdef102dae9d24 Eric Dumazet           2019-02-28  1370  		sk->sk_max_pacing_rate = ulval;
6bdef102dae9d24 Eric Dumazet           2019-02-28  1371  		sk->sk_pacing_rate = min(sk->sk_pacing_rate, ulval);
62748f32d501f5d Eric Dumazet           2013-09-24  1372  		break;
6bdef102dae9d24 Eric Dumazet           2019-02-28  1373  		}
70da268b569d32a Eric Dumazet           2015-10-08  1374  	case SO_INCOMING_CPU:
7170a977743b72c Eric Dumazet           2019-10-30  1375  		WRITE_ONCE(sk->sk_incoming_cpu, val);
70da268b569d32a Eric Dumazet           2015-10-08  1376  		break;
70da268b569d32a Eric Dumazet           2015-10-08  1377  
a87cb3e48ee86d2 Tom Herbert            2016-02-24  1378  	case SO_CNX_ADVICE:
a87cb3e48ee86d2 Tom Herbert            2016-02-24  1379  		if (val == 1)
a87cb3e48ee86d2 Tom Herbert            2016-02-24  1380  			dst_negative_advice(sk);
a87cb3e48ee86d2 Tom Herbert            2016-02-24  1381  		break;
76851d1212c1136 Willem de Bruijn       2017-08-03  1382  
76851d1212c1136 Willem de Bruijn       2017-08-03  1383  	case SO_ZEROCOPY:
28190752c709272 Sowmini Varadhan       2018-02-15  1384  		if (sk->sk_family == PF_INET || sk->sk_family == PF_INET6) {
42f67eea3ba36ce Eric Dumazet           2021-11-15  1385  			if (!(sk_is_tcp(sk) ||
b5947e5d1e710c3 Willem de Bruijn       2018-11-30  1386  			      (sk->sk_type == SOCK_DGRAM &&
b5947e5d1e710c3 Willem de Bruijn       2018-11-30  1387  			       sk->sk_protocol == IPPROTO_UDP)))
76851d1212c1136 Willem de Bruijn       2017-08-03  1388  				ret = -ENOTSUPP;
28190752c709272 Sowmini Varadhan       2018-02-15  1389  		} else if (sk->sk_family != PF_RDS) {
28190752c709272 Sowmini Varadhan       2018-02-15  1390  			ret = -ENOTSUPP;
28190752c709272 Sowmini Varadhan       2018-02-15  1391  		}
28190752c709272 Sowmini Varadhan       2018-02-15  1392  		if (!ret) {
28190752c709272 Sowmini Varadhan       2018-02-15  1393  			if (val < 0 || val > 1)
76851d1212c1136 Willem de Bruijn       2017-08-03  1394  				ret = -EINVAL;
76851d1212c1136 Willem de Bruijn       2017-08-03  1395  			else
76851d1212c1136 Willem de Bruijn       2017-08-03  1396  				sock_valbool_flag(sk, SOCK_ZEROCOPY, valbool);
28190752c709272 Sowmini Varadhan       2018-02-15  1397  		}
334e6413134bf83 Jesus Sanchez-Palencia 2018-03-07  1398  		break;
334e6413134bf83 Jesus Sanchez-Palencia 2018-03-07  1399  
80b14dee2bea128 Richard Cochran        2018-07-03  1400  	case SO_TXTIME:
790709f24972864 Eric Dumazet           2020-05-07  1401  		if (optlen != sizeof(struct sock_txtime)) {
80b14dee2bea128 Richard Cochran        2018-07-03  1402  			ret = -EINVAL;
790709f24972864 Eric Dumazet           2020-05-07  1403  			break;
c8c1bbb6eb49810 Christoph Hellwig      2020-07-23  1404  		} else if (copy_from_sockptr(&sk_txtime, optval,
80b14dee2bea128 Richard Cochran        2018-07-03  1405  			   sizeof(struct sock_txtime))) {
80b14dee2bea128 Richard Cochran        2018-07-03  1406  			ret = -EFAULT;
790709f24972864 Eric Dumazet           2020-05-07  1407  			break;
80b14dee2bea128 Richard Cochran        2018-07-03  1408  		} else if (sk_txtime.flags & ~SOF_TXTIME_FLAGS_MASK) {
80b14dee2bea128 Richard Cochran        2018-07-03  1409  			ret = -EINVAL;
790709f24972864 Eric Dumazet           2020-05-07  1410  			break;
790709f24972864 Eric Dumazet           2020-05-07  1411  		}
790709f24972864 Eric Dumazet           2020-05-07  1412  		/* CLOCK_MONOTONIC is only used by sch_fq, and this packet
790709f24972864 Eric Dumazet           2020-05-07  1413  		 * scheduler has enough safe guards.
790709f24972864 Eric Dumazet           2020-05-07  1414  		 */
790709f24972864 Eric Dumazet           2020-05-07  1415  		if (sk_txtime.clockid != CLOCK_MONOTONIC &&
790709f24972864 Eric Dumazet           2020-05-07  1416  		    !ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) {
790709f24972864 Eric Dumazet           2020-05-07  1417  			ret = -EPERM;
790709f24972864 Eric Dumazet           2020-05-07  1418  			break;
790709f24972864 Eric Dumazet           2020-05-07  1419  		}
80b14dee2bea128 Richard Cochran        2018-07-03  1420  		sock_valbool_flag(sk, SOCK_TXTIME, true);
80b14dee2bea128 Richard Cochran        2018-07-03  1421  		sk->sk_clockid = sk_txtime.clockid;
80b14dee2bea128 Richard Cochran        2018-07-03  1422  		sk->sk_txtime_deadline_mode =
80b14dee2bea128 Richard Cochran        2018-07-03  1423  			!!(sk_txtime.flags & SOF_TXTIME_DEADLINE_MODE);
4b15c7075352668 Jesus Sanchez-Palencia 2018-07-03  1424  		sk->sk_txtime_report_errors =
4b15c7075352668 Jesus Sanchez-Palencia 2018-07-03  1425  			!!(sk_txtime.flags & SOF_TXTIME_REPORT_ERRORS);
80b14dee2bea128 Richard Cochran        2018-07-03  1426  		break;
80b14dee2bea128 Richard Cochran        2018-07-03  1427  
f5dd3d0c9638a9d David Herrmann         2019-01-15  1428  	case SO_BINDTOIFINDEX:
7594888c782e735 Christoph Hellwig      2020-05-28  1429  		ret = sock_bindtoindex_locked(sk, val);
f5dd3d0c9638a9d David Herrmann         2019-01-15  1430  		break;
f5dd3d0c9638a9d David Herrmann         2019-01-15  1431  
04190bf8944deb7 Pavel Tikhomirov       2021-08-04  1432  	case SO_BUF_LOCK:
04190bf8944deb7 Pavel Tikhomirov       2021-08-04  1433  		if (val & ~SOCK_BUF_LOCK_MASK) {
04190bf8944deb7 Pavel Tikhomirov       2021-08-04  1434  			ret = -EINVAL;
04190bf8944deb7 Pavel Tikhomirov       2021-08-04  1435  			break;
04190bf8944deb7 Pavel Tikhomirov       2021-08-04  1436  		}
04190bf8944deb7 Pavel Tikhomirov       2021-08-04  1437  		sk->sk_userlocks = val | (sk->sk_userlocks &
04190bf8944deb7 Pavel Tikhomirov       2021-08-04  1438  					  ~SOCK_BUF_LOCK_MASK);
04190bf8944deb7 Pavel Tikhomirov       2021-08-04  1439  		break;
04190bf8944deb7 Pavel Tikhomirov       2021-08-04  1440  
2bb2f5fb21b0486 Wei Wang               2021-09-29  1441  	case SO_RESERVE_MEM:
2bb2f5fb21b0486 Wei Wang               2021-09-29  1442  	{
2bb2f5fb21b0486 Wei Wang               2021-09-29  1443  		int delta;
2bb2f5fb21b0486 Wei Wang               2021-09-29  1444  
2bb2f5fb21b0486 Wei Wang               2021-09-29  1445  		if (val < 0) {
2bb2f5fb21b0486 Wei Wang               2021-09-29  1446  			ret = -EINVAL;
2bb2f5fb21b0486 Wei Wang               2021-09-29  1447  			break;
2bb2f5fb21b0486 Wei Wang               2021-09-29  1448  		}
2bb2f5fb21b0486 Wei Wang               2021-09-29  1449  
2bb2f5fb21b0486 Wei Wang               2021-09-29  1450  		delta = val - sk->sk_reserved_mem;
2bb2f5fb21b0486 Wei Wang               2021-09-29  1451  		if (delta < 0)
2bb2f5fb21b0486 Wei Wang               2021-09-29  1452  			sock_release_reserved_memory(sk, -delta);
2bb2f5fb21b0486 Wei Wang               2021-09-29  1453  		else
2bb2f5fb21b0486 Wei Wang               2021-09-29  1454  			ret = sock_reserve_memory(sk, delta);
2bb2f5fb21b0486 Wei Wang               2021-09-29  1455  		break;
2bb2f5fb21b0486 Wei Wang               2021-09-29  1456  	}
2bb2f5fb21b0486 Wei Wang               2021-09-29  1457  
26859240e4ee701 Akhmat Karakotov       2022-01-31 @1458  	case SO_TXREHASH:
26859240e4ee701 Akhmat Karakotov       2022-01-31  1459  		if (val < -1 || val > 1) {
26859240e4ee701 Akhmat Karakotov       2022-01-31  1460  			ret = -EINVAL;
26859240e4ee701 Akhmat Karakotov       2022-01-31  1461  			break;
26859240e4ee701 Akhmat Karakotov       2022-01-31  1462  		}
cb6cd2cec799356 Akhmat Karakotov       2022-01-31  1463  		/* Paired with READ_ONCE() in tcp_rtx_synack() */
cb6cd2cec799356 Akhmat Karakotov       2022-01-31  1464  		WRITE_ONCE(sk->sk_txrehash, (u8)val);
26859240e4ee701 Akhmat Karakotov       2022-01-31  1465  		break;
26859240e4ee701 Akhmat Karakotov       2022-01-31  1466  
^1da177e4c3f415 Linus Torvalds         2005-04-16  1467  	default:
^1da177e4c3f415 Linus Torvalds         2005-04-16  1468  		ret = -ENOPROTOOPT;
^1da177e4c3f415 Linus Torvalds         2005-04-16  1469  		break;
^1da177e4c3f415 Linus Torvalds         2005-04-16  1470  	}
^1da177e4c3f415 Linus Torvalds         2005-04-16  1471  	release_sock(sk);
^1da177e4c3f415 Linus Torvalds         2005-04-16  1472  	return ret;
^1da177e4c3f415 Linus Torvalds         2005-04-16  1473  }
2a91525c20d3aae Eric Dumazet           2009-05-27  1474  EXPORT_SYMBOL(sock_setsockopt);
^1da177e4c3f415 Linus Torvalds         2005-04-16  1475  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

      parent reply	other threads:[~2022-02-16  8:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16  5:03 [PATCH v2 net-next] net: introduce SO_RCVBUFAUTO to let the rcv_buf tune automatically kerneljasonxing
2022-02-16  6:24 ` Eric Dumazet
2022-02-16  6:57   ` Jason Xing
2022-02-16 16:56     ` Eric Dumazet
2022-02-17  2:15       ` Jason Xing
2022-02-16  8:47 ` kernel test robot [this message]

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=202202161604.JJGbw1Fl-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.