Re: [PATCH net-next 1/2] lwtunnel: Add destroy state operation
From: Tom HerbertDate: Thu, 13 Oct 2016 17:57:42 -0700 > @@ -130,6 +130,19 @@ int lwtunnel_build_state(struct net_device *dev, u16 > encap_type, > } > EXPORT_SYMBOL(lwtunnel_build_state); > > +void lwtstate_free(struct lwtunnel_state *lws) There should only be one space between "void" and "lwstate_free".
Re: [PATCH net-next 1/2] lwtunnel: Add destroy state operation
On Thu, 13 Oct 2016 17:57:42 -0700, Tom Herbert wrote: > @@ -43,13 +44,11 @@ struct lwtunnel_encap_ops { > int (*get_encap_size)(struct lwtunnel_state *lwtstate); > int (*cmp_encap)(struct lwtunnel_state *a, struct lwtunnel_state *b); > int (*xmit)(struct sk_buff *skb); > + void (*destroy_state)(struct lwtunnel_state *lws); > }; Could you add destroy_state next to build_state? Seems weird to have those two scattered at the opposite ends of the structure. Looks good otherwise. Thanks, Jiri
Re: [PATCH net-next 1/2] lwtunnel: Add destroy state operation
On 10/13/16, 5:57 PM, Tom Herbert wrote: > Users of lwt tunnels may set up some secondary state in build_state > function. Add a corresponding destroy_state function to allow users to > clean up state. This destroy state function is called from lwstate_free. > Also, we now free lwstate using kfree_rcu so user can assume structure > is not freed before rcu. > > Signed-off-by: Tom HerbertAcked-by: Roopa Prabhu this will be useful elsewhere too, thanks!.