odp-util: Return exact mask if netlink mask attribute is missing.
authorDaniele Di Proietto <diproiettod@vmware.com>
Tue, 8 Dec 2015 01:30:25 +0000 (17:30 -0800)
committerDaniele Di Proietto <diproiettod@vmware.com>
Fri, 11 Dec 2015 01:38:23 +0000 (17:38 -0800)
commitca8d344271ab84666353b3f3456ac282af5722f5
tree86858ec938d0c12038bc4ed013ff7f2b2c5ae9a9
parentefa6665e4d72e4d4f7cc971fb0df54278dba3e47
odp-util: Return exact mask if netlink mask attribute is missing.

In the ODP context an empty mask netlink attribute usually means that
the flow should be an exact match.

odp_flow_key_to_mask{,_udpif}() instead return a struct flow_wildcards
with matches only on recirc_id and vlan_tci.

A more appropriate behavior is to handle a missing (zero length) netlink
mask specially (like we do in userspace and Linux datapath) and create
an exact match flow_wildcards from the original flow.

This fixes a bug in revalidate_ukey(): every flow created with
megaflows disabled would be revalidated away, because the mask would
seem too generic. (Another possible fix would be to handle the special
case of a missing mask in revalidate_ukey(), but this seems a more
generic solution).
lib/dpctl.c
lib/dpif-netdev.c
lib/odp-util.c
lib/odp-util.h
ofproto/ofproto-dpif-upcall.c
tests/test-odp.c