Re: [PATCH 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-10-18 Thread David Lebrun
On 10/17/2016 07:07 PM, Tom Herbert wrote: >> +static inline void seg6_pernet_lock(struct net *net) >> +{ >> + mutex_lock(&seg6_pernet(net)->lock); >> +} >> + >> +static inline void seg6_pernet_unlock(struct net *net) >> +{ >> + mutex_unlock(&seg6_pernet(net)->lock); >> +} >> + > IMO it

Re: [PATCH 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-10-17 Thread Tom Herbert
On Mon, Oct 17, 2016 at 7:42 AM, David Lebrun wrote: > This patch adds the necessary hooks and structures to provide support > for SR-IPv6 control plane, essentially the Generic Netlink commands > that will be used for userspace control over the Segment Routing > kernel structures. > > The genetli

Re: [PATCH 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-10-17 Thread David Miller
From: David Lebrun Date: Mon, 17 Oct 2016 17:06:06 +0200 > The mutex is not taken, just initialized. Unless mutex_init takes the > lock, which would be quite strange ? My bad, I misread the code.

Re: [PATCH 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-10-17 Thread David Miller
From: David Lebrun Date: Mon, 17 Oct 2016 16:42:23 +0200 > +static int seg6_genl_set_tunsrc(struct sk_buff *skb, struct genl_info *info) > +{ > + struct net *net = genl_info_net(info); > + struct seg6_pernet_data *sdata = seg6_pernet(net); > + struct in6_addr *val, *t_old, *t_new; Pl

Re: [PATCH 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-10-17 Thread David Lebrun
On 10/17/2016 05:00 PM, David Miller wrote: > Please ordre local variables from longest to shortest line (AKA reverse > christmas tree layout). > > Please audit your entire submission for this problem. > >> +val = (struct in6_addr *)nla_data(info->attrs[SEG6_ATTR_DST]); > > Please remove all

[PATCH 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-10-17 Thread David Lebrun
This patch adds the necessary hooks and structures to provide support for SR-IPv6 control plane, essentially the Generic Netlink commands that will be used for userspace control over the Segment Routing kernel structures. The genetlink commands provide control over two different structures: tunnel