ofproto-dpif: Use DPIF_FP_CREATE but not DPIF_FP_MODIFY.
authorBen Pfaff <blp@nicira.com>
Sat, 2 Aug 2014 00:22:20 +0000 (17:22 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 4 Aug 2014 19:22:35 +0000 (12:22 -0700)
commita7d1bbdcfe49e8c7a5575c9ab46b2ac9e5642ef1
tree34d5ee5bb71441a497e5297e8381195a58c0b414
parent6a54dedc66931ef01c3cabb6d6fd481461c99687
ofproto-dpif: Use DPIF_FP_CREATE but not DPIF_FP_MODIFY.

A dpif reports EEXIST if a flow put operation that should create a new flow
instead attempts to modify an existing flow, or ENOENT if a flow put would
create a flow that overlaps some existing flow.  The latter does not always
indicate a bug in OVS userspace, because it can also mean that two
userspace OVS packet handler threads received packets that generated
the same megaflow for different microflows.  Until now, userspace has
logged this, which confuses users by making them suspect a bug.  We could
simply not log ENOENT in userspace, but that would suppress logging for
genuine bugs too.  Instead, this commit drops DPIF_FP_MODIFY from flow
put operations in ofproto-dpif, which transforms this particular
problem into EEXIST, which userspace already logs at "debug" level (see
flow_message_log_level()), effectively suppressing the logging in normal
circumstances.

It appears that in practice ofproto-dpif doesn't actually ever need to
modify flows in the datapath, only create and delete them, so this
shouldn't cause problems.

Suggested-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
ofproto/ofproto-dpif-upcall.c
ofproto/ofproto-dpif.c