This reverts commit fa7de3220ce79ffe293d84cc9c98b1a88980273b. As there is the potential for this field to be maskable in future, and the dpctl "-m" output prints a mask for it, return it to hexadecimal. The next patch will make this consistent to the recirc action by making the action print the recirc_id in hex as well.
Signed-off-by: Joe Stringer <joestrin...@nicira.com> --- lib/match.c | 24 +++++------------------- tests/ofproto-dpif.at | 4 ++-- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/lib/match.c b/lib/match.c index b155084..7d0b409 100644 --- a/lib/match.c +++ b/lib/match.c @@ -843,30 +843,16 @@ format_be32_masked(struct ds *s, const char *name, } 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 @@ -935,8 +921,8 @@ match_format(const struct match *match, struct ds *s, int priority) 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) { diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index 3361dc2..139dfdd 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -186,7 +186,7 @@ table=0 priority=2 in_port=5 dl_vlan=1 actions=drop 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. @@ -195,7 +195,7 @@ AT_CHECK([ovs-appctl revalidator/purge], [0]) # 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. -- 2.1.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev