Re: [PATCH net-next v3] net: Add sysctl to toggle early demux for tcp and udp

2017-03-23 Thread kbuild test robot
Hi Subash,

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

url:
https://github.com/0day-ci/linux/commits/Subash-Abhinov-Kasiviswanathan/net-Add-sysctl-to-toggle-early-demux-for-tcp-and-udp/20170323-182822
config: alpha-defconfig (attached as .config)
compiler: alpha-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=alpha 

All errors (new ones prefixed by >>):

   net/built-in.o: In function `proc_tcp_early_demux':
   net/ipv4/sysctl_net_ipv4.c:308: undefined reference to 
`tcp_v6_early_demux_configure'
   net/ipv4/sysctl_net_ipv4.c:308: undefined reference to 
`tcp_v6_early_demux_configure'
   net/built-in.o: In function `proc_udp_early_demux':
>> net/ipv4/sysctl_net_ipv4.c:325: undefined reference to 
>> `udp_v6_early_demux_configure'
>> net/ipv4/sysctl_net_ipv4.c:325: undefined reference to 
>> `udp_v6_early_demux_configure'

vim +325 net/ipv4/sysctl_net_ipv4.c

   302  ret = proc_dointvec(table, write, buffer, lenp, ppos);
   303  
   304  if (write && !ret) {
   305  int enabled = init_net.ipv4.sysctl_tcp_early_demux;
   306  
   307  tcp_v4_early_demux_configure(enabled);
 > 308  tcp_v6_early_demux_configure(enabled);
   309  }
   310  
   311  return ret;
   312  }
   313  
   314  static int proc_udp_early_demux(struct ctl_table *table, int write,
   315  void __user *buffer, size_t *lenp, 
loff_t *ppos)
   316  {
   317  int ret = 0;
   318  
   319  ret = proc_dointvec(table, write, buffer, lenp, ppos);
   320  
   321  if (write && !ret) {
   322  int enabled = init_net.ipv4.sysctl_udp_early_demux;
   323  
   324  udp_v4_early_demux_configure(enabled);
 > 325  udp_v6_early_demux_configure(enabled);
   326  }
   327  
   328  return ret;

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


.config.gz
Description: application/gzip


Re: [PATCH net-next v3] net: Add sysctl to toggle early demux for tcp and udp

2017-03-23 Thread kbuild test robot
Hi Subash,

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

url:
https://github.com/0day-ci/linux/commits/Subash-Abhinov-Kasiviswanathan/net-Add-sysctl-to-toggle-early-demux-for-tcp-and-udp/20170323-182822
config: x86_64-kexec (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All errors (new ones prefixed by >>):

   net/built-in.o: In function `proc_tcp_early_demux':
   sysctl_net_ipv4.c:(.text+0x7fe04): undefined reference to 
`tcp_v6_early_demux_configure'
   net/built-in.o: In function `proc_udp_early_demux':
>> sysctl_net_ipv4.c:(.text+0x7fe3d): undefined reference to 
>> `udp_v6_early_demux_configure'

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


.config.gz
Description: application/gzip


Re: [PATCH net-next v3] net: Add sysctl to toggle early demux for tcp and udp

2017-03-22 Thread David Miller
From: Subash Abhinov Kasiviswanathan 
Date: Tue, 21 Mar 2017 21:20:10 -0600

> @@ -329,7 +329,7 @@ static int ip_rcv_finish(struct net *net, struct sock 
> *sk, struct sk_buff *skb)
>   int protocol = iph->protocol;
>  
>   ipprot = rcu_dereference(inet_protos[protocol]);
> - if (ipprot && ipprot->early_demux) {
> + if (ipprot && READ_ONCE(ipprot->early_demux)) {
>   ipprot->early_demux(skb);

I think you need to use a local variable for the function pointer in conjunction
with READ_ONCE() for this to work properly:

if (ipprot && (func = READ_ONCE(ipprot->early_demux))) {
func(skb);
...

> diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
> index aacfb4b..30d18cb 100644
> --- a/net/ipv6/ip6_input.c
> +++ b/net/ipv6/ip6_input.c
> @@ -60,7 +60,7 @@ int ip6_rcv_finish(struct net *net, struct sock *sk, struct 
> sk_buff *skb)
>   const struct inet6_protocol *ipprot;
>  
>   ipprot = rcu_dereference(inet6_protos[ipv6_hdr(skb)->nexthdr]);
> - if (ipprot && ipprot->early_demux)
> + if (ipprot && READ_ONCE(ipprot->early_demux))
>   ipprot->early_demux(skb);
>   }
>   if (!skb_valid_dst(skb))

Likewise.