Skip to content

Commit

Permalink
dpif: Log packet metadata on execute.
Browse files Browse the repository at this point in the history
Debug log output for execute operations is missing the packet
metadata, which can be instrumental in tracing what the datapath
should be executing.  No reason to not have the metadata on the debug
output, so add it there.

Signed-off-by: Jarno Rajahalme <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
Jarno Rajahalme committed Apr 17, 2017
1 parent 70bd4e6 commit b701bce
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/dpif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1760,9 +1760,13 @@ log_execute_message(struct dpif *dpif, const struct dpif_execute *execute,
&& !execute->probe) {
struct ds ds = DS_EMPTY_INITIALIZER;
char *packet;
uint64_t stub[1024 / 8];
struct ofpbuf md = OFPBUF_STUB_INITIALIZER(stub);

packet = ofp_packet_to_string(dp_packet_data(execute->packet),
dp_packet_size(execute->packet));
odp_key_from_pkt_metadata(&md, &execute->packet->md);

ds_put_format(&ds, "%s: %sexecute ",
dpif_name(dpif),
(subexecute ? "sub-"
Expand All @@ -1773,10 +1777,13 @@ log_execute_message(struct dpif *dpif, const struct dpif_execute *execute,
ds_put_format(&ds, " failed (%s)", ovs_strerror(error));
}
ds_put_format(&ds, " on packet %s", packet);
ds_put_format(&ds, " with metadata ");
odp_flow_format(md.data, md.size, NULL, 0, NULL, &ds, true);
ds_put_format(&ds, " mtu %d", execute->mtu);
vlog(&this_module, error ? VLL_WARN : VLL_DBG, "%s", ds_cstr(&ds));
ds_destroy(&ds);
free(packet);
ofpbuf_uninit(&md);
}
}

Expand Down

0 comments on commit b701bce

Please sign in to comment.