X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdpif.c;h=e117bdf9cd29e5b4906d83015d7182894d0417bd;hb=80642190644ae6fbcf485924b1c59e67d0be8a87;hp=b3e82afc28ec6cadabaafa52aba074eb0bd6f8a7;hpb=f1588b1fa1be46231ee079358e428dae74ff09cc;p=openvswitch diff --git a/lib/dpif.c b/lib/dpif.c index b3e82afc..e117bdf9 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -30,6 +30,7 @@ #include "netlink.h" #include "odp-util.h" #include "ofp-print.h" +#include "ofp-util.h" #include "ofpbuf.h" #include "packets.h" #include "poll-loop.h" @@ -39,7 +40,7 @@ #include "valgrind.h" #include "vlog.h" -VLOG_DEFINE_THIS_MODULE(dpif) +VLOG_DEFINE_THIS_MODULE(dpif); static const struct dpif_class *base_dpif_classes[] = { #ifdef HAVE_NETLINK @@ -1085,9 +1086,13 @@ log_operation(const struct dpif *dpif, const char *operation, int error) { if (!error) { VLOG_DBG_RL(&dpmsg_rl, "%s: %s success", dpif_name(dpif), operation); - } else { + } else if (is_errno(error)) { VLOG_WARN_RL(&error_rl, "%s: %s failed (%s)", dpif_name(dpif), operation, strerror(error)); + } else { + VLOG_WARN_RL(&error_rl, "%s: %s failed (%d/%d)", + dpif_name(dpif), operation, + get_ofp_err_type(error), get_ofp_err_code(error)); } } @@ -1106,7 +1111,8 @@ should_log_flow_message(int error) static void log_flow_message(const struct dpif *dpif, int error, const char *operation, - const flow_t *flow, const struct odp_flow_stats *stats, + const struct odp_flow_key *flow, + const struct odp_flow_stats *stats, const union odp_action *actions, size_t n_actions) { struct ds ds = DS_EMPTY_INITIALIZER; @@ -1118,7 +1124,7 @@ log_flow_message(const struct dpif *dpif, int error, const char *operation, if (error) { ds_put_format(&ds, "(%s) ", strerror(error)); } - flow_format(&ds, flow); + format_odp_flow_key(&ds, flow); if (stats) { ds_put_cstr(&ds, ", "); format_odp_flow_stats(&ds, stats);