summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJarno Rajahalme <jarno@ovn.org>2016-07-29 16:52:03 -0700
committerJarno Rajahalme <jarno@ovn.org>2016-07-29 16:52:03 -0700
commit506c1ddb3404c6bcc30eaf81570aae72f39fa782 (patch)
tree963ca47926953619ae5913d61a7ce1c60e6e47ed /include
parentbcf899f7125d9152f509af2072e05a3aafacbd91 (diff)
downloadopenvswitch-506c1ddb3404c6bcc30eaf81570aae72f39fa782.tar.gz
vconn: Better bundle error management.
It is possible that a bundle add message fails, but the following commit succeeds, since the message was not added to the bundle. Make ovs-ofctl fail also in these cases. Also, the commit should not be sent if any of the bundled messages failed. To make sure all the errors are received before the commit is sent, a barrier is required before sending the commit message. Finally, make vconn collect bundle errors into a list instead of calling a callback. This makes bundle error management simpler. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'include')
-rw-r--r--include/openvswitch/vconn.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/openvswitch/vconn.h b/include/openvswitch/vconn.h
index f8b66553c..d2fbd16ba 100644
--- a/include/openvswitch/vconn.h
+++ b/include/openvswitch/vconn.h
@@ -55,9 +55,22 @@ int vconn_transact(struct vconn *, struct ofpbuf *, struct ofpbuf **);
int vconn_transact_noreply(struct vconn *, struct ofpbuf *, struct ofpbuf **);
int vconn_transact_multiple_noreply(struct vconn *, struct ovs_list *requests,
struct ofpbuf **replyp);
+
+/* Bundle errors must be free()d by the caller. */
+struct vconn_bundle_error {
+ struct ovs_list list_node;
+
+ /* OpenFlow header and some of the message contents for error reporting. */
+ union {
+ struct ofp_header ofp_msg;
+ uint8_t ofp_msg_data[64];
+ };
+};
+
+/* Bundle errors must be free()d by the caller. */
int vconn_bundle_transact(struct vconn *, struct ovs_list *requests,
uint16_t bundle_flags,
- void (*error_reporter)(const struct ofp_header *));
+ struct ovs_list *errors);
void vconn_run(struct vconn *);
void vconn_run_wait(struct vconn *);