[ovs-dev] [ofp-print 15/15] nx-match: Print register values in hex in "load" action also.

Ben Pfaff blp at nicira.com
Tue Dec 14 20:23:29 UTC 2010


cls_rule_format() prints register values are printed in hex, but the "load"
action was printing them in decimal.  This makes it consistent.

Requested-by: Paul Ingram <paul at nicira.com>
Bug #4249.
---
 lib/nx-match.c     |    2 +-
 tests/ofp-print.at |    6 +++---
 tests/ovs-ofctl.at |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/nx-match.c b/lib/nx-match.c
index c1d8fa8..474bc75 100644
--- a/lib/nx-match.c
+++ b/lib/nx-match.c
@@ -971,7 +971,7 @@ nxm_format_reg_load(const struct nx_action_reg_load *load, struct ds *s)
     uint32_t dst = ntohl(load->dst);
     uint64_t value = ntohll(load->value);
 
-    ds_put_format(s, "load:%"PRIu64"->", value);
+    ds_put_format(s, "load:%#"PRIx64"->", value);
     format_nxm_field_bits(s, dst, ofs, n_bits);
 }
 
diff --git a/tests/ofp-print.at b/tests/ofp-print.at
index c0e72cf..9e9fd7d 100644
--- a/tests/ofp-print.at
+++ b/tests/ofp-print.at
@@ -672,7 +672,7 @@ ff ff ff ff ff ff 00 00 00 14 00 00 00 00 00 00 \
 00 00 00 7b 00 00 00 00 ff ff 00 18 00 00 23 20 \
 00 07 00 1f 00 01 00 04 00 00 00 00 00 00 00 05 \
 " 2], [0], [dnl
-NXT_FLOW_MOD (xid=0x2): ADD reg0=0x7b,tun_id=0x1c8 actions=load:5->NXM_NX_REG0[[0..31]]
+NXT_FLOW_MOD (xid=0x2): ADD reg0=0x7b,tun_id=0x1c8 actions=load:0x5->NXM_NX_REG0[[0..31]]
 ])
 AT_CLEANUP
 
@@ -687,7 +687,7 @@ ff ff ff ff ff ff 00 00 00 14 00 00 00 00 00 00 \
 00 00 00 7b 00 00 00 00 ff ff 00 18 00 00 23 20 \
 00 07 00 1f 00 01 00 04 00 00 00 00 00 00 00 05 \
 " 3], [0], [dnl
-NXT_FLOW_MOD (xid=0x2): ADD NXM_NX_TUN_ID(00000000000001c8), NXM_NX_REG0(0000007b) actions=load:5->NXM_NX_REG0[[0..31]]
+NXT_FLOW_MOD (xid=0x2): ADD NXM_NX_TUN_ID(00000000000001c8), NXM_NX_REG0(0000007b) actions=load:0x5->NXM_NX_REG0[[0..31]]
 ])
 AT_CLEANUP
 
@@ -863,7 +863,7 @@ ff ff 00 18 00 00 23 20 00 07 00 1f 00 01 00 04 \
  cookie=0x0, duration=5.624s, table_id=0, n_packets=1, n_bytes=60, idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000/0xffff,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,tp_src=0,tp_dst=2530 actions=output:3
  cookie=0x0, duration=0.08s, table_id=0, n_packets=1, n_bytes=60, idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000/0xffff,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,nw_tos=0,tp_src=0,tp_dst=2536 actions=output:3
  cookie=0x0, duration=1.96s, table_id=0, n_packets=1, n_bytes=60, idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000/0xffff,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:06,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,tp_src=2534,tp_dst=0 actions=output:1
- cookie=0x0, duration=228.78s, table_id=0, n_packets=0, n_bytes=0, reg0=0x7b,tun_id=0x1c8 actions=load:5->NXM_NX_REG0[0..31]
+ cookie=0x0, duration=228.78s, table_id=0, n_packets=0, n_bytes=0, reg0=0x7b,tun_id=0x1c8 actions=load:0x5->NXM_NX_REG0[0..31]
 ]])
 AT_CLEANUP
 
diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at
index 94013e7..985ce1f 100644
--- a/tests/ovs-ofctl.at
+++ b/tests/ovs-ofctl.at
@@ -105,7 +105,7 @@ NXT_FLOW_MOD: ADD <any> cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTR
 NXT_FLOW_MOD: ADD <any> actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00
 NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD
 NXT_FLOW_MOD: ADD <any> actions=drop
-NXT_FLOW_MOD: ADD NXM_NX_REG0(0000007b) actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:55->NXM_NX_REG2[0..31],move:NXM_NX_REG0[0..31]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[0..15]
+NXT_FLOW_MOD: ADD NXM_NX_REG0(0000007b) actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:0x37->NXM_NX_REG2[0..31],move:NXM_NX_REG0[0..31]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[0..15]
 ]])
 AT_CLEANUP
 
-- 
1.7.1





More information about the dev mailing list