[ovs-git] Open vSwitch: ofproto: Rework and fix bugs in port change detection. (master)

dev at openvswitch.org dev at openvswitch.org
Thu Apr 21 20:33:37 UTC 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  b33951b80fa2040ea10d1e247f416f65da062d1e (commit)
       via  1264ec9565831adcc12a80133433034ddfdb6ead (commit)
      from  2cb351e85130f919418216fc59ceecb3e6271ee2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b33951b80fa2040ea10d1e247f416f65da062d1e
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=b33951b80fa2040ea10d1e247f416f65da062d1e
Author: Ben Pfaff <blp at nicira.com>
		
ofproto: Rework and fix bugs in port change detection.
		
The OpenFlow port change detection code in update_port() is supposed to
send out an OFPT_PORT_STATUS message whenever an OpenFlow port is added or
removed or changes in some way.  This commit fixes a number of bugs that
have persisted until now.

First, if a port with a given name is removed from the datapath and a new
port with the same name but a different port number is added to the
datapath, then update_port() would report this as a port "modify" change.
Reporting this as a "modify" seems likely to confuse controllers, which
have no reason to realize that the old port was deleted and may not
understand why a port that has not been reported as added would be
modified.  (This scenario is more likely than before, because the Linux
datapath implementation no longer quickly reuses port numbers.  This
problem has actually been reported in testing.)  This commit fixes the
problem by changing update_port() to report a "delete" of the old port
followed by an "add" of the new port.

Second, suppose that a datapath initially has "eth1" on port 1 and "eth2"
on port 2.  Then, "eth1" gets removed and "eth2" is reassigned to port 1.
If update_port() is first passed "eth2", then the old implementation would
have sent out an OpenFlow "modify" notification instead of "delete"
followed by "add", which is the same as the previous scenario.  But as a
further wrinkle, it would have failed to remove "eth1", which meant that we
ended up with two "ofports" with port number 1!  This commit fixes this
problem too.

Reported-by: David Tsai <dtsai at nicira.com>
Bug #5466.
NIC-372.


commit 1264ec9565831adcc12a80133433034ddfdb6ead
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=1264ec9565831adcc12a80133433034ddfdb6ead
Author: Ben Pfaff <blp at nicira.com>
		
ofproto: Consistently use netdev's name instead of ofp_phy_port name.
		
There are at least two ways to get an ofport's name: from the netdev using
netdev_get_name() or from the ofp_phy_port's 'name' member.  Some code used
one, some used the other.  This switches all relevant code to use only
netdev_get_name(), because the 'name' member in ofp_phy_port is
fixed-length and thus a long name could be truncated.

This isn't a problem under Linux since the maximum length of a network
device's name under Linux is the same as the field width in ofp_phy_port.


-----------------------------------------------------------------------

Summary of changes:
 ofproto/ofproto.c |  214 +++++++++++++++++++++++++++++------------------------
 1 files changed, 116 insertions(+), 98 deletions(-)


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list