Netdev List
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: wenxu@ucloud.cn
Cc: kbuild-all@01.org, nikolay@cumulusnetworks.com,
	davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v3] route: Add multipath_hash in flowi_common to make user-define hash
Date: Sun, 24 Feb 2019 10:57:06 +0800	[thread overview]
Message-ID: <201902241040.HnDWRCfY%fengguang.wu@intel.com> (raw)
In-Reply-To: <1550933620-29738-1-git-send-email-wenxu@ucloud.cn>

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

Hi wenxu,

Thank you for the patch! Perhaps something to improve:

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

url:    https://github.com/0day-ci/linux/commits/wenxu-ucloud-cn/route-Add-multipath_hash-in-flowi_common-to-make-user-define-hash/20190224-075532
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

All warnings (new ones prefixed by >>):

   net/ipv4/route.c:771:46: sparse: warning: incorrect type in argument 2 (different base types)
   net/ipv4/route.c:771:46: sparse:    expected unsigned int [usertype] key
   net/ipv4/route.c:771:46: sparse:    got restricted __be32 [usertype] new_gw
>> net/ipv4/route.c:1823:35: sparse: warning: incorrect type in initializer (different base types)
   net/ipv4/route.c:1823:35: sparse:    expected unsigned int [usertype] multipath_hash
   net/ipv4/route.c:1823:35: sparse:    got restricted __be32 const [usertype] flowic_multipath_hash
   net/ipv4/route.c:2746:27: sparse: warning: incorrect type in assignment (different base types)
   net/ipv4/route.c:2746:27: sparse:    expected restricted __be16 [usertype] len
   net/ipv4/route.c:2746:27: sparse:    got unsigned long
--
>> include/net/ip_tunnels.h:254:36: sparse: warning: incorrect type in assignment (different base types)
   include/net/ip_tunnels.h:254:36: sparse:    expected restricted __be32 [usertype] flowic_multipath_hash
   include/net/ip_tunnels.h:254:36: sparse:    got unsigned int [usertype] tun_inner_hash
>> include/net/ip_tunnels.h:254:36: sparse: warning: incorrect type in assignment (different base types)
   include/net/ip_tunnels.h:254:36: sparse:    expected restricted __be32 [usertype] flowic_multipath_hash
   include/net/ip_tunnels.h:254:36: sparse:    got unsigned int [usertype] tun_inner_hash
>> include/net/ip_tunnels.h:254:36: sparse: warning: incorrect type in assignment (different base types)
   include/net/ip_tunnels.h:254:36: sparse:    expected restricted __be32 [usertype] flowic_multipath_hash
   include/net/ip_tunnels.h:254:36: sparse:    got unsigned int [usertype] tun_inner_hash
--
>> include/net/ip_tunnels.h:254:36: sparse: warning: incorrect type in assignment (different base types)
   include/net/ip_tunnels.h:254:36: sparse:    expected restricted __be32 [usertype] flowic_multipath_hash
   include/net/ip_tunnels.h:254:36: sparse:    got unsigned int [usertype] tun_inner_hash

sparse warnings: (new ones prefixed by >>)

   net/ipv4/route.c:771:46: sparse: warning: incorrect type in argument 2 (different base types)
   net/ipv4/route.c:771:46: sparse:    expected unsigned int [usertype] key
   net/ipv4/route.c:771:46: sparse:    got restricted __be32 [usertype] new_gw
   net/ipv4/route.c:1823:35: sparse: warning: incorrect type in initializer (different base types)
>> net/ipv4/route.c:1823:35: sparse:    expected unsigned int [usertype] multipath_hash
>> net/ipv4/route.c:1823:35: sparse:    got restricted __be32 const [usertype] flowic_multipath_hash
   net/ipv4/route.c:2746:27: sparse: warning: incorrect type in assignment (different base types)
   net/ipv4/route.c:2746:27: sparse:    expected restricted __be16 [usertype] len
   net/ipv4/route.c:2746:27: sparse:    got unsigned long
--
   include/net/ip_tunnels.h:254:36: sparse: warning: incorrect type in assignment (different base types)
>> include/net/ip_tunnels.h:254:36: sparse:    expected restricted __be32 [usertype] flowic_multipath_hash
>> include/net/ip_tunnels.h:254:36: sparse:    got unsigned int [usertype] tun_inner_hash
   include/net/ip_tunnels.h:254:36: sparse: warning: incorrect type in assignment (different base types)
