2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-23 14:57:06 +00:00
Commit Graph

20 Commits

Author SHA1 Message Date
Ben Pfaff
0b8b6f71d5 Remove /proc/net compatibility support.
This feature was included only to allow Citrix QA to run some tests that
interacted directly with the bridge.  This feature hasn't been turned on
for some time, so it should not be necessary any longer.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-02-11 13:48:24 -08:00
Ben Pfaff
e2c779b3c2 datapath: Backport genl_register_family_with_ops().
Besides the user introduced in this commit, the new Netlink-based datapath
communication code will use this function.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Reported-by: Justin Pettit <jpettit@nicira.com>
2011-01-27 21:08:41 -08:00
Ben Pfaff
7897d3fa21 datapath: Make VERIFY_NUL_STRING verify the string length too.
It's better to use HAVE_NLA_NUL_STRING than a version check because the
Xen 2.6.18 kernels backport NLA_NUL_STRING and the nla_policy changes.

Just defining NLA_NUL_STRING to an innocuous value doesn't work, because
Linux before 2.6.19 doesn't define a 'len' member in struct nla_policy at
all (it was named 'minlen' and had different semantics), so attempting to
initialize it caused compile errors.

Grouping things this way also makes it clearer what needs to be deleted
when upstreaming.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27 21:08:37 -08:00
Ben Pfaff
f632c8fc81 datapath: Get rid of compat.h, compat26.h in favor of modern approach.
I had completely forgotten that we had a top-level compat.h and compat26.h.
It's better to distribute their contents to individual compat headers, so
this commit does so and deletes them.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-13 12:26:15 -08:00
Jesse Gross
6d6266e6c9 brcompat: Simplify generation of bridge ID.
Currently we use a fairly complicated method of generating the
bridge ID, since the actual struct is only available in a header
file private to the Linux bridge.  The current method appears to
be correct but is difficult to reason about.  This replaces it
with a simple memcpy, which is more analogous to what the Linux
bridge does.

Flagged by sparse.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2010-12-09 17:43:36 -08:00
Vivien Bernet-Rollande
bbf4f269a3 brcompat_mod: Check if user has CAP_NET_ADMIN in ioctl handler
This patch checks that the user calling ioctl() to create, delete, or
modify bridges has the CAP_NET_ADMIN capability. This prevents
unpriviledged users from modifying the bridge configuration through
brcompatd. The checks are actually the same performed in
net/bridge/br_ioctl.c by the Linux kernel.

Signed-off-by: Vivien Bernet-Rollande <vbr@soprive.net>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2010-09-16 10:58:40 -07:00
Joe Perches
dfffaef1eb treewide: Use pr_fmt and pr_<level>
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Simon Horman <horms@verge.net.au>
[Jesse: Added missing pr_fmt in vport-gre.c and dp_sysfs_dp.c]
Signed-off-by: Jesse Gross <jesse@nicira.com>
2010-08-30 13:23:08 -07:00
Joe Perches
d295e8e97a treewide: Remove trailing whitespace
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2010-08-30 13:23:08 -07:00
Simon Horman
f2d9c30bdf datapath: Unconditionally call kfree_skb()
kfree_skb() will ignore a NULL pointer.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2010-08-24 20:18:17 -07:00
Jesse Gross
fceb2a5bb2 datapath: Put return type on same line as arguments for functions.
In some places we would put the return type on the same line as
the rest of the function definition and other places we wouldn't.
Reformat everything to match kernel style.
2010-07-15 15:09:08 -07:00
Justin Pettit
ca063bcd59 brcompat: Print warning when kernel times out waiting for userspace 2010-03-03 12:51:01 -08:00
Ben Pfaff
c170afc1db brcompat: Remove no-longer-needed #includes. 2009-08-07 15:11:42 -07:00
Ben Pfaff
6dac2b9ed9 brcompat: Remove requirement that that no datapaths exist at load time.
We previously required that brcompat_mod be loaded before any datapaths
were created, because creation and destruction of datapaths and ports
differed when brcompat_mod was loaded, but the latter is no longer the
case so there is no reason for the former anymore.
2009-08-07 15:11:42 -07:00
Ben Pfaff
db322751d8 brcompat: Move BRCTL_GET_BRIDGES, BRCTL_GET_PORT_LIST into userspace.
The Citrix QA scripts assume that "brctl show" will show a topology as if
the Linux bridge were still in use; that is, as if there were one bridge
per VLAN and as if bonds were network devices of their own instead of
separate devices.  However, we were showing the datapath topology, i.e.
all VLANs and bond devices lumped together into a single datapath.  This
commit fixes the VLAN end of the problem, by moving the implementation of
the ioctls that brctl uses into userspace in ovs-brcompatd and putting the
necessary translation logic into ovs-brcompatd.

