> I'd rather not change the names in the data structures because in some > cases the names are specified by OpenFlow and in other cases we want > both a table ID (a number) and a table (a struct classifier).
Sounds good, just curious. Ethan > > On Wed, Jun 08, 2011 at 05:52:39PM -0700, Ethan Jackson wrote: >> Looks Good to me. >> >> I wonder if it make sense to change table_id to table in the internal >> data structures as well so things are consistent? >> >> Ethan >> >> On Wed, Jun 8, 2011 at 13:41, Ben Pfaff <b...@nicira.com> wrote: >> > Flow dumps printed the OpenFlow table ID under the name "table_id", but >> > the flow parser only accepted "table". ?This makes them consistent by >> > changing the output. ?(Another alternative would be to change the accepted >> > input name.) >> > >> > [CCing people and groups who I know parse ovs-ofctl output.] >> > CC: Paul Ingram <p...@nicira.com> >> > CC: nicira...@nicira.com >> > --- >> > ?lib/ofp-print.c ? ?| ? ?6 +++--- >> > ?tests/ofp-print.at | ? 38 +++++++++++++++++++------------------- >> > ?tests/ofproto.at ? | ? ?4 ++-- >> > ?tests/ovs-ofctl.at | ? ?8 ++++---- >> > ?4 files changed, 28 insertions(+), 28 deletions(-) >> > >> > diff --git a/lib/ofp-print.c b/lib/ofp-print.c >> > index 89656cc..514449b 100644 >> > --- a/lib/ofp-print.c >> > +++ b/lib/ofp-print.c >> > @@ -861,7 +861,7 @@ ofp_print_flow_mod(struct ds *s, const struct >> > ofp_header *oh, >> > ? ? ? ? ds_put_format(s, "cmd:%d", fm.command); >> > ? ? } >> > ? ? if (fm.table_id != 0) { >> > - ? ? ? ?ds_put_format(s, " table_id:%d", fm.table_id); >> > + ? ? ? ?ds_put_format(s, " table:%d", fm.table_id); >> > ? ? } >> > >> > ? ? ds_put_char(s, ' '); >> > @@ -1077,7 +1077,7 @@ ofp_print_flow_stats_request(struct ds *string, >> > const struct ofp_header *oh) >> > ? ? } >> > >> > ? ? if (fsr.table_id != 0xff) { >> > - ? ? ? ?ds_put_format(string, " table_id=%"PRIu8, fsr.table_id); >> > + ? ? ? ?ds_put_format(string, " table=%"PRIu8, fsr.table_id); >> > ? ? } >> > >> > ? ? if (fsr.out_port != OFPP_NONE) { >> > @@ -1116,7 +1116,7 @@ ofp_print_flow_stats_reply(struct ds *string, const >> > struct ofp_header *oh) >> > ? ? ? ? ds_put_format(string, " cookie=0x%"PRIx64", duration=", >> > ? ? ? ? ? ? ? ? ? ? ? ntohll(fs.cookie)); >> > ? ? ? ? ofp_print_duration(string, fs.duration_sec, fs.duration_nsec); >> > - ? ? ? ?ds_put_format(string, ", table_id=%"PRIu8", ", fs.table_id); >> > + ? ? ? ?ds_put_format(string, ", table=%"PRIu8", ", fs.table_id); >> > ? ? ? ? ds_put_format(string, "n_packets=%"PRIu64", ", fs.packet_count); >> > ? ? ? ? ds_put_format(string, "n_bytes=%"PRIu64", ", fs.byte_count); >> > ? ? ? ? if (fs.idle_timeout != OFP_FLOW_PERMANENT) { >> > diff --git a/tests/ofp-print.at b/tests/ofp-print.at >> > index b5653d9..567f272 100644 >> > --- a/tests/ofp-print.at >> > +++ b/tests/ofp-print.at >> > @@ -453,10 +453,10 @@ c0 a8 00 02 00 08 00 00 00 00 00 09 05 b8 d8 00 \ >> > ?00 00 04 fa 00 00 00 08 00 01 00 00 \ >> > ?"], [0], [dnl >> > ?OFPST_FLOW reply (xid=0x4): >> > - cookie=0x0, duration=4.2s, table_id=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,arp,in_port=3,vlan_tci=0x0000,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,opcode=2,nw_tos=0,tp_src=0,tp_dst=0 >> > actions=output:1 >> > - cookie=0x0, duration=8.9s, table_id=0, n_packets=13, n_bytes=1274, >> > idle_timeout=5,priority=65535,icmp,in_port=1,vlan_tci=0x0000,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,icmp_type=0,icmp_code=0 >> > actions=output:3 >> > - cookie=0x0, duration=4.28s, table_id=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,arp,in_port=1,vlan_tci=0x0000,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,opcode=1,nw_tos=0,icmp_type=0,icmp_code=0 >> > actions=output:3 >> > - cookie=0x0, duration=9.096s, table_id=0, n_packets=13, n_bytes=1274, >> > idle_timeout=5,icmp,vlan_tci=0x0000,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,icmp_type=8,icmp_code=0 >> > actions=output:1 >> > + cookie=0x0, duration=4.2s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,arp,in_port=3,vlan_tci=0x0000,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,opcode=2,nw_tos=0,tp_src=0,tp_dst=0 >> > actions=output:1 >> > + cookie=0x0, duration=8.9s, table=0, n_packets=13, n_bytes=1274, >> > idle_timeout=5,priority=65535,icmp,in_port=1,vlan_tci=0x0000,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,icmp_type=0,icmp_code=0 >> > actions=output:3 >> > + cookie=0x0, duration=4.28s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,arp,in_port=1,vlan_tci=0x0000,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,opcode=1,nw_tos=0,icmp_type=0,icmp_code=0 >> > actions=output:3 >> > + cookie=0x0, duration=9.096s, table=0, n_packets=13, n_bytes=1274, >> > idle_timeout=5,icmp,vlan_tci=0x0000,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,icmp_type=8,icmp_code=0 >> > actions=output:1 >> > ?]) >> > ?AT_CLEANUP >> > >> > @@ -827,21 +827,21 @@ ff ff 00 18 00 00 23 20 00 07 00 1f 00 01 00 04 \ >> > ?00 00 00 00 00 00 00 05 \ >> > ?"], [0], >> > ?[[NXST_FLOW reply (xid=0x4): >> > - cookie=0x0, duration=1.048s, table_id=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000,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=2535,tp_dst=0 >> > actions=output:1 >> > - cookie=0x0, duration=3.84s, table_id=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000,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=2532,tp_dst=0 >> > actions=output:1 >> > - cookie=0x0, duration=2.872s, table_id=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000,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=2533 >> > actions=output:3 >> > - cookie=0x0, duration=4.756s, table_id=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000,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=2531,tp_dst=0 >> > actions=output:1 >> > - cookie=0x0, duration=2.88s, table_id=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000,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=2533,tp_dst=0 >> > actions=output:1 >> > - cookie=0x0, duration=5.672s, table_id=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000,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=2530,tp_dst=0 >> > actions=output:1 >> > - cookie=0x0, duration=1.04s, table_id=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000,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=2535 >> > actions=output:3 >> > - cookie=0x0, duration=1.952s, table_id=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000,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=2534 >> > actions=output:3 >> > - cookie=0x0, duration=4.668s, table_id=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000,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=2531 >> > actions=output:3 >> > - cookie=0x0, duration=3.752s, table_id=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000,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=2532 >> > actions=output:3 >> > - cookie=0x0, duration=0.172s, table_id=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000,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=2536,tp_dst=0 >> > actions=output:1 >> > - 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,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,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,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:0x5->NXM_NX_REG0[] >> > + cookie=0x0, duration=1.048s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000,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=2535,tp_dst=0 >> > actions=output:1 >> > + cookie=0x0, duration=3.84s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000,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=2532,tp_dst=0 >> > actions=output:1 >> > + cookie=0x0, duration=2.872s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000,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=2533 >> > actions=output:3 >> > + cookie=0x0, duration=4.756s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000,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=2531,tp_dst=0 >> > actions=output:1 >> > + cookie=0x0, duration=2.88s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000,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=2533,tp_dst=0 >> > actions=output:1 >> > + cookie=0x0, duration=5.672s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000,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=2530,tp_dst=0 >> > actions=output:1 >> > + cookie=0x0, duration=1.04s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000,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=2535 >> > actions=output:3 >> > + cookie=0x0, duration=1.952s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000,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=2534 >> > actions=output:3 >> > + cookie=0x0, duration=4.668s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000,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=2531 >> > actions=output:3 >> > + cookie=0x0, duration=3.752s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000,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=2532 >> > actions=output:3 >> > + cookie=0x0, duration=0.172s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000,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=2536,tp_dst=0 >> > actions=output:1 >> > + cookie=0x0, duration=5.624s, table=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000,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=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=1,vlan_tci=0x0000,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=0, n_packets=1, n_bytes=60, >> > idle_timeout=5,priority=65535,tcp,in_port=3,vlan_tci=0x0000,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=0, n_packets=0, n_bytes=0, >> > reg0=0x7b,tun_id=0x1c8 actions=load:0x5->NXM_NX_REG0[] >> > ?]]) >> > ?AT_CLEANUP >> > >> > diff --git a/tests/ofproto.at b/tests/ofproto.at >> > index bb43149..f50e112 100644 >> > --- a/tests/ofproto.at >> > +++ b/tests/ofproto.at >> > @@ -49,8 +49,8 @@ AT_CHECK([ovs-ofctl dump-flows br0 | STRIP_XIDS], [0], >> > [NXST_FLOW reply: >> > ?AT_CHECK([echo 'in_port=1,actions=0' | ovs-ofctl add-flows br0 -]) >> > ?AT_CHECK([ovs-ofctl add-flow br0 in_port=0,actions=1]) >> > ?AT_CHECK([ovs-ofctl dump-flows br0 | STRIP_XIDS | STRIP_DURATION | sort], >> > [0], [dnl >> > - cookie=0x0, duration=?s, table_id=0, n_packets=0, n_bytes=0, in_port=0 >> > actions=output:1 >> > - cookie=0x0, duration=?s, table_id=0, n_packets=0, n_bytes=0, in_port=1 >> > actions=output:0 >> > + cookie=0x0, duration=?s, table=0, n_packets=0, n_bytes=0, in_port=0 >> > actions=output:1 >> > + cookie=0x0, duration=?s, table=0, n_packets=0, n_bytes=0, in_port=1 >> > actions=output:0 >> > ?NXST_FLOW reply: >> > ?]) >> > ?AT_CHECK([ovs-ofctl del-flows br0]) >> > diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at >> > index a3a8c44..f73afbd 100644 >> > --- a/tests/ovs-ofctl.at >> > +++ b/tests/ovs-ofctl.at >> > @@ -33,8 +33,8 @@ NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 >> > actions=FLOOD >> > ?NXT_FLOW_MOD: ADD >> > actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel64:0x123456789 >> > ?NXT_FLOW_MOD: ADD >> > actions=multipath(eth_src,50,hrw,12,0,NXM_NX_REG0[0..3]),multipath(symmetric_l4,1024,iter_hash,5000,5050,NXM_NX_REG0[0..12]) >> > ?NXT_FLOW_MOD_TABLE_ID: enable >> > -NXT_FLOW_MOD: ADD table_id:1 actions=drop >> > -NXT_FLOW_MOD: ADD table_id:255 >> > tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop >> > +NXT_FLOW_MOD: ADD table:1 actions=drop >> > +NXT_FLOW_MOD: ADD table:255 tun_id=0x1234000056780000/0xffff0000ffff0000 >> > actions=drop >> > ?]]) >> > ?AT_CLEANUP >> > >> > @@ -475,7 +475,7 @@ OFPROTO_START >> > ?AT_CHECK([ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop]) >> > ?AT_CHECK([ovs-ofctl dump-flows br0 | STRIP_XIDS | STRIP_DURATION], [0], >> > [dnl >> > ?NXST_FLOW reply: >> > - cookie=0x0, duration=?s, table_id=0, n_packets=0, n_bytes=0, >> > tun_id=0x12345678 actions=drop >> > + cookie=0x0, duration=?s, table=0, n_packets=0, n_bytes=0, >> > tun_id=0x12345678 actions=drop >> > ?]) >> > ?OFPROTO_STOP >> > ?AT_CLEANUP >> > @@ -487,7 +487,7 @@ OFPROTO_START >> > ?AT_CHECK([ovs-ofctl add-flow br0 reg0=0x12345,actions=drop]) >> > ?AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | STRIP_XIDS | >> > STRIP_DURATION], [0], [dnl >> > ?OFPST_FLOW reply: >> > - cookie=0x0, duration=?s, table_id=0, n_packets=0, n_bytes=0, >> > ?actions=drop >> > + cookie=0x0, duration=?s, table=0, n_packets=0, n_bytes=0, ?actions=drop >> > ?]) >> > ?OFPROTO_STOP >> > ?AT_CLEANUP >> > -- >> > 1.7.4.4 >> > >> > _______________________________________________ >> > dev mailing list >> > dev@openvswitch.org >> > http://openvswitch.org/mailman/listinfo/dev >> > > _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev