Subject: Re: [PATCH net-next 7/9] net: tcp: add skb drop reasons to tcp connect requesting

From: kernel test robot <[email-masked]>
Date: Mon, 16 May 2022 20:54:55 +0800

Hi,

Thank you for the patch! Yet something to improve:

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

url:    https://github.com/intel-lab-lkp/linux/commits/menglong8-dong-gmail-com/net-tcp-add-skb-drop-reasons-to-tcp-state-change/20220516-114934
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git d9713088158b23973266e07fdc85ff7d68791a8c
config: mips-mtx1_defconfig (https://download.01.org/0day-ci/archive/20220516/[email-masked]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 853fa8ee225edf2d0de94b0dcbd31bea916e825e)
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 mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/d93679590223760e685126e344dfddd7d7c08cc3
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review menglong8-dong-gmail-com/net-tcp-add-skb-drop-reasons-to-tcp-state-change/20220516-114934
        git checkout d93679590223760e685126e344dfddd7d7c08cc3
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 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 <[email-masked]>

All errors (new ones prefixed by >>):

>> net/dccp/ipv4.c:584:5: error: conflicting types for 'dccp_v4_conn_request'
   int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb,
       ^
   net/dccp/dccp.h:258:5: note: previous declaration is here
   int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb);
       ^
>> net/dccp/ipv4.c:921:21: error: incompatible function pointer types initializing 'int (*)(struct sock *, struct sk_buff *, enum skb_drop_reason *)' with an expression of type 'int (struct sock *, struct sk_buff *)' [-Werror,-Wincompatible-function-pointer-types]
           .conn_request      = dccp_v4_conn_request,
                                ^~~~~~~~~~~~~~~~~~~~
   2 errors generated.

vim +/dccp_v4_conn_request +584 net/dccp/ipv4.c

   583	
 > 584	int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb,
   585				 enum skb_drop_reason *reason)
   586	{
   587		struct inet_request_sock *ireq;
   588		struct request_sock *req;
   589		struct dccp_request_sock *dreq;
   590		const __be32 service = dccp_hdr_request(skb)->dccph_req_service;
   591		struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb);
   592	
   593		/* Never answer to DCCP_PKT_REQUESTs send to broadcast or multicast */
   594		if (skb_rtable(skb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))
   595			return 0;	/* discard, don't send a reset here */
   596	
   597		if (dccp_bad_service_code(sk, service)) {
   598			dcb->dccpd_reset_code = DCCP_RESET_CODE_BAD_SERVICE_CODE;
   599			goto drop;
   600		}
   601		/*
   602		 * TW buckets are converted to open requests without
   603		 * limitations, they conserve resources and peer is
   604		 * evidently real one.
   605		 */
   606		dcb->dccpd_reset_code = DCCP_RESET_CODE_TOO_BUSY;
   607		if (inet_csk_reqsk_queue_is_full(sk))
   608			goto drop;
   609	
   610		if (sk_acceptq_is_full(sk))
   611			goto drop;
   612	
   613		req = inet_reqsk_alloc(&dccp_request_sock_ops, sk, true);
   614		if (req == NULL)
   615			goto drop;
   616	
   617		if (dccp_reqsk_init(req, dccp_sk(sk), skb))
   618			goto drop_and_free;
   619	
   620		dreq = dccp_rsk(req);
   621		if (dccp_parse_options(sk, dreq, skb))
   622			goto drop_and_free;
   623	
   624		if (security_inet_conn_request(sk, skb, req))
   625			goto drop_and_free;
   626	
   627		ireq = inet_rsk(req);
   628		sk_rcv_saddr_set(req_to_sk(req), ip_hdr(skb)->daddr);
   629		sk_daddr_set(req_to_sk(req), ip_hdr(skb)->saddr);
   630		ireq->ir_mark = inet_request_mark(sk, skb);
   631		ireq->ireq_family = AF_INET;
   632		ireq->ir_iif = sk->sk_bound_dev_if;
   633	
   634		/*
   635		 * Step 3: Process LISTEN state
   636		 *
   637		 * Set S.ISR, S.GSR, S.SWL, S.SWH from packet or Init Cookie
   638		 *
   639		 * Setting S.SWL/S.SWH to is deferred to dccp_create_openreq_child().
   640		 */
   641		dreq->dreq_isr	   = dcb->dccpd_seq;
   642		dreq->dreq_gsr	   = dreq->dreq_isr;
   643		dreq->dreq_iss	   = dccp_v4_init_sequence(skb);
   644		dreq->dreq_gss     = dreq->dreq_iss;
   645		dreq->dreq_service = service;
   646	
   647		if (dccp_v4_send_response(sk, req))
   648			goto drop_and_free;
   649	
   650		inet_csk_reqsk_queue_hash_add(sk, req, DCCP_TIMEOUT_INIT);
   651		reqsk_put(req);
   652		return 0;
   653	
   654	drop_and_free:
   655		reqsk_free(req);
   656	drop:
   657		__DCCP_INC_STATS(DCCP_MIB_ATTEMPTFAILS);
   658		return -1;
   659	}
   660	EXPORT_SYMBOL_GPL(dccp_v4_conn_request);
   661	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp