[ovs-git] Open vSwitch: netdev: Get rid of struct netdev_options and netdev_open_default(). (master)

dev at openvswitch.org dev at openvswitch.org
Mon Aug 8 20:13:54 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  18812dff32ce650440b9f1eac1bb00afe08c621a (commit)
       via  de5cdb90f7c02d22b0595c7dc311c5306291b02f (commit)
      from  298fd6d2d25ac8028f76c23cd52374370fe3be42 (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 18812dff32ce650440b9f1eac1bb00afe08c621a
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=18812dff32ce650440b9f1eac1bb00afe08c621a
Author: Ben Pfaff <blp at nicira.com>
		
netdev: Get rid of struct netdev_options and netdev_open_default().
		
Now that netdev_options only has two members, we might as well pass them
directly as parameters.


commit de5cdb90f7c02d22b0595c7dc311c5306291b02f
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=de5cdb90f7c02d22b0595c7dc311c5306291b02f
Author: Ben Pfaff <blp at nicira.com>
		
netdev: Decouple creating and configuring network devices.
		
Until now, each call to netdev_open() for a particular network device
had to either specify a set of network device arguments that was either
empty or (for devices that already existed) equal to the existing device's
configuration.  Unfortunately, the definition of "equality" in the latter
case was mostly done in terms of strict equality of string-to-string maps,
which caused problems in cases where, for example, one set of arguments
specified the default value of an optional argument explicitly and the
other omitted it.

The netdev interface does have provisions for defining equality other ways,
but this had only been done in one case that was especially problematic in
practice.  One way to solve this particular problem would be to carefully
define equality in all the problematic cases.

This commit takes another approach based on the realization that there is
really no need to do any comparisons.  Instead, it removes configuration
at netdev_open() time entirely, because almost all of netdev_open()'s
callers are not interested in creating and configuring a netdev.  Most of
them just want to open a configured device and use it.  Therefore, this
commit stops providing any configuration arguments to netdev_open() and the
provider functions that it calls.  Instead, a caller that does want to
configure a device does so after it opens it, by calling
netdev_set_config().

This change allows us to simplify the netdev interface a bit.  There is no
longer any need to implement argument comparisons.  As a result, there is
also no need for "struct netdev_dev" to keep track of configuration at all.
Instead, the network devices that have configuration keep track of it in
their own internal form.

This new interface does mean that it becomes possible to accidentally
create and try to use an unconfigured netdev that requires configuration.

Bug #6677.
Reported-by: Paul Ingram <paul at nicira.com>


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

Summary of changes:
 lib/bond.c                   |    2 +-
 lib/dpif-netdev.c            |    9 +--
 lib/netdev-dummy.c           |    7 +-
 lib/netdev-linux.c           |   23 ++----
 lib/netdev-provider.h        |   32 +++-----
 lib/netdev-vport.c           |  183 +++++++++++++-----------------------------
 lib/netdev.c                 |  125 ++++++++++-------------------
 lib/netdev.h                 |   11 +--
 ofproto/in-band.c            |    4 +-
 ofproto/ofproto-dpif-sflow.c |    4 +-
 ofproto/ofproto.c            |    7 +--
 tests/test-openflowd.c       |    2 +-
 utilities/ovs-dpctl.c        |   83 +++++++++++--------
 vswitchd/bridge.c            |   50 ++++++-----
 vswitchd/ovs-brcompatd.c     |    2 +-
 15 files changed, 205 insertions(+), 339 deletions(-)


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list