From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH net] net, ip_tunnel: fix interface lookup with no key
Date: Thu, 26 Mar 2020 14:00:24 +0800 [thread overview]
Message-ID: <202003261321.8FXYp3vD%lkp@intel.com> (raw)
In-Reply-To: <20200325150304.5506-1-w.dauchy@criteo.com>
[-- Attachment #1: Type: text/plain, Size: 8977 bytes --]
Hi William,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net/master]
[also build test WARNING on linus/master v5.6-rc7 next-20200325]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/William-Dauchy/net-ip_tunnel-fix-interface-lookup-with-no-key/20200326-101601
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git 2910594fd38d1cb3c32fbf235e6c6228c780ab87
config: x86_64-defconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 4b428e8f18c7006f69b3d4ef0fdf091d998d0941)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> net/ipv4/ip_tunnel.c:158:1: warning: unused label 'skip_key_lookup' [-Wunused-label]
skip_key_lookup:
^~~~~~~~~~~~~~~~
1 warning generated.
vim +/skip_key_lookup +158 net/ipv4/ip_tunnel.c
c5441932145563 Pravin B Shelar 2013-03-25 73
c5441932145563 Pravin B Shelar 2013-03-25 74 Tunnel hash table:
c5441932145563 Pravin B Shelar 2013-03-25 75 We require exact key match i.e. if a key is present in packet
c5441932145563 Pravin B Shelar 2013-03-25 76 it will match only tunnel with the same key; if it is not present,
c5441932145563 Pravin B Shelar 2013-03-25 77 it will match only keyless tunnel.
c5441932145563 Pravin B Shelar 2013-03-25 78
c5441932145563 Pravin B Shelar 2013-03-25 79 All keysless packets, if not matched configured keyless tunnels
c5441932145563 Pravin B Shelar 2013-03-25 80 will match fallback tunnel.
c5441932145563 Pravin B Shelar 2013-03-25 81 Given src, dst and key, find appropriate for input tunnel.
c5441932145563 Pravin B Shelar 2013-03-25 82 */
c5441932145563 Pravin B Shelar 2013-03-25 83 struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
c5441932145563 Pravin B Shelar 2013-03-25 84 int link, __be16 flags,
c5441932145563 Pravin B Shelar 2013-03-25 85 __be32 remote, __be32 local,
c5441932145563 Pravin B Shelar 2013-03-25 86 __be32 key)
c5441932145563 Pravin B Shelar 2013-03-25 87 {
c5441932145563 Pravin B Shelar 2013-03-25 88 unsigned int hash;
c5441932145563 Pravin B Shelar 2013-03-25 89 struct ip_tunnel *t, *cand = NULL;
c5441932145563 Pravin B Shelar 2013-03-25 90 struct hlist_head *head;
c5441932145563 Pravin B Shelar 2013-03-25 91
967680e02724af Duan Jiong 2014-01-19 92 hash = ip_tunnel_hash(key, remote);
c5441932145563 Pravin B Shelar 2013-03-25 93 head = &itn->tunnels[hash];
c5441932145563 Pravin B Shelar 2013-03-25 94
c5441932145563 Pravin B Shelar 2013-03-25 95 hlist_for_each_entry_rcu(t, head, hash_node) {
c5441932145563 Pravin B Shelar 2013-03-25 96 if (local != t->parms.iph.saddr ||
c5441932145563 Pravin B Shelar 2013-03-25 97 remote != t->parms.iph.daddr ||
c5441932145563 Pravin B Shelar 2013-03-25 98 !(t->dev->flags & IFF_UP))
c5441932145563 Pravin B Shelar 2013-03-25 99 continue;
c5441932145563 Pravin B Shelar 2013-03-25 100
c5441932145563 Pravin B Shelar 2013-03-25 101 if (!ip_tunnel_key_match(&t->parms, flags, key))
c5441932145563 Pravin B Shelar 2013-03-25 102 continue;
c5441932145563 Pravin B Shelar 2013-03-25 103
c5441932145563 Pravin B Shelar 2013-03-25 104 if (t->parms.link == link)
c5441932145563 Pravin B Shelar 2013-03-25 105 return t;
c5441932145563 Pravin B Shelar 2013-03-25 106 else
c5441932145563 Pravin B Shelar 2013-03-25 107 cand = t;
c5441932145563 Pravin B Shelar 2013-03-25 108 }
c5441932145563 Pravin B Shelar 2013-03-25 109
c5441932145563 Pravin B Shelar 2013-03-25 110 hlist_for_each_entry_rcu(t, head, hash_node) {
c5441932145563 Pravin B Shelar 2013-03-25 111 if (remote != t->parms.iph.daddr ||
e0056593b61253 Dmitry Popov 2014-07-05 112 t->parms.iph.saddr != 0 ||
c5441932145563 Pravin B Shelar 2013-03-25 113 !(t->dev->flags & IFF_UP))
c5441932145563 Pravin B Shelar 2013-03-25 114 continue;
c5441932145563 Pravin B Shelar 2013-03-25 115
c5441932145563 Pravin B Shelar 2013-03-25 116 if (!ip_tunnel_key_match(&t->parms, flags, key))
c5441932145563 Pravin B Shelar 2013-03-25 117 continue;
c5441932145563 Pravin B Shelar 2013-03-25 118
c5441932145563 Pravin B Shelar 2013-03-25 119 if (t->parms.link == link)
c5441932145563 Pravin B Shelar 2013-03-25 120 return t;
c5441932145563 Pravin B Shelar 2013-03-25 121 else if (!cand)
c5441932145563 Pravin B Shelar 2013-03-25 122 cand = t;
c5441932145563 Pravin B Shelar 2013-03-25 123 }
c5441932145563 Pravin B Shelar 2013-03-25 124
967680e02724af Duan Jiong 2014-01-19 125 hash = ip_tunnel_hash(key, 0);
c5441932145563 Pravin B Shelar 2013-03-25 126 head = &itn->tunnels[hash];
c5441932145563 Pravin B Shelar 2013-03-25 127
c5441932145563 Pravin B Shelar 2013-03-25 128 hlist_for_each_entry_rcu(t, head, hash_node) {
e0056593b61253 Dmitry Popov 2014-07-05 129 if ((local != t->parms.iph.saddr || t->parms.iph.daddr != 0) &&
e0056593b61253 Dmitry Popov 2014-07-05 130 (local != t->parms.iph.daddr || !ipv4_is_multicast(local)))
e0056593b61253 Dmitry Popov 2014-07-05 131 continue;
e0056593b61253 Dmitry Popov 2014-07-05 132
e0056593b61253 Dmitry Popov 2014-07-05 133 if (!(t->dev->flags & IFF_UP))
c5441932145563 Pravin B Shelar 2013-03-25 134 continue;
c5441932145563 Pravin B Shelar 2013-03-25 135
c5441932145563 Pravin B Shelar 2013-03-25 136 if (!ip_tunnel_key_match(&t->parms, flags, key))
c5441932145563 Pravin B Shelar 2013-03-25 137 continue;
c5441932145563 Pravin B Shelar 2013-03-25 138
c5441932145563 Pravin B Shelar 2013-03-25 139 if (t->parms.link == link)
c5441932145563 Pravin B Shelar 2013-03-25 140 return t;
c5441932145563 Pravin B Shelar 2013-03-25 141 else if (!cand)
c5441932145563 Pravin B Shelar 2013-03-25 142 cand = t;
c5441932145563 Pravin B Shelar 2013-03-25 143 }
c5441932145563 Pravin B Shelar 2013-03-25 144
c5441932145563 Pravin B Shelar 2013-03-25 145 hlist_for_each_entry_rcu(t, head, hash_node) {
c5441932145563 Pravin B Shelar 2013-03-25 146 if (t->parms.i_key != key ||
e0056593b61253 Dmitry Popov 2014-07-05 147 t->parms.iph.saddr != 0 ||
e0056593b61253 Dmitry Popov 2014-07-05 148 t->parms.iph.daddr != 0 ||
c5441932145563 Pravin B Shelar 2013-03-25 149 !(t->dev->flags & IFF_UP))
c5441932145563 Pravin B Shelar 2013-03-25 150 continue;
c5441932145563 Pravin B Shelar 2013-03-25 151
c5441932145563 Pravin B Shelar 2013-03-25 152 if (t->parms.link == link)
c5441932145563 Pravin B Shelar 2013-03-25 153 return t;
c5441932145563 Pravin B Shelar 2013-03-25 154 else if (!cand)
c5441932145563 Pravin B Shelar 2013-03-25 155 cand = t;
c5441932145563 Pravin B Shelar 2013-03-25 156 }
c5441932145563 Pravin B Shelar 2013-03-25 157
c5441932145563 Pravin B Shelar 2013-03-25 @158 skip_key_lookup:
c5441932145563 Pravin B Shelar 2013-03-25 159 if (cand)
c5441932145563 Pravin B Shelar 2013-03-25 160 return cand;
c5441932145563 Pravin B Shelar 2013-03-25 161
2e15ea390e6f44 Pravin B Shelar 2015-08-07 162 t = rcu_dereference(itn->collect_md_tun);
833a8b405465e9 Haishuang Yan 2017-09-12 163 if (t && t->dev->flags & IFF_UP)
2e15ea390e6f44 Pravin B Shelar 2015-08-07 164 return t;
2e15ea390e6f44 Pravin B Shelar 2015-08-07 165
c5441932145563 Pravin B Shelar 2013-03-25 166 if (itn->fb_tunnel_dev && itn->fb_tunnel_dev->flags & IFF_UP)
c5441932145563 Pravin B Shelar 2013-03-25 167 return netdev_priv(itn->fb_tunnel_dev);
c5441932145563 Pravin B Shelar 2013-03-25 168
c5441932145563 Pravin B Shelar 2013-03-25 169 return NULL;
c5441932145563 Pravin B Shelar 2013-03-25 170 }
c5441932145563 Pravin B Shelar 2013-03-25 171 EXPORT_SYMBOL_GPL(ip_tunnel_lookup);
c5441932145563 Pravin B Shelar 2013-03-25 172
:::::: The code at line 158 was first introduced by commit
:::::: c54419321455631079c7d6e60bc732dd0c5914c5 GRE: Refactor GRE tunneling code.
:::::: TO: Pravin B Shelar <pshelar@nicira.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29216 bytes --]
next prev parent reply other threads:[~2020-03-26 6:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-25 15:03 [PATCH net] net, ip_tunnel: fix interface lookup with no key William Dauchy
2020-03-25 15:22 ` William Dauchy
2020-03-26 6:00 ` kbuild test robot [this message]
2020-03-26 18:01 ` Nicolas Dichtel
2020-03-26 18:56 ` William Dauchy
2020-03-27 7:30 ` Nicolas Dichtel
2020-03-27 14:54 ` [PATCH v2 " William Dauchy
2020-03-27 18:15 ` Nicolas Dichtel
2020-03-27 18:56 ` [PATCH v3 " William Dauchy
2020-03-27 22:29 ` Nicolas Dichtel
2020-03-30 5:21 ` David Miller
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=202003261321.8FXYp3vD%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.