>> include/net/ip_tunnels.h:254:36: sparse:    expected restricted __be32 [usertype] flowic_multipath_hash
>> include/net/ip_tunnels.h:254:36: sparse:    got unsigned int [usertype] tun_inner_hash
   include/net/ip_tunnels.h:254:36: sparse: warning: incorrect type in assignment (different base types)
>> include/net/ip_tunnels.h:254:36: sparse:    expected restricted __be32 [usertype] flowic_multipath_hash
>> include/net/ip_tunnels.h:254:36: sparse:    got unsigned int [usertype] tun_inner_hash
--
   include/net/ip_tunnels.h:254:36: sparse: warning: incorrect type in assignment (different base types)
>> include/net/ip_tunnels.h:254:36: sparse:    expected restricted __be32 [usertype] flowic_multipath_hash
>> include/net/ip_tunnels.h:254:36: sparse:    got unsigned int [usertype] tun_inner_hash

vim +1823 net/ipv4/route.c

  1818	
  1819	/* if skb is set it will be used and fl4 can be NULL */
  1820	int fib_multipath_hash(const struct net *net, const struct flowi4 *fl4,
  1821			       const struct sk_buff *skb, struct flow_keys *flkeys)
  1822	{
> 1823		u32 multipath_hash = fl4->flowi4_multipath_hash;
  1824		struct flow_keys hash_keys;
  1825		u32 mhash;
  1826	
  1827		switch (net->ipv4.sysctl_fib_multipath_hash_policy) {
  1828		case 0:
  1829			memset(&hash_keys, 0, sizeof(hash_keys));
  1830			hash_keys.control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
  1831			if (skb) {
  1832				ip_multipath_l3_keys(skb, &hash_keys);
  1833			} else {
  1834				hash_keys.addrs.v4addrs.src = fl4->saddr;
  1835				hash_keys.addrs.v4addrs.dst = fl4->daddr;
  1836			}
  1837			break;
  1838		case 1:
  1839			/* skb is currently provided only when forwarding */
  1840			if (skb) {
  1841				unsigned int flag = FLOW_DISSECTOR_F_STOP_AT_ENCAP;
  1842				struct flow_keys keys;
  1843	
  1844				/* short-circuit if we already have L4 hash present */
  1845				if (skb->l4_hash)
  1846					return skb_get_hash_raw(skb) >> 1;
  1847	
  1848				memset(&hash_keys, 0, sizeof(hash_keys));
  1849	
  1850				if (!flkeys) {
  1851					skb_flow_dissect_flow_keys(skb, &keys, flag);
  1852					flkeys = &keys;
  1853				}
  1854	
  1855				hash_keys.control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
  1856				hash_keys.addrs.v4addrs.src = flkeys->addrs.v4addrs.src;
  1857				hash_keys.addrs.v4addrs.dst = flkeys->addrs.v4addrs.dst;
  1858				hash_keys.ports.src = flkeys->ports.src;
  1859				hash_keys.ports.dst = flkeys->ports.dst;
  1860				hash_keys.basic.ip_proto = flkeys->basic.ip_proto;
  1861			} else {
  1862				memset(&hash_keys, 0, sizeof(hash_keys));
  1863				hash_keys.control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
  1864				hash_keys.addrs.v4addrs.src = fl4->saddr;
  1865				hash_keys.addrs.v4addrs.dst = fl4->daddr;
  1866				hash_keys.ports.src = fl4->fl4_sport;
  1867				hash_keys.ports.dst = fl4->fl4_dport;
  1868				hash_keys.basic.ip_proto = fl4->flowi4_proto;
  1869			}
  1870			break;
  1871		}
  1872		mhash = flow_hash_from_keys(&hash_keys);
  1873	
  1874		if (multipath_hash)
  1875			mhash = jhash_2words(mhash, multipath_hash, 0);
  1876	
  1877		return mhash >> 1;
  1878	}
  1879	#endif /* CONFIG_IP_ROUTE_MULTIPATH */
  1880	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 67279 bytes --]

      reply	other threads:[~2019-02-24  2:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-23 14:53 [PATCH net-next v3] route: Add multipath_hash in flowi_common to make user-define hash wenxu
2019-02-24  2:57 ` kbuild 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=201902241040.HnDWRCfY%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=davem@davemloft.net \
    --cc=kbuild-all@01.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=wenxu@ucloud.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox