lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 9 Apr 2019 17:50:43 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Paolo Abeni <pabeni@...hat.com>
Cc:     kbuild-all@...org, netdev@...r.kernel.org,
        "David S. Miller" <davem@...emloft.net>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...nulli.us>,
        Eric Dumazet <edumazet@...gle.com>,
        Ivan Vecera <ivecera@...hat.com>
Subject: Re: [PATCH net-next 3/5] net: sched: always do stats accounting
 according to TCQ_F_CPUSTATS

Hi Paolo,

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/Paolo-Abeni/net-caif-avoid-using-qdisc_qlen/20190409-164620
config: i386-randconfig-x077-201914 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   In file included from include/linux/filter.h:24:0,
                    from include/net/sock.h:64,
                    from net//vmw_vsock/af_vsock.c:118:
   include/net/sch_generic.h: In function 'qdisc_all_tx_empty':
>> include/net/sch_generic.h:743:8: error: implicit declaration of function 'qdisc_is_empty'; did you mean 'ida_is_empty'? [-Werror=implicit-function-declaration]
      if (!qdisc_is_empty(q)) {
           ^~~~~~~~~~~~~~
           ida_is_empty
   include/net/sch_generic.h: At top level:
>> include/net/sch_generic.h:818:20: error: conflicting types for 'qdisc_is_empty'
    static inline bool qdisc_is_empty(const struct Qdisc *qdisc)
                       ^~~~~~~~~~~~~~
   include/net/sch_generic.h:743:8: note: previous implicit declaration of 'qdisc_is_empty' was here
      if (!qdisc_is_empty(q)) {
           ^~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/filter.h:24:0,
                    from include/net/sock.h:64,
                    from include/net/inet_sock.h:26,
                    from include/net/inet_connection_sock.h:24,
                    from include/linux/dccp.h:13,
                    from net//dccp/proto.c:12:
   include/net/sch_generic.h: In function 'qdisc_all_tx_empty':
>> include/net/sch_generic.h:743:8: error: implicit declaration of function 'qdisc_is_empty'; did you mean 'ida_is_empty'? [-Werror=implicit-function-declaration]
      if (!qdisc_is_empty(q)) {
           ^~~~~~~~~~~~~~
           ida_is_empty
   include/net/sch_generic.h: At top level:
>> include/net/sch_generic.h:818:20: error: conflicting types for 'qdisc_is_empty'
    static inline bool qdisc_is_empty(const struct Qdisc *qdisc)
                       ^~~~~~~~~~~~~~
   include/net/sch_generic.h:743:8: note: previous implicit declaration of 'qdisc_is_empty' was here
      if (!qdisc_is_empty(q)) {
           ^~~~~~~~~~~~~~
   In file included from net//dccp/trace.h:84:0,
                    from net//dccp/proto.c:42:
   include/trace/define_trace.h:89:42: fatal error: ./trace.h: No such file or directory
    #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
                                             ^
   cc1: some warnings being treated as errors
   compilation terminated.

vim +743 include/net/sch_generic.h

5aa709954 David S. Miller 2008-07-08  732  
3e745dd69 David S. Miller 2008-07-08  733  /* Are all TX queues of the device empty?  */
3e745dd69 David S. Miller 2008-07-08  734  static inline bool qdisc_all_tx_empty(const struct net_device *dev)
3e745dd69 David S. Miller 2008-07-08  735  {
e8a0464cc David S. Miller 2008-07-17  736  	unsigned int i;
46e5da40a John Fastabend  2014-09-12  737  
46e5da40a John Fastabend  2014-09-12  738  	rcu_read_lock();
e8a0464cc David S. Miller 2008-07-17  739  	for (i = 0; i < dev->num_tx_queues; i++) {
e8a0464cc David S. Miller 2008-07-17  740  		struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
46e5da40a John Fastabend  2014-09-12  741  		const struct Qdisc *q = rcu_dereference(txq->qdisc);
3e745dd69 David S. Miller 2008-07-08  742  
630dee66e Paolo Abeni     2019-04-08 @743  		if (!qdisc_is_empty(q)) {
46e5da40a John Fastabend  2014-09-12  744  			rcu_read_unlock();
e8a0464cc David S. Miller 2008-07-17  745  			return false;
e8a0464cc David S. Miller 2008-07-17  746  		}
46e5da40a John Fastabend  2014-09-12  747  	}
46e5da40a John Fastabend  2014-09-12  748  	rcu_read_unlock();
e8a0464cc David S. Miller 2008-07-17  749  	return true;
3e745dd69 David S. Miller 2008-07-08  750  }
3e745dd69 David S. Miller 2008-07-08  751  
6fa9864b5 David S. Miller 2008-07-08  752  /* Are any of the TX qdiscs changing?  */
05bdd2f14 Eric Dumazet    2011-10-20  753  static inline bool qdisc_tx_changing(const struct net_device *dev)
6fa9864b5 David S. Miller 2008-07-08  754  {
e8a0464cc David S. Miller 2008-07-17  755  	unsigned int i;
46e5da40a John Fastabend  2014-09-12  756  
e8a0464cc David S. Miller 2008-07-17  757  	for (i = 0; i < dev->num_tx_queues; i++) {
e8a0464cc David S. Miller 2008-07-17  758  		struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
46e5da40a John Fastabend  2014-09-12  759  		if (rcu_access_pointer(txq->qdisc) != txq->qdisc_sleeping)
e8a0464cc David S. Miller 2008-07-17  760  			return true;
e8a0464cc David S. Miller 2008-07-17  761  	}
e8a0464cc David S. Miller 2008-07-17  762  	return false;
6fa9864b5 David S. Miller 2008-07-08  763  }
6fa9864b5 David S. Miller 2008-07-08  764  
e8a0464cc David S. Miller 2008-07-17  765  /* Is the device using the noop qdisc on all queues?  */
052979499 David S. Miller 2008-07-08  766  static inline bool qdisc_tx_is_noop(const struct net_device *dev)
052979499 David S. Miller 2008-07-08  767  {
e8a0464cc David S. Miller 2008-07-17  768  	unsigned int i;
46e5da40a John Fastabend  2014-09-12  769  
e8a0464cc David S. Miller 2008-07-17  770  	for (i = 0; i < dev->num_tx_queues; i++) {
e8a0464cc David S. Miller 2008-07-17  771  		struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
46e5da40a John Fastabend  2014-09-12  772  		if (rcu_access_pointer(txq->qdisc) != &noop_qdisc)
e8a0464cc David S. Miller 2008-07-17  773  			return false;
e8a0464cc David S. Miller 2008-07-17  774  	}
e8a0464cc David S. Miller 2008-07-17  775  	return true;
052979499 David S. Miller 2008-07-08  776  }
052979499 David S. Miller 2008-07-08  777  
bfe0d0298 Eric Dumazet    2011-01-09  778  static inline unsigned int qdisc_pkt_len(const struct sk_buff *skb)
0abf77e55 Jussi Kivilinna 2008-07-20  779  {
175f9c1bb Jussi Kivilinna 2008-07-20  780  	return qdisc_skb_cb(skb)->pkt_len;
0abf77e55 Jussi Kivilinna 2008-07-20  781  }
0abf77e55 Jussi Kivilinna 2008-07-20  782  
c27f339af Jarek Poplawski 2008-08-04  783  /* additional qdisc xmit flags (NET_XMIT_MASK in linux/netdevice.h) */
378a2f090 Jarek Poplawski 2008-08-04  784  enum net_xmit_qdisc_t {
378a2f090 Jarek Poplawski 2008-08-04  785  	__NET_XMIT_STOLEN = 0x00010000,
c27f339af Jarek Poplawski 2008-08-04  786  	__NET_XMIT_BYPASS = 0x00020000,
378a2f090 Jarek Poplawski 2008-08-04  787  };
378a2f090 Jarek Poplawski 2008-08-04  788  
c27f339af Jarek Poplawski 2008-08-04  789  #ifdef CONFIG_NET_CLS_ACT
378a2f090 Jarek Poplawski 2008-08-04  790  #define net_xmit_drop_count(e)	((e) & __NET_XMIT_STOLEN ? 0 : 1)
378a2f090 Jarek Poplawski 2008-08-04  791  #else
378a2f090 Jarek Poplawski 2008-08-04  792  #define net_xmit_drop_count(e)	(1)
378a2f090 Jarek Poplawski 2008-08-04  793  #endif
378a2f090 Jarek Poplawski 2008-08-04  794  
a2da570d6 Eric Dumazet    2011-01-20  795  static inline void qdisc_calculate_pkt_len(struct sk_buff *skb,
a2da570d6 Eric Dumazet    2011-01-20  796  					   const struct Qdisc *sch)
5f86173bd Jussi Kivilinna 2008-07-20  797  {
3a682fbd7 David S. Miller 2008-07-20  798  #ifdef CONFIG_NET_SCHED
a2da570d6 Eric Dumazet    2011-01-20  799  	struct qdisc_size_table *stab = rcu_dereference_bh(sch->stab);
a2da570d6 Eric Dumazet    2011-01-20  800  
a2da570d6 Eric Dumazet    2011-01-20  801  	if (stab)
a2da570d6 Eric Dumazet    2011-01-20  802  		__qdisc_calculate_pkt_len(skb, stab);
3a682fbd7 David S. Miller 2008-07-20  803  #endif
a2da570d6 Eric Dumazet    2011-01-20  804  }
a2da570d6 Eric Dumazet    2011-01-20  805  
520ac30f4 Eric Dumazet    2016-06-21  806  static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,
520ac30f4 Eric Dumazet    2016-06-21  807  				struct sk_buff **to_free)
a2da570d6 Eric Dumazet    2011-01-20  808  {
a2da570d6 Eric Dumazet    2011-01-20  809  	qdisc_calculate_pkt_len(skb, sch);
520ac30f4 Eric Dumazet    2016-06-21  810  	return sch->enqueue(skb, sch, to_free);
5f86173bd Jussi Kivilinna 2008-07-20  811  }
5f86173bd Jussi Kivilinna 2008-07-20  812  
22e0f8b93 John Fastabend  2014-09-28  813  static inline bool qdisc_is_percpu_stats(const struct Qdisc *q)
22e0f8b93 John Fastabend  2014-09-28  814  {
22e0f8b93 John Fastabend  2014-09-28  815  	return q->flags & TCQ_F_CPUSTATS;
22e0f8b93 John Fastabend  2014-09-28  816  }
bfe0d0298 Eric Dumazet    2011-01-09  817  
9cda4ff7e Paolo Abeni     2019-04-08 @818  static inline bool qdisc_is_empty(const struct Qdisc *qdisc)
9cda4ff7e Paolo Abeni     2019-04-08  819  {
9cda4ff7e Paolo Abeni     2019-04-08  820  	if (qdisc_is_percpu_stats(qdisc))
9cda4ff7e Paolo Abeni     2019-04-08  821  		return qdisc->empty;
9cda4ff7e Paolo Abeni     2019-04-08  822  	return !qdisc->q.qlen;
9cda4ff7e Paolo Abeni     2019-04-08  823  }
9cda4ff7e Paolo Abeni     2019-04-08  824  

:::::: The code at line 743 was first introduced by commit
:::::: 630dee66e06a4ec68b87f0d1a9959b54b42f8959 net: sched: prefer qdisc_is_empty() over direct qlen access

:::::: TO: Paolo Abeni <pabeni@...hat.com>
:::::: CC: 0day robot <lkp@...el.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (32236 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