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

2016-09-05 Thread Nicolas Dichtel
Le 01/09/2016 à 15:21, David Lebrun a écrit : > On 08/29/2016 05:31 PM, Roopa Prabhu wrote: >> This looks fine. But, i am just trying to see if this can be rtnetlink. >> Have you considered it already ?. >> We would like to keep the API consistent or abstracted to accommodate >> SR-MPLS in the >>

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

2016-09-01 Thread Stephen Hemminger
On Thu, 1 Sep 2016 15:25:14 +0200 David Lebrun wrote: > On 08/31/2016 07:10 PM, Stephen Hemminger wrote: > > Since these are for control operations why a mutex? > > I am not sure to understand the question. The spinlock is used on the > RCU write side of the namespace-wide parameters to preven

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

2016-09-01 Thread David Lebrun
On 08/31/2016 07:10 PM, Stephen Hemminger wrote: > Since these are for control operations why a mutex? I am not sure to understand the question. The spinlock is used on the RCU write side of the namespace-wide parameters to prevent concurrent writes. David signature.asc Description: OpenPGP di

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

2016-09-01 Thread David Lebrun
On 08/29/2016 05:31 PM, Roopa Prabhu wrote: > This looks fine. But, i am just trying to see if this can be rtnetlink. > Have you considered it already ?. > We would like to keep the API consistent or abstracted to accommodate SR-MPLS > in the > future too. so, any abstraction there will help. > >

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

2016-08-31 Thread Stephen Hemminger
On Fri, 26 Aug 2016 17:52:40 +0200 David Lebrun wrote: > +static struct nla_policy seg6_genl_policy[SEG6_ATTR_MAX + 1] = { > + [SEG6_ATTR_DST] = { .type = NLA_BINARY, > + .len = sizeof(struct in6_addr) }, > + [SEG6_ATTR_DSTLEN] = {

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

2016-08-31 Thread Stephen Hemminger
On Fri, 26 Aug 2016 17:52:40 +0200 David Lebrun wrote: > +static struct genl_ops seg6_genl_ops[] = { > + { > + .cmd= SEG6_CMD_SETHMAC, > + .doit = seg6_genl_sethmac, > + .policy = seg6_genl_policy, > + .flags = GENL_ADMIN_PERM, > + },

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

2016-08-31 Thread Stephen Hemminger
On Fri, 26 Aug 2016 17:52:40 +0200 David Lebrun wrote: > + > +static inline struct seg6_pernet_data *seg6_pernet(struct net *net) > +{ > + return net->ipv6.seg6_data; > +} > + > +static inline void seg6_pernet_lock(struct net *net) > +{ > + spin_lock(&seg6_pernet(net)->lock); > +} > + > +

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

2016-08-31 Thread Nicolas Dichtel
Le 26/08/2016 à 17:52, David Lebrun a écrit : [snip] > +#define SEG6_VERSION_MAJOR 0 > +#define SEG6_VERSION_MINOR 30 nit: This kind of macros are not used anymore upstream. The git sha1 or the linux version perfectly identifies the version.

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

2016-08-31 Thread Nicolas Dichtel
Le 29/08/2016 à 17:31, Roopa Prabhu a écrit : > On 8/26/16, 8:52 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 Routin

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

2016-08-29 Thread Roopa Prabhu
On 8/26/16, 8:52 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 genetlink commands p

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

2016-08-26 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