Users are more likely to be able to reasonably interpret OpenFlow port numbers than datapath port numbers.
This issue has existed since at least 2011 but only recently has it been possible for OpenFlow and datapath port numbers to differ (except for the "local" port). Reported-by: Christopher Paggen <[email protected]> Signed-off-by: Ben Pfaff <[email protected]> --- AUTHORS | 1 + ofproto/ofproto-dpif.c | 9 ++++++--- tests/ofproto-dpif.at | 11 ++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/AUTHORS b/AUTHORS index 498e9f0..59f3577 100644 --- a/AUTHORS +++ b/AUTHORS @@ -121,6 +121,7 @@ Brent Salisbury [email protected] Bryan Fulton [email protected] Bryan Osoro [email protected] Cedric Hobbs [email protected] +Christopher Paggen [email protected] Dave Walker [email protected] David Palma [email protected] Derek Cormier [email protected] diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 5cc56d1..bdebcef 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -8023,9 +8023,12 @@ ofproto_unixctl_fdb_show(struct unixctl_conn *conn, int argc OVS_UNUSED, ds_put_cstr(&ds, " port VLAN MAC Age\n"); LIST_FOR_EACH (e, lru_node, &ofproto->ml->lrus) { struct ofbundle *bundle = e->port.p; - ds_put_format(&ds, "%5d %4d "ETH_ADDR_FMT" %3d\n", - ofbundle_get_a_port(bundle)->odp_port, - e->vlan, ETH_ADDR_ARGS(e->mac), + char name[OFP_MAX_PORT_NAME_LEN]; + + ofputil_port_to_string(ofbundle_get_a_port(bundle)->up.ofp_port, + name, sizeof name); + ds_put_format(&ds, "%5s %4d "ETH_ADDR_FMT" %3d\n", + name, e->vlan, ETH_ADDR_ARGS(e->mac), mac_entry_age(ofproto->ml, e)); } unixctl_command_reply(conn, ds_cstr(&ds)); diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index 1fdbac3..8bb89ff 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -1107,9 +1107,8 @@ AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [d AT_CHECK( [ovs-vsctl \ -- add-br br1 \ - -- set bridge br1 datapath-type=dummy \ - -- add-port br1 p4 -- set interface p4 type=dummy \ - -- add-port br1 p5 -- set interface p5 type=dummy]) + -- set bridge br1 datapath-type=dummy]) +ADD_OF_PORTS([br1], 4, 5) # Trace some packet arrivals in br1 to create MAC learning entries there too. OFPROTO_TRACE( @@ -1147,10 +1146,8 @@ AT_CLEANUP AT_SETUP([ofproto-dpif - MAC table overflow]) OVS_VSWITCHD_START( - [set bridge br0 fail-mode=standalone other-config:mac-table-size=10 -- \ - add-port br0 p1 -- set Interface p1 type=dummy -- \ - add-port br0 p2 -- set Interface p2 type=dummy -- \ - add-port br0 p3 -- set Interface p3 type=dummy]) + [set bridge br0 fail-mode=standalone other-config:mac-table-size=10]) +ADD_OF_PORTS([br0], 1, 2, 3) arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)' -- 1.7.2.5 _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
