+
+static void
+log_flow_put_message(struct dpif *dpif, const struct dpif_flow_put *put,
+ int error)
+{
+ if (should_log_flow_message(error)) {
+ struct ds s;
+
+ ds_init(&s);
+ ds_put_cstr(&s, "put");
+ if (put->flags & DPIF_FP_CREATE) {
+ ds_put_cstr(&s, "[create]");
+ }
+ if (put->flags & DPIF_FP_MODIFY) {
+ ds_put_cstr(&s, "[modify]");
+ }
+ if (put->flags & DPIF_FP_ZERO_STATS) {
+ ds_put_cstr(&s, "[zero]");
+ }
+ log_flow_message(dpif, error, ds_cstr(&s),
+ put->key, put->key_len, put->mask, put->mask_len,
+ put->stats, put->actions, put->actions_len);
+ ds_destroy(&s);
+ }
+}
+
+static void
+log_flow_del_message(struct dpif *dpif, const struct dpif_flow_del *del,
+ int error)
+{
+ if (should_log_flow_message(error)) {
+ log_flow_message(dpif, error, "flow_del", del->key, del->key_len,
+ NULL, 0, !error ? del->stats : NULL, NULL, 0);
+ }
+}
+
+static void
+log_execute_message(struct dpif *dpif, const struct dpif_execute *execute,
+ int error)
+{
+ if (!(error ? VLOG_DROP_WARN(&error_rl) : VLOG_DROP_DBG(&dpmsg_rl))) {
+ struct ds ds = DS_EMPTY_INITIALIZER;
+ char *packet;
+
+ packet = ofp_packet_to_string(ofpbuf_data(execute->packet),
+ ofpbuf_size(execute->packet));
+ ds_put_format(&ds, "%s: execute ", dpif_name(dpif));
+ format_odp_actions(&ds, execute->actions, execute->actions_len);
+ if (error) {
+ ds_put_format(&ds, " failed (%s)", ovs_strerror(error));
+ }
+ ds_put_format(&ds, " on packet %s", packet);
+ vlog(THIS_MODULE, error ? VLL_WARN : VLL_DBG, "%s", ds_cstr(&ds));
+ ds_destroy(&ds);
+ free(packet);
+ }
+}