From d90611f14dfd9660e7f5eef5bf27a71003e61174 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 12 Jan 2011 13:38:19 -0800 Subject: [PATCH] nx-match: Print register values in hex in "load" action also. 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 Bug #4249. --- lib/nx-match.c | 4 ++-- tests/ofp-print.at | 6 +++--- tests/ovs-ofctl.at | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/nx-match.c b/lib/nx-match.c index 47cce8335..f887cdb57 100644 --- a/lib/nx-match.c +++ b/lib/nx-match.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Nicira Networks. + * Copyright (c) 2010, 2011 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -982,7 +982,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); nxm_format_field_bits(s, dst, ofs, n_bits); } diff --git a/tests/ofp-print.at b/tests/ofp-print.at index c0e72cfd2..b20bdc9a4 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[[]] ]) 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[[]] ]) 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[] ]]) AT_CLEANUP diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at index 66c8934bb..143c59bd1 100644 --- a/tests/ovs-ofctl.at +++ b/tests/ovs-ofctl.at @@ -108,7 +108,7 @@ NXT_FLOW_MOD: ADD cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTR NXT_FLOW_MOD: ADD 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 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[],move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[] +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[],move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[] ]]) AT_CLEANUP -- 2.39.2