Re: [PATCH net] sctp: do not update transport pathmtu if SPP_PMTUD_ENABLE is not set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Xin,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net/master]

url:    https://github.com/0day-ci/linux/commits/Xin-Long/sctp-do-not-update-transport-pathmtu-if-SPP_PMTUD_ENABLE-is-not-set/20210722-001121
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git e9a72f874d5b95cef0765bafc56005a50f72c5fe
config: x86_64-randconfig-r012-20210720 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c781eb153bfbd1b52b03efe34f56bbeccbb8aba6)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/e6927d4d69af5f40d7884a7ccc70737bf3da2771
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Xin-Long/sctp-do-not-update-transport-pathmtu-if-SPP_PMTUD_ENABLE-is-not-set/20210722-001121
        git checkout e6927d4d69af5f40d7884a7ccc70737bf3da2771
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=x86_64 SHELL=/bin/bash net/sctp/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   net/sctp/output.c:112:2: error: expected identifier or '('
           if (asoc->pmtu_pending) {
           ^
   net/sctp/output.c:121:2: error: expected identifier or '('
           if (ecn_capable) {
           ^
   net/sctp/output.c:128:2: error: expected identifier or '('
           if (!tp->dst)
           ^
>> net/sctp/output.c:132:2: warning: declaration specifier missing, defaulting to 'int'
           rcu_read_lock();
           ^
           int
   net/sctp/output.c:132:15: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
           rcu_read_lock();
                        ^
                         void
   net/sctp/output.c:132:2: error: conflicting types for 'rcu_read_lock'
           rcu_read_lock();
           ^
   include/linux/rcupdate.h:683:29: note: previous definition is here
   static __always_inline void rcu_read_lock(void)
                               ^
   net/sctp/output.c:133:2: error: expected identifier or '('
           if (__sk_dst_get(sk) != tp->dst) {
           ^
   net/sctp/output.c:137:2: error: unknown type name 'packet'
           packet->max_size = sk_can_gso(sk) ? tp->dst->dev->gso_max_size
           ^
   net/sctp/output.c:137:8: error: expected identifier or '('
           packet->max_size = sk_can_gso(sk) ? tp->dst->dev->gso_max_size
                 ^
   net/sctp/output.c:139:2: warning: declaration specifier missing, defaulting to 'int'
           rcu_read_unlock();
           ^
           int
   net/sctp/output.c:139:17: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
           rcu_read_unlock();
                          ^
                           void
   net/sctp/output.c:139:2: error: conflicting types for 'rcu_read_unlock'
           rcu_read_unlock();
           ^
   include/linux/rcupdate.h:714:20: note: previous definition is here
   static inline void rcu_read_unlock(void)
                      ^
   net/sctp/output.c:140:1: error: extraneous closing brace ('}')
   }
   ^
   2 warnings and 11 errors generated.


vim +/int +132 net/sctp/output.c

be2971438dec2e Wei Yongjun             2009-09-04   69  
^1da177e4c3f41 Linus Torvalds          2005-04-16   70  /* Config a packet.
^1da177e4c3f41 Linus Torvalds          2005-04-16   71   * This appears to be a followup set of initializations.
^1da177e4c3f41 Linus Torvalds          2005-04-16   72   */
66b91d2cd0344c Marcelo Ricardo Leitner 2016-12-28   73  void sctp_packet_config(struct sctp_packet *packet, __u32 vtag,
66b91d2cd0344c Marcelo Ricardo Leitner 2016-12-28   74  			int ecn_capable)
^1da177e4c3f41 Linus Torvalds          2005-04-16   75  {
90017accff61ae Marcelo Ricardo Leitner 2016-06-02   76  	struct sctp_transport *tp = packet->transport;
90017accff61ae Marcelo Ricardo Leitner 2016-06-02   77  	struct sctp_association *asoc = tp->asoc;
feddd6c1af30ab Marcelo Ricardo Leitner 2018-04-26   78  	struct sctp_sock *sp = NULL;
df2729c3238ed8 Xin Long                2017-04-01   79  	struct sock *sk;
^1da177e4c3f41 Linus Torvalds          2005-04-16   80  
bb33381d0c97cd Daniel Borkmann         2013-06-28   81  	pr_debug("%s: packet:%p vtag:0x%x\n", __func__, packet, vtag);
^1da177e4c3f41 Linus Torvalds          2005-04-16   82  	packet->vtag = vtag;
^1da177e4c3f41 Linus Torvalds          2005-04-16   83  
df2729c3238ed8 Xin Long                2017-04-01   84  	/* do the following jobs only once for a flush schedule */
df2729c3238ed8 Xin Long                2017-04-01   85  	if (!sctp_packet_empty(packet))
df2729c3238ed8 Xin Long                2017-04-01   86  		return;
90017accff61ae Marcelo Ricardo Leitner 2016-06-02   87  
b7e10c25b839c0 Richard Haines          2018-02-24   88  	/* set packet max_size with pathmtu, then calculate overhead */
90017accff61ae Marcelo Ricardo Leitner 2016-06-02   89  	packet->max_size = tp->pathmtu;
feddd6c1af30ab Marcelo Ricardo Leitner 2018-04-26   90  
b7e10c25b839c0 Richard Haines          2018-02-24   91  	if (asoc) {
feddd6c1af30ab Marcelo Ricardo Leitner 2018-04-26   92  		sk = asoc->base.sk;
feddd6c1af30ab Marcelo Ricardo Leitner 2018-04-26   93  		sp = sctp_sk(sk);
feddd6c1af30ab Marcelo Ricardo Leitner 2018-04-26   94  	}
feddd6c1af30ab Marcelo Ricardo Leitner 2018-04-26   95  	packet->overhead = sctp_mtu_payload(sp, 0, 0);
feddd6c1af30ab Marcelo Ricardo Leitner 2018-04-26   96  	packet->size = packet->overhead;
b7e10c25b839c0 Richard Haines          2018-02-24   97  
feddd6c1af30ab Marcelo Ricardo Leitner 2018-04-26   98  	if (!asoc)
df2729c3238ed8 Xin Long                2017-04-01   99  		return;
90017accff61ae Marcelo Ricardo Leitner 2016-06-02  100  
df2729c3238ed8 Xin Long                2017-04-01  101  	/* update dst or transport pathmtu if in need */
df2729c3238ed8 Xin Long                2017-04-01  102  	if (!sctp_transport_dst_check(tp)) {
feddd6c1af30ab Marcelo Ricardo Leitner 2018-04-26  103  		sctp_transport_route(tp, NULL, sp);
df2729c3238ed8 Xin Long                2017-04-01  104  		if (asoc->param_flags & SPP_PMTUD_ENABLE)
3ebfdf082184d0 Xin Long                2017-04-04  105  			sctp_assoc_sync_pmtu(asoc);
7307e4fa4d295f Xin Long                2021-06-22  106  	} else if (!sctp_transport_pl_enabled(tp) &&
e6927d4d69af5f Xin Long                2021-07-21  107  		   asoc->param_flags & SPP_PMTUD_ENABLE)
e6927d4d69af5f Xin Long                2021-07-21  108  		if (!sctp_transport_pmtu_check(tp))
69fec325a64383 Xin Long                2018-11-18  109  			sctp_assoc_sync_pmtu(asoc);
df2729c3238ed8 Xin Long                2017-04-01  110  	}
^1da177e4c3f41 Linus Torvalds          2005-04-16  111  
d805397c3822d5 Xin Long                2018-10-15  112  	if (asoc->pmtu_pending) {
d805397c3822d5 Xin Long                2018-10-15  113  		if (asoc->param_flags & SPP_PMTUD_ENABLE)
d805397c3822d5 Xin Long                2018-10-15  114  			sctp_assoc_sync_pmtu(asoc);
d805397c3822d5 Xin Long                2018-10-15  115  		asoc->pmtu_pending = 0;
d805397c3822d5 Xin Long                2018-10-15  116  	}
d805397c3822d5 Xin Long                2018-10-15  117  
^1da177e4c3f41 Linus Torvalds          2005-04-16  118  	/* If there a is a prepend chunk stick it on the list before
^1da177e4c3f41 Linus Torvalds          2005-04-16  119  	 * any other chunks get appended.
^1da177e4c3f41 Linus Torvalds          2005-04-16  120  	 */
df2729c3238ed8 Xin Long                2017-04-01  121  	if (ecn_capable) {
df2729c3238ed8 Xin Long                2017-04-01  122  		struct sctp_chunk *chunk = sctp_get_ecne_prepend(asoc);
df2729c3238ed8 Xin Long                2017-04-01  123  
^1da177e4c3f41 Linus Torvalds          2005-04-16  124  		if (chunk)
^1da177e4c3f41 Linus Torvalds          2005-04-16  125  			sctp_packet_append_chunk(packet, chunk);
^1da177e4c3f41 Linus Torvalds          2005-04-16  126  	}
df2729c3238ed8 Xin Long                2017-04-01  127  
df2729c3238ed8 Xin Long                2017-04-01  128  	if (!tp->dst)
df2729c3238ed8 Xin Long                2017-04-01  129  		return;
df2729c3238ed8 Xin Long                2017-04-01  130  
df2729c3238ed8 Xin Long                2017-04-01  131  	/* set packet max_size with gso_max_size if gso is enabled*/
df2729c3238ed8 Xin Long                2017-04-01 @132  	rcu_read_lock();
df2729c3238ed8 Xin Long                2017-04-01  133  	if (__sk_dst_get(sk) != tp->dst) {
df2729c3238ed8 Xin Long                2017-04-01  134  		dst_hold(tp->dst);
df2729c3238ed8 Xin Long                2017-04-01  135  		sk_setup_caps(sk, tp->dst);
df2729c3238ed8 Xin Long                2017-04-01  136  	}
df2729c3238ed8 Xin Long                2017-04-01  137  	packet->max_size = sk_can_gso(sk) ? tp->dst->dev->gso_max_size
df2729c3238ed8 Xin Long                2017-04-01  138  					  : asoc->pathmtu;
df2729c3238ed8 Xin Long                2017-04-01  139  	rcu_read_unlock();
^1da177e4c3f41 Linus Torvalds          2005-04-16  140  }
^1da177e4c3f41 Linus Torvalds          2005-04-16  141  

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     SCTP

  Powered by Linux