On Tue, Mar 14, 2017 at 4:08 PM, Andy Zhou <az...@ovn.org> wrote: > Added execute_or_defer_actions() that both sample and recirc > action's implementation can use. > > Signed-off-by: Andy Zhou <az...@ovn.org> > --- > net/openvswitch/actions.c | 96 > +++++++++++++++++++++++++++++------------------ > 1 file changed, 59 insertions(+), 37 deletions(-) > > diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c > index 1638370..fd7d903 100644 > --- a/net/openvswitch/actions.c > +++ b/net/openvswitch/actions.c ... ... > @@ -1286,6 +1262,52 @@ static int do_execute_actions(struct datapath *dp, > struct sk_buff *skb, > return 0; > } > > +static int execute_or_defer_actions(struct datapath *dp, struct sk_buff *skb, > + struct sw_flow_key *clone, > + struct sw_flow_key *key, > + u32 *recirc_id, > + const struct nlattr *actions, int len) > +{
The action pointer can be checked if it is recirc or sample action. so no need to pass pointer to recirc id. we can pass the last and clone_key flags to this function to clone the skb and key in this function itself. This would make code bit easy to read.