summaryrefslogtreecommitdiff
path: root/net/openvswitch/datapath.c
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2014-10-06 16:08:38 +0400
committerPravin B Shelar <pshelar@nicira.com>2014-11-06 10:52:34 +0300
commit426cda5cc177301f9c196f3a9b6a1287051ba599 (patch)
treef2048a5349f4aedb4e9a65c692ef448d83e8598c /net/openvswitch/datapath.c
parent1b760fb9a8a8c0babc15f886ee5740cb33744168 (diff)
downloadlinux-426cda5cc177301f9c196f3a9b6a1287051ba599.tar.xz
openvswitch: Additional logging for -EINVAL on flow setups.
There are many possible ways that a flow can be invalid so we've added logging for most of them. This adds logs for the remaining possible cases so there isn't any ambiguity while debugging. CC: Federico Iezzi <fiezzi@enter.it> Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Thomas Graf <tgraf@noironetworks.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r--net/openvswitch/datapath.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index a532a9c46d20..04a26ae4a4f6 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -817,10 +817,14 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info)
/* Must have key and actions. */
error = -EINVAL;
- if (!a[OVS_FLOW_ATTR_KEY])
+ if (!a[OVS_FLOW_ATTR_KEY]) {
+ OVS_NLERR("Flow key attribute not present in new flow.\n");
goto error;
- if (!a[OVS_FLOW_ATTR_ACTIONS])
+ }
+ if (!a[OVS_FLOW_ATTR_ACTIONS]) {
+ OVS_NLERR("Flow actions attribute not present in new flow.\n");
goto error;
+ }
/* Most of the time we need to allocate a new flow, do it before
* locking.
@@ -979,8 +983,10 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)
/* Extract key. */
error = -EINVAL;
- if (!a[OVS_FLOW_ATTR_KEY])
+ if (!a[OVS_FLOW_ATTR_KEY]) {
+ OVS_NLERR("Flow key attribute not present in set flow.\n");
goto error;
+ }
ovs_match_init(&match, &key, &mask);
error = ovs_nla_get_match(&match,