By itself, this commit does not fix the problem for bonds: the port name
for a bond does not (normally) under Open vSwitch exist as an actual
Linux network device, and thus it has no ifindex, and so ovs-brcompatd
can't pass it back to the kernel to report to brctl.  This fix will have
to wait for another commit.

Bug NIC-19.
2009-08-07 15:11:40 -07:00
Ben Pfaff
2ba9026e2f datapath: Rename brc_sysfs_* to dp_sysfs_*.
These files and names are now part of the datapath, not brcompat, so name
them appropriately so as not to confuse anyone.
2009-08-06 16:57:06 -07:00
Ben Pfaff
2e7dd8eca8 datapath: Move sysfs support from brcompat_mod into openvswitch_mod.
In the past problems have arisen due to the different ways that datapaths
are created and destroyed in the three different cases:

	1. sysfs supported, brcompat_mod loaded.
	2. sysfs supported, brcompat_mod not loaded.
	3. sysfs not supported.

The brcompat_mod loaded versus not loaded distinction is the stickiest
because we have to do all the calls into brcompat_mod through hook
functions, which in turn causes pressure to keep the number of hook
functions small and well-defined, which makes it really difficult to put
the hook call points at exactly the right place.  Witness, for example,
this piece of code in datapath.c:

        int dp_del_port(struct net_bridge_port *p)
        {
                ASSERT_RTNL();

        #ifdef SUPPORT_SYSFS
                if (p->port_no != ODPP_LOCAL && dp_del_if_hook)
                        sysfs_remove_link(&p->dp->ifobj, p->dev->name);
        #endif

The code inside the #ifdef is logically part of the brcompat_mod sysfs
support, but the author of this code (quite reasonably) didn't want to
add a hook function call there.  After all, what would you call the
hook function?  There's no obvious name from the dp_del_port() caller's
perspective.

All this argues that sysfs support should be in openvswitch_mod itself,
since it has to be tightly integrated, not bolted on.  So this commit
moves it there.

Now, this is not to say that openvswitch_mod should actually be
implementing bridge-compatible sysfs.  In the future, it probably should
not be; rather, it should implement something appropriate for Open vSwitch
datapaths instead.  But right now we have bridge-compatible sysfs, and so
that's what this commit moves.
2009-08-06 16:57:06 -07:00
Ben Pfaff
3c303e5fe1 Implement "brctl showmacs" support in brcompat and ovs-brcompatd.
This is needed by the Citrix test infrastructure.
2009-07-16 09:18:23 -07:00
Ben Pfaff
e5307f55aa brcompat: Refactor infrastructure for communication with ovs-brcompatd.
In an upcoming change, brcompat will need to receive bulk data from
ovs-brcompatd.  The existing brcompat infrastructure for receiving data
only supports returning an error code, so this commit adds the ability to
receive an arbitrary sk_buff and updates the existing users to handle it.
2009-07-16 09:18:23 -07:00
Ben Pfaff
a14bc59fb8 Update primary code license to Apache 2.0. 2009-06-15 15:11:30 -07:00
Ben Pfaff
064af42167 Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45. 2009-07-08 13:19:16 -07:00