[ovs-dev] [PATCH v2] lib/dpif-netdev: Integrate megaflow classifier.
Joe Stringer
joestringer at nicira.com
Thu Oct 23 20:06:20 UTC 2014
On 23 October 2014 11:21, Joe Stringer <joestringer at nicira.com> wrote:
> Hi Jarno,
>
> On 7 October 2014 14:43, Jarno Rajahalme <jrajahalme at nicira.com> wrote:
>
>> flow inserts and removals are simplified:
>>
>> - No need for classifier internal mutex, as dpif-netdev already has a
>> 'flow_mutex'.
>> - Number of memory allocations/frees can be halved.
>>
>> Lookup code path is a bit more effcient as well, as we can rely on
>> netdev_flow_key always having inline data.
>>
>> This will also be easier to simplify further when moving to per-thread
>> megaflow classifiers in the future.
>>
>> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
>> ---
>> v2: Reverted using netdev_flow_key as the flow_table key, since that will
>> become obsolete as soon as flow ID patches are merged in.
>> We still need a netdev_flow_key for the lookup in flow put, but now we
>> use the slower method of composing a packet from a flow, and
>> extracting
>> the miniflow from this 'packet'. This does not matter, since the flow
>> put interface is no longer used for upcalls (but probes may still use
>> it).
>>
>> lib/classifier.c | 109 ----------
>> lib/classifier.h | 5 -
>> lib/dpif-netdev.c | 619
>> ++++++++++++++++++++++++++++++++++++++++++-----------
>> lib/flow.c | 61 ++++++
>> lib/flow.h | 3 +-
>> 5 files changed, 555 insertions(+), 242 deletions(-)
>>
>> <snip>
>>
>
>
>> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>> index a1db620..36fd238 100644
>> --- a/lib/dpif-netdev.c
>> +++ b/lib/dpif-netdev.c
>> <snip>
>>
>
>
>> @@ -1628,18 +1774,22 @@ dpif_netdev_flow_put(struct dpif *dpif, const
>> struct dpif_flow_put *put)
>> if (put->stats) {
>> memset(put->stats, 0, sizeof *put->stats);
>> }
>> - error = dp_netdev_flow_add(dp, &match, put->actions,
>> - put->actions_len);
>> + dp_netdev_flow_add(dp, &match, put->actions,
>> put->actions_len);
>> + error = 0;
>> } else {
>> error = EFBIG;
>> }
>
>
> Was there a particular reason for modifying this to ignore errors in
> dp_netdev_flow_add()?
>
Woops, I missed the change in function signature. Please disregard.
More information about the dev
mailing list