aboutsummaryrefslogtreecommitdiff
path: root/datapath/dp_sysfs_dp.c
AgeCommit message (Collapse)Author
2011-11-22datapath: Scope global symbols with ovs_ prefix.Jesse Gross
OVS has quite a few global symbols that should be scoped with a prefix to prevent collisions with other modules in the kernel. Suggested-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-16datapath: Reformat copyright messages.Jesse Gross
Many of our kernel copyright messages make reference to code being copied from the Linux kernel, which is a bit odd for code in the kernel. This changes them to use the standard GNU GPL boilerplate instead. It does not change the actual license, which continues to be GPLv2. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-07datapath: Slim down the vport interface.Jesse Gross
Many of the function in vport.c are simply pass throughs to their underlying vport implementation and, of these, many are used only for bridge compatibility code. This allows users of these functions to directly call through the ops structure, reducing boilerplate code and keeping more of the compatibility code together. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2011-11-07datapath: Fix coding style issues.Pravin B Shelar
Most of issues are reported by checkpatch.pl Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Bug #7771
2011-08-19datapath: Use "OVS_*" as opposed to "ODP_*" for user<->kernel interactions.Justin Pettit
The prefix "ODP_*" is not overly descriptive in the context of the larger Linux tree. This commit changes the prefix to "OVS_*" for the userpace to kernel interactions. The userspace libraries still use "ODP_" in many of their interfaces since it is more descriptive in the OVS oeuvre. Feature #6904 Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2010-12-13datapath: Don't directly access RCU protected pointers.Jesse Gross
If RTNL lock is used to protected updates to RCU data structures then it isn't necessary to use rcu_dereference() to access them if RTNL is held. This adds rtnl_dereference() to access these pointers which has several benefits: documents the locking expectations; checks that RTNL actually is held when run with lockdep; makes sparse not complain about directly accessing RCU pointers. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2010-12-09datapath: Use static where possible.Jesse Gross
Mark functions and global variables used only in a single file as static. Found with sparse. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2010-12-03datapath: Merge "struct dp_port" into "struct vport".Ben Pfaff
After the previous commit, which changed the datapath to always create and attach a vport at the same time, and to always detach and delete a vport at the same time, there is no longer any real distinction between a dp_port and a vport. This commit, therefore, merges the two together to simplify code. It might even improve performance, although I have not checked. I wasn't sure at first whether the merged structure should be "struct dp_port" or "struct vport". I went with the latter since the "v" prefix sounds cool. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2010-08-30treewide: Use pr_fmt and pr_<level>Joe Perches
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-30treewide: Remove trailing whitespaceJoe Perches
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-07-30vport-internal: Set vport to NULL when detaching.Jesse Gross
'struct net_device' is refcounted and can stick around for quite a while if someone is still holding a reference to it. However, we free the vport that it is attached to in the next RCU grace period after detach. This assigns the vport to NULL on detach and adds appropriate checks.
2010-07-30datapath: Remove dead code.Jesse Gross
Several blocks of code were either no longer being called or had been "#if 0"'d out for a long time. This removes them.
2010-04-19datapath: Add generic virtual port layer.Jesse Gross
Currently the datapath directly accesses devices through their Linux functions. Obviously this doesn't work for virtual devices that are not backed by an actual Linux device. This creates a new virtual port layer which handles all interaction with devices. The existing support for Linux devices was then implemented on top of this layer as two device types. It splits out and renames dp_dev to internal_dev. There were several places where datapath devices had to handled in a special manner and this cleans that up by putting all the special casing in a single location.
2009-08-19Merge citrix into master.Ben Pfaff
2009-08-19Merge citrix into master.Ben Pfaff
This was a somewhat difficult merge since there was a fair amount of superficially divergent development on the two branches, especially in the datapath. This has been build-tested against XenServer 5.5.0 and XenServer 5.7.0 build 15122. It has been booted and connected to XenCenter on 5.5.0. The merge revealed a couple of outstanding bugs, which will be fixed on citrix and then merged back into master.
2009-08-18datapath: Improve comments.Ben Pfaff
2009-08-06datapath: Fix OOPS when dp_sysfs_add_if() fails.Ben Pfaff
Until now, when dp_sysfs_add_if() failed, the caller ignored the failure. This is a minor problem, because everything else should continue working, without sysfs entries for the interface, in theory anyhow. In actual practice, the error exit path of dp_sysfs_add_if() does a kobject_put(), and that kobject_put() calls release_nbp(), so that the new port gets freed. The next reference to the new port (usually in an ovs-vswitchd call to the ODP_PORT_LIST ioctl) will then use the freed data and probably OOPS. The fix is to make the datapath code, as opposed to the sysfs code, responsible for creating and destroying the net_bridge_port kobject. The dp_sysfs_{add,del}_if() functions then just attach and detach the kobject to sysfs and their cleanup routines no longer need to destroy the kobject and indeed we don't care whether dp_sysfs_add_if() really succeeds. This commit also makes the same transformation to the datapath's ifobj, for consistency. It is easy to trigger the OOPS fixed by this commit by adding a network device A to a datapath, then renaming network device A to B, then renaming network device C to A, then adding A to the datapath. The last attempt to add A will fail because a file named /sys/class/net/<datapath>/brif/A already exists from the time that C was added to the datapath under the name A. This commit also adds some compatibility infrastructure, because it moves code out of #ifdef SUPPORT_SYSFS and it otherwise wouldn't build.
2009-08-06datapath: Prepare to extend lifetime of kobjects.Ben Pfaff
The following commit will move the initialization of the datapath and net_bridge_port kobjects earlier and the destruction later, without changing when those kobjects are attached to sysfs. To do so, the initialization of kobjects and attaching to sysfs has to be done as separate steps. That's already the case for net_bridge_port kobjects, and this commit makes it so for datapath kobjects too. This commit also simplifies some code, since the split API exists both before and after 2.6.25, but the combined functions changed names. Also, in dp_sysfs_add_if() call kobject_init() after initializing the kset member, since kobject_init() expects that. This makes no actual difference in this case since the kobj is obtained from kzalloc(), but it still seems better.
2009-08-06datapath: Rename brc_sysfs_* to dp_sysfs_*.Ben Pfaff
These files and names are now part of the datapath, not brcompat, so name them appropriately so as not to confuse anyone.