summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif.c
diff options
context:
space:
mode:
authorAravind Prasad S <Aravind.Sridharan@dell.com>2019-04-24 00:30:59 +0530
committerBen Pfaff <blp@ovn.org>2019-04-23 17:06:11 -0700
commit146ee62626e3b21baf19191460e52ef5cb596e52 (patch)
treeed73d3c70a182d24cff98acb32e4292c554c714f /ofproto/ofproto-dpif.c
parent0fcf0776c72aafbf4b5f7ae01de68e1698472490 (diff)
downloadopenvswitch-146ee62626e3b21baf19191460e52ef5cb596e52.tar.gz
ofproto: Return error codes for rule insertions.
Currently, rule_insert() API does not have return value. There are some possible scenarios where rule insertions can fail at run-time even though the static checks during rule_construct() had passed previously. Some possible scenarios for failure of rule insertions: **) Rule insertions can fail dynamically in Hybrid mode (both Openflow and Normal switch functioning coexist) where the CAM space could get suddenly filled up by Normal switch functioning and Openflow gets devoid of available space. **) Some deployments could have separate independent layers for HW rule insertions and application layer to interact with OVS. HW layer could face any dynamic issue during rule handling which application could not have predicted/captured in rule-construction phase. Rule-insert errors for bundles are handled too. Testing: Tested failures of rule insertions and also with bundles. Signed-off-by: Aravind Prasad S <aravind.sridharan at dell.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/ofproto-dpif.c')
-rw-r--r--ofproto/ofproto-dpif.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index e6af0fc01..db461ac07 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -4486,7 +4486,7 @@ rule_construct(struct rule *rule_)
return 0;
}
-static void
+static enum ofperr
rule_insert(struct rule *rule_, struct rule *old_rule_, bool forward_counts)
OVS_REQUIRES(ofproto_mutex)
{
@@ -4516,6 +4516,8 @@ rule_insert(struct rule *rule_, struct rule *old_rule_, bool forward_counts)
ovs_mutex_unlock(&rule->stats_mutex);
ovs_mutex_unlock(&old_rule->stats_mutex);
}
+
+ return 0;
}
static void