[ovs-discuss] Datapath implementation query

Prathap T prathap.bgl at gmail.com
Thu Apr 14 18:09:30 UTC 2016


Hi OVS-Team:

  We are porting OVS onto one of our hardware and I had a question in the
kernel datapath implementation.

In the function - *masked_flow_lookup*

ovs_flow_mask_key(&masked_key, unmasked, mask);
    hash = flow_hash(&masked_key, &mask->range);
    head = find_bucket(ti, hash);
    (*n_mask_hit)++;
    hlist_for_each_entry_rcu(flow, head, flow_table.node[ti->node_ver]) {
        if (flow->mask == mask && flow->flow_table.hash == hash &&
            flow_cmp_masked_key(flow, &masked_key, &mask->range))
            return flow;
    }

why is that the code compares the flow->mask == mask; is it not enough to
just compare the key?? Is it just an optimization??
If mask comparison is needed, can you please explain the traffic context
that makes this necessary?
The reason I'm asking is that, we have some space issues and cannot store
anymore than the keys in the hardware structure. If the mask comparison is
not needed, we may want to skip it. If it is needed, we will have to
compromise on some of the key elements.


Regards,
Prathap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20160414/87271c97/attachment-0002.html>


More information about the discuss mailing list