Netdev List
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Peter Oskolkov <posk@google.com>
Cc: kbuild-all@01.org, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	netdev@vger.kernel.org, Peter Oskolkov <posk@posk.io>,
	David Ahern <dsahern@gmail.com>,
	Willem de Bruijn <willemb@google.com>,
	Peter Oskolkov <posk@google.com>
Subject: Re: [PATCH bpf-next v8 4/6] bpf: add handling of BPF_LWT_REROUTE to lwt_bpf.c
Date: Sat, 9 Feb 2019 07:20:35 +0800	[thread overview]
Message-ID: <201902090750.tc7OlLPX%fengguang.wu@intel.com> (raw)
In-Reply-To: <20190208163849.151626-5-posk@google.com>

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

Hi Peter,

Thank you for the patch! Perhaps something to improve:

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

url:    https://github.com/0day-ci/linux/commits/Peter-Oskolkov/bpf-add-BPF_LWT_ENCAP_IP-option-to-bpf_lwt_push_encap/20190209-030743
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: x86_64-randconfig-j0-02040958 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   net//core/lwt_bpf.c: In function 'bpf_lwt_xmit_reroute':
>> net//core/lwt_bpf.c:216:10: warning: missing braces around initializer [-Wmissing-braces]
      struct flowi4 fl4 = {0};
             ^
   net//core/lwt_bpf.c:216:10: warning: (near initialization for 'fl4.__fl_common') [-Wmissing-braces]

vim +216 net//core/lwt_bpf.c

   184	
   185	static int bpf_lwt_xmit_reroute(struct sk_buff *skb)
   186	{
   187		struct net_device *l3mdev = l3mdev_master_dev_rcu(skb_dst(skb)->dev);
   188		int oif = l3mdev ? l3mdev->ifindex : 0;
   189		struct dst_entry *dst = NULL;
   190		struct sock *sk;
   191		struct net *net;
   192		bool ipv4;
   193		int err;
   194	
   195		if (skb->protocol == htons(ETH_P_IP)) {
   196			ipv4 = true;
   197		} else if (skb->protocol == htons(ETH_P_IPV6)) {
   198			ipv4 = false;
   199		} else {
   200			pr_warn_once("BPF_LWT_REROUTE xmit: unsupported proto %d\n",
   201				     skb->protocol);
   202			return -EINVAL;
   203		}
   204	
   205		sk = sk_to_full_sk(skb->sk);
   206		if (sk) {
   207			if (sk->sk_bound_dev_if)
   208				oif = sk->sk_bound_dev_if;
   209			net = sock_net(sk);
   210		} else {
   211			net = dev_net(skb_dst(skb)->dev);
   212		}
   213	
   214		if (ipv4) {
   215			struct iphdr *iph = ip_hdr(skb);
 > 216			struct flowi4 fl4 = {0};
   217			struct rtable *rt;
   218	
   219			fl4.flowi4_oif = oif;
   220			fl4.flowi4_mark = skb->mark;
   221			fl4.flowi4_uid = sock_net_uid(net, sk);
   222			fl4.flowi4_tos = RT_TOS(iph->tos);
   223			fl4.flowi4_flags = FLOWI_FLAG_ANYSRC;
   224			fl4.flowi4_proto = iph->protocol;
   225			fl4.daddr = iph->daddr;
   226			fl4.saddr = iph->saddr;
   227	
   228			rt = ip_route_output_key(net, &fl4);
   229			if (IS_ERR(rt) || rt->dst.error)
   230				return -EINVAL;
   231			dst = &rt->dst;
   232		} else {
   233	#if IS_BUILTIN(CONFIG_IPV6)
   234			struct ipv6hdr *iph6 = ipv6_hdr(skb);
   235			struct flowi6 fl6 = {0};
   236	
   237			fl6.flowi6_oif = oif;
   238			fl6.flowi6_mark = skb->mark;
   239			fl6.flowi6_uid = sock_net_uid(net, sk);
   240			fl6.flowlabel = ip6_flowinfo(iph6);
   241			fl6.flowi6_proto = iph6->nexthdr;
   242			fl6.daddr = iph6->daddr;
   243			fl6.saddr = iph6->saddr;
   244	
   245			dst = ip6_route_output(net, skb->sk, &fl6);
   246			if (IS_ERR(dst) || dst->error)
   247				return -EINVAL;
   248	#else
   249			pr_warn_once("BPF_LWT_REROUTE xmit: IPV6 not built-in\n");
   250			return -EINVAL;
   251	#endif
   252		}
   253	
   254		/* Although skb header was reserved in bpf_lwt_push_ip_encap(), it
   255		 * was done for the previous dst, so we are doing it here again, in
   256		 * case the new dst needs much more space. The call below is a noop
   257		 * if there is enough header space in skb.
   258		 */
   259		err = skb_cow_head(skb, LL_RESERVED_SPACE(dst->dev));
   260		if (unlikely(err))
   261			return err;
   262	
   263		skb_dst_drop(skb);
   264		skb_dst_set(skb, dst);
   265	
   266		err = dst_output(dev_net(skb_dst(skb)->dev), skb->sk, skb);
   267		if (unlikely(err))
   268			return err;
   269	
   270		/* ip[6]_finish_output2 understand LWTUNNEL_XMIT_DONE */
   271		return LWTUNNEL_XMIT_DONE;
   272	}
   273	

---
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: 29197 bytes --]

  reply	other threads:[~2019-02-08 23:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08 16:38 [PATCH bpf-next v8 0/6] bpf: add BPF_LWT_ENCAP_IP option to bpf_lwt_push_encap Peter Oskolkov
2019-02-08 16:38 ` [PATCH bpf-next v8 1/6] bpf: add plumbing for BPF_LWT_ENCAP_IP in bpf_lwt_push_encap Peter Oskolkov
2019-02-08 16:38 ` [PATCH bpf-next v8 2/6] bpf: implement BPF_LWT_ENCAP_IP mode " Peter Oskolkov
2019-02-08 16:38 ` [PATCH bpf-next v8 3/6] bpf: handle GSO " Peter Oskolkov
2019-02-08 16:38 ` [PATCH bpf-next v8 4/6] bpf: add handling of BPF_LWT_REROUTE to lwt_bpf.c Peter Oskolkov
2019-02-08 23:20   ` kbuild test robot [this message]
2019-02-08 23:24   ` David Ahern
2019-02-08 16:38 ` [PATCH bpf-next v8 5/6] bpf: sync <kdir>/include/.../bpf.h with tools/include/.../bpf.h Peter Oskolkov
2019-02-08 16:38 ` [PATCH bpf-next v8 6/6] selftests: bpf: add test_lwt_ip_encap selftest Peter Oskolkov

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=201902090750.tc7OlLPX%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dsahern@gmail.com \
    --cc=kbuild-all@01.org \
    --cc=netdev@vger.kernel.org \
    --cc=posk@google.com \
    --cc=posk@posk.io \
    --cc=willemb@google.com \
    /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