[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABKoBm2x_hQfGpj7=VOy357nNWGUdMx2xHfT=MbPvmOK4oECbA@mail.gmail.com>
Date: Fri, 10 Mar 2017 13:44:33 -0800
From: Andy Zhou <azhou@....org>
To: Joe Stringer <joe@....org>
Cc: netdev <netdev@...r.kernel.org>, pravin shelar <pshelar@....org>
Subject: Re: [RFC net-next sample action optimization 2/3] openvswitch:
Refactor recirc key allocation.
On Thu, Mar 9, 2017 at 11:11 AM, Joe Stringer <joe@....org> wrote:
> On 7 March 2017 at 16:15, Andy Zhou <azhou@....org> wrote:
>> The logic of allocating and copy key for each 'exec_actions_level'
>> was specific to execute_recirc(). However, future patches will reuse
>> as well. Refactor the logic into its own function clone_key().
>>
>> Signed-off-by: Andy Zhou <azhou@....org>
>> ---
>
> <snip>
>
>> @@ -83,14 +83,32 @@ struct action_fifo {
>> struct deferred_action fifo[DEFERRED_ACTION_FIFO_SIZE];
>> };
>>
>> -struct recirc_keys {
>> - struct sw_flow_key key[OVS_DEFERRED_ACTION_THRESHOLD];
>> +struct action_flow_keys {
>> + struct sw_flow_key key[OVS_ACTION_RECURSION_THRESHOLD];
>> };
>
> I thought the old struct name was clearer on how it would be used -
> for when actions are deferred.
O.K. I will revert it.
>
>>
>> static struct action_fifo __percpu *action_fifos;
>> -static struct recirc_keys __percpu *recirc_keys;
>> +static struct action_flow_keys __percpu *flow_keys;
>> static DEFINE_PER_CPU(int, exec_actions_level);
>>
>> +/* Make a clone of the 'key', using the pre-allocated percpu 'flow_keys'
>> + * space. Since the storage is pre-allocated, the caller does not
>> + * need to check for NULL return pointer.
>> + */
>
> Hmm? if level > OVS_ACTION_RECURSION_THRESHOLD, this function returns NULL.
Thanks for catching this. I will update the comment.
Powered by blists - more mailing lists