const struct ofpbuf *buf)
{
struct odp_execute execute;
+ int error;
+
memset(&execute, 0, sizeof execute);
execute.in_port = in_port;
execute.actions = (union odp_action *) actions;
execute.n_actions = n_actions;
execute.data = buf->data;
execute.length = buf->size;
-#if 0
- if (VLOG_IS_DBG_ENABLED()) {
- char *actions_string = odp_actions_to_string(actions, n_actions);
- char *packet_string = ofp_packet_to_string(buf->data, buf->size,
- buf->size);
- VLOG_DBG("executing %s with in_port=%"PRIu16" on packet %s",
- actions_string, in_port, packet_string);
- free(actions_string);
- free(packet_string);
+ error = do_ioctl(dpif, ODP_EXECUTE, NULL, &execute);
+
+ if (!(error ? VLOG_DROP_WARN(&error_rl) : VLOG_DROP_DBG(&dpmsg_rl))) {
+ struct ds ds = DS_EMPTY_INITIALIZER;
+ char *packet = ofp_packet_to_string(buf->data, buf->size, buf->size);
+ ds_put_format(&ds, "dp%u: execute ", dpif->minor);
+ format_odp_actions(&ds, actions, n_actions);
+ if (error) {
+ ds_put_format(&ds, " failed (%s)", 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);
}
-#endif
- return do_ioctl(dpif, ODP_EXECUTE, "ODP_EXECUTE", &execute);
+ return error;
}
int