[ovs-dev] [PATCH 3/3] classifier: Speed up lookup when metadata partitions the flow table.
Rajahalme, Jarno (NSN - FI/Espoo)
jarno.rajahalme at nsn.com
Wed May 8 14:51:10 UTC 2013
On May 8, 2013, at 11:13 , ext Rajahalme, Jarno (NSN - FI/Espoo) wrote:
>>
>> old_rule = insert_rule(cls, table, rule);
>> if (!old_rule) {
>> + if (minimask_get_metadata_mask(&rule->match.mask) == OVS_BE64_MAX) {
>> + ovs_be64 metadata = miniflow_get_metadata(&rule->match.flow);
>> + rule->partition = create_partition(cls, table, metadata);
>
> I guess that Andy's comment on masked metadata support would be a generalization to this, where the metadata mask would be made part of the cls_partition, and the hmap would be keyed by the combination of the (masked) metadata and the mask. It would be pretty straightforward, but would be a bit more work. With this generalization this part would look like something like this:
>
> ovs_be64 metadata_mask = minimask_get_metadata_mask(&rule->match.mask);
> if (metadata_mask) {
> ovs_be64 metadata = miniflow_get_metadata(&rule->match.flow);
> rule->partition = create_partition(cls, table, metadata, metadata_mask);
>
> Corresponding changes would be needed elsewhere.
>
> I have no idea of the performance impact, though.
>
Just came to think that on lookup this would need a separate find_partition() call for each table (with the table's metadata mask), which would not be very efficient. So, unless there is a use case that would benefit from the masked metadata partitioning, it likely would not be worth the additional cost.
Jarno
More information about the dev
mailing list