From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@01.org, wenxu@ucloud.cn
Cc: kbuild-all@01.org, netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH] ip_tunnel: Add ip tunnel tunnel_info dst_cache in ip_tunnel_xmit
Date: Mon, 25 Feb 2019 09:27:06 +0300 [thread overview]
Message-ID: <20190225062706.GC3982@kadam> (raw)
In-Reply-To: <1550750930-27138-1-git-send-email-wenxu@ucloud.cn>
Hi wenxu,
Thank you for the patch! Perhaps something to improve:
url: https://github.com/0day-ci/linux/commits/wenxu-ucloud-cn/ip_tunnel-Add-ip-tunnel-tunnel_info-dst_cache-in-ip_tunnel_xmit/20190224-065214
smatch warnings:
net/ipv4/ip_tunnel.c:734 ip_tunnel_xmit() error: uninitialized symbol 'rt'.
# https://github.com/0day-ci/linux/commit/fb0c8c40052c62033bf5f92559eabe4e7a98851e
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout fb0c8c40052c62033bf5f92559eabe4e7a98851e
vim +/rt +734 net/ipv4/ip_tunnel.c
7d442fab0 Tom Herbert 2014-01-02 717
b0066da52 Petr Machata 2018-02-27 718 ip_tunnel_init_flow(&fl4, protocol, dst, tnl_params->saddr,
9830ad4c6 Craig Gallek 2017-04-19 719 tunnel->parms.o_key, RT_TOS(tos), tunnel->parms.link,
9830ad4c6 Craig Gallek 2017-04-19 720 tunnel->fwmark);
7d442fab0 Tom Herbert 2014-01-02 721
563284865 Tom Herbert 2014-09-17 722 if (ip_tunnel_encap(skb, tunnel, &protocol, &fl4) < 0)
563284865 Tom Herbert 2014-09-17 723 goto tx_error;
563284865 Tom Herbert 2014-09-17 724
fb0c8c400 wenxu 2019-02-21 725 if (connected && md) {
fb0c8c400 wenxu 2019-02-21 726 use_cache = ip_tunnel_dst_cache_usable(skb, tun_info);
fb0c8c400 wenxu 2019-02-21 727 if (use_cache)
fb0c8c400 wenxu 2019-02-21 728 rt = dst_cache_get_ip4(&tun_info->dst_cache, &fl4.saddr);
What about if "use_cache" is false? "rt" is potentially not set.
fb0c8c400 wenxu 2019-02-21 729 } else {
e09acddf8 Paolo Abeni 2016-02-12 730 rt = connected ? dst_cache_get_ip4(&tunnel->dst_cache, &fl4.saddr) :
e09acddf8 Paolo Abeni 2016-02-12 731 NULL;
fb0c8c400 wenxu 2019-02-21 732 }
7d442fab0 Tom Herbert 2014-01-02 733
7d442fab0 Tom Herbert 2014-01-02 @734 if (!rt) {
^^^
7d442fab0 Tom Herbert 2014-01-02 735 rt = ip_route_output_key(tunnel->net, &fl4);
c54419321 Pravin B Shelar 2013-03-25 736
c54419321 Pravin B Shelar 2013-03-25 737 if (IS_ERR(rt)) {
c54419321 Pravin B Shelar 2013-03-25 738 dev->stats.tx_carrier_errors++;
c54419321 Pravin B Shelar 2013-03-25 739 goto tx_error;
c54419321 Pravin B Shelar 2013-03-25 740 }
fb0c8c400 wenxu 2019-02-21 741 if (use_cache)
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
prev parent reply other threads:[~2019-02-25 6:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-21 12:08 [PATCH] ip_tunnel: Add ip tunnel tunnel_info dst_cache in ip_tunnel_xmit wenxu
2019-02-21 18:37 ` David Miller
2019-02-23 23:28 ` kbuild test robot
2019-02-25 6:27 ` Dan Carpenter [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=20190225062706.GC3982@kadam \
--to=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=kbuild-all@01.org \
--cc=kbuild@01.org \
--cc=netdev@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).