}
static void
-format_uint32_masked__(struct ds *s, const char *name,
- uint32_t value, uint32_t mask, const char *format)
+format_uint32_masked(struct ds *s, const char *name,
+ uint32_t value, uint32_t mask)
{
if (mask) {
- ds_put_format(s, format, name, value);
+ ds_put_format(s, "%s=%#"PRIx32, name, value);
if (mask != UINT32_MAX) {
ds_put_format(s, "/%#"PRIx32, mask);
}
ds_put_char(s, ',');
}
-
-}
-static void
-format_uint32_masked(struct ds *s, const char *name,
- uint32_t value, uint32_t mask)
-{
- format_uint32_masked__(s, name, value, mask, "%s=%#"PRIx32);
-}
-
-static void
-format_decimal_uint32_masked(struct ds *s, const char *name,
- uint32_t value, uint32_t mask)
-{
- format_uint32_masked__(s, name, value, mask, "%s=%"PRIu32);
}
static void
format_uint32_masked(s, "pkt_mark", f->pkt_mark, wc->masks.pkt_mark);
if (wc->masks.recirc_id) {
- format_decimal_uint32_masked(s, "recirc_id", f->recirc_id,
- wc->masks.recirc_id);
+ format_uint32_masked(s, "recirc_id", f->recirc_id,
+ wc->masks.recirc_id);
}
if (wc->masks.dp_hash) {
AT_CHECK([ovs-ofctl add-flows br-int flows.txt])
# Sends a packet to trigger recirculation.
-# Should generate recirc_id(2),dp_hash(0xc1261ba2/0xff).
+# Should generate recirc_id(0x2),dp_hash(0xc1261ba2/0xff).
AT_CHECK([ovs-appctl netdev-dummy/receive p5 "in_port(5),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1)"])
# Collects flow stats.
# Checks the flow stats in br1, should only be one flow with non-zero
# 'n_packets' from internal table.
AT_CHECK([ovs-appctl bridge/dump-flows br1 | ofctl_strip | grep -- "n_packets" | grep -- "table_id" | sed -e 's/dp_hash=0x[[0-9a-f]][[0-9a-f]]*/dp_hash=0x0/' -e 's/output:[[0-9]][[0-9]]*/output/'], [0], [dnl
-table_id=254, n_packets=1, n_bytes=64, priority=20,recirc_id=2,dp_hash=0x0/0xff,actions=output
+table_id=254, n_packets=1, n_bytes=64, priority=20,recirc_id=0x2,dp_hash=0x0/0xff,actions=output
])
# Checks the flow stats in br-int, should be only one match.