[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOrHB_ANWNUDU_HaM-ohvDb_LhWe+_Sk_e4fkiAX=Aq=oSkM6w@mail.gmail.com>
Date: Thu, 16 Mar 2017 12:24:20 -0700
From: Pravin Shelar <pshelar@....org>
To: Andy Zhou <azhou@....org>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Joe Stringer <joe@....org>
Subject: Re: [net-next sample action optimization v2 4/4] Openvswitch:
Refactor sample and recirc actions implementation
On Tue, Mar 14, 2017 at 4:08 PM, Andy Zhou <azhou@....org> wrote:
> Added execute_or_defer_actions() that both sample and recirc
> action's implementation can use.
>
> Signed-off-by: Andy Zhou <azhou@....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)
> +{
> + struct deferred_action *da;
> +
> + /* If within the limit of 'OVS_DEFERRED_ACTION_THRESHOLD',
> + * recirc immediately, otherwise, defer it for later execution.
> + */
> + if (clone) {
> + if (recirc_id) {
> + clone->recirc_id = *recirc_id;
> + ovs_dp_process_packet(skb, clone);
> + return 0;
> + } else {
> + return do_execute_actions(dp, skb, clone,
> + actions, len);
the exec_actions_level inc and dec should be moved here, since it is
only needed around this function.
Powered by blists - more mailing lists