aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-07-30sflow: Avoid "unused parameter" warnings from GCC 4.4.Ben Pfaff
With GCC -Wno-unused by itself isn't enough to avoid "unused parameter" warnings, since we also use -Wunused-parameter. We also need to check for and use -Wno-unused-parameter.
2010-07-30ovs-ofctl: Add support for OpenFlow enqueue action.Ben Pfaff
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-30vport: Make dp_port->vport always valid.Jesse Gross
When we detached a vport we would assign NULL to dp_port->vport before calling synchronize_rcu(). However, since vports have a longer lifetime than dp_ports there were no checks before dereferencing dp_port->vport. This changes the behavior to match the assumption by not assigning NULL during detach. This avoids a potential NULL pointer dereference in do_output() among other places.
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-07-30datapath: Remove redundant checks on SKBs.Jesse Gross
On vport ingress we already check for shared SKBs but then later warn in several other places. In a similar vein, we check every packet to see if it is LRO but only certain vports can produce these packets. Remove and consolidate checks to the places where they are needed.
2010-07-30ovs-controller: Add ability to define default flowsJustin Pettit
Add support for the --with-flows option, which allows default flows to be read from a file and pushed to connecting switches.
2010-07-30learning-switch: Add ability to define default flowsJustin Pettit
Add an argument to the function to create a learning switch, which defines default flows to be pushed down to connecting switches. It does nothing to enforce that they remain intact. It only pushes flows on switch connection.
2010-07-30ofp-parse: Break string-to-openflow parsing into library functionsJustin Pettit
An upcoming commit will add the ability to load OpenFlow rules into ovs-controller. Break out string-to-openflow parsing so that ovs-ofctl and ovs-controller can use the same code.
2010-07-29datapath: Catch missed formatting changes.Jesse Gross
A few functions were missed in the change to move the return type onto the same line as the arguments.
2010-07-26datapath: Don't query time for every packet.Jesse Gross
Rather than actually query the time every time a packet comes through, just store the current jiffies and convert it to actual time when requested. GRE is the primary beneficiary of this because the traffic travels through the datapath twice. This change reduces CPU utilization 3-4% with GRE.
2010-07-23vlog: Fix logic error in update_min_level().Ben Pfaff
Commit 480ce8ab "vlog: Make the vlog module catalog program-specific." accidentally inverted the logic in this function, which broke the "-v" to various OVS programs as well as other mechanisms to set logging to non-default levels.
2010-07-21vlog: Make the vlog module catalog program-specific.Ben Pfaff
Until now, the collection of vlog modules supported by a given OVS program was not specific to that program. That means that, for example, even though ovs-dpctl does not have anything to do with jsonrpc, it still has a vlog module for it. This is confusing, at best. This commit fixes the problem on some systems, in particular on ones that use GCC and the GNU linker. It uses the feature of the GNU linker described in its manual as: If an orphaned section's name is representable as a C identifier then the linker will automatically see PROVIDE two symbols: __start_SECNAME and __end_SECNAME, where SECNAME is the name of the section. These indicate the start address and end address of the orphaned section respectively. Systems that don't support these features retain the earlier behavior. This commit also fixes the annoyance that modifying lib/vlog-modules.def causes all sources files that #include "vlog.h" to recompile.
2010-07-21vlog: Introduce VLOG_DEFINE_THIS_MODULE for declaring vlog module in use.Ben Pfaff
Adding a macro to define the vlog module in use adds a level of indirection, which makes it easier to change how the vlog module must be defined. A followup commit needs to do that, so getting these widespread changes out of the way first should make that commit easier to review.
2010-07-21vlog: Remove explicit calls to vlog_init().Ben Pfaff
This is no longer necessary.
2010-07-21vlog: Make vlog initialize itself when necessary.Ben Pfaff
It's more convenient if clients don't have to initialize modules explicitly. The most important part of this change is to initialize the default log levels statically. Previously, by initializing log levels only from vlog_init(), all the log levels appeared to be VLL_EMER (0) if vlog_init() was accidentally not called at all. This was not intended behavior, so this commit fixes it. This commit also fixes up a few test programs whose tests accidentally depended on this behavior, by making them explicitly turn off log messages that were implicitly turned off before.
2010-07-21timeval: Make time_init() static and remove calls to it.Ben Pfaff
Since the timeval module now initializes itself on-demand, there is no longer any need to initialize it explicitly, or to provide an interface to do so.
2010-07-21timeval: Make timeval module initialize itself.Ben Pfaff
It's more convenient if clients don't have to initialize modules explicitly.
2010-07-21timeval: Integrate CLOCK_MONOTONIC detection into time_init().Ben Pfaff
I don't see a reason that set_up_monotonic() should be separate from time_init(). Doing all the time initialization in one place seems reasonable, so this commit makes that change.
2010-07-21debian: Check for accurate Debian changelog version at build time too.Ben Pfaff
When we increment the Open vSwitch version number, we tend to forget to update it in debian/changelog at the same time. Right now this gets fixed up automatically at "make dist" time, but it's even better if we can always have it be correct in the repository. This commit should help with that, by making both "make" and "make dist" refuse to proceed if the version number is out of sync.
2010-07-21tests: Disable profiling for "wait-until must wait" test.Ben Pfaff
This test tends to break when run with lcov profiling since the lcov wrapper script can't synchronize access to profiling data across all the ovs-vsctl instances running in parallel.
2010-07-20netdev-linux: Avoid minor number 0 in traffic control.Ben Pfaff
Linux traffic control handles with minor number 0 refer to qdiscs, not to classes. This commit deals with this by using a conversion function: OpenFlow queue 0 maps to minor 1, queue 1 to minor 2, and so on.
2010-07-20netdev-linux: Dump all queues, not just direct children of the root.Ben Pfaff
A netdev-linux traffic control implementation has to dump all of a port's traffic classes in a couple of different situations. start_queue_dump() is supposed to do that. But it was specifying TC_H_ROOT as tcm_parent, which only dumped classes that were direct children of the root. This commit changes tcm_parent to 0, which obtains all traffic classes regardless of parent.
2010-07-20dpif-linux: Translate queues to priorities correctly.Ben Pfaff
The TC_H_MAKE macro does not shift the major number into position.
2010-07-20dpif: Abstract translation from OpenFlow queue ID into ODP priority value.Ben Pfaff
When the QoS code was integrated, I didn't yet know how to abstract the translation from a queue ID in an OpenFlow OFPAT_ENQUEUE action into a priority value for an ODP ODPAT_SET_PRIORITY action. This commit is a first attempt that works OK for Linux, so far. It's possible that in fact this translation needs the 'netdev' as an argument too, but it's not needed yet.
2010-07-20Add pretty-printers for QoS related OpenFlow and ODP actions.Ben Pfaff
2010-07-20ovs-controller: Add support for OpenFlow queues.Ben Pfaff
Before, ovs-controller always sent packets using OFPAT_OUTPUT, which always uses the default OpenFlow queue. To help me debug the Open vSwitch QoS implementation, I want to be able to send packets on other queues, so this commit adds that feature.
2010-07-20learning-switch: Add support for OpenFlow queues.Ben Pfaff
Before, an lswitch always sent packets using OFPAT_OUTPUT, which always uses the default OpenFlow queue. To help me debug the Open vSwitch QoS implementation, I want to be able to send packets on other queues, so this commit adds that feature.
2010-07-20learning-switch: Break packet-in processing into two steps.Ben Pfaff
2010-07-16learning-switch: Refactor wildcards calculation.Ben Pfaff
There's no need to calculate the wildcards to use for each flow, since it is a constant across every flow. In my opinion this also makes process_packet_in() a little easier to understand, since it deletes a few lines of code from a relatively complicated function.
2010-07-16learning-switch: Reserved addresses are destinations, not sources.Ben Pfaff
A switch is not supposed to forward packets directed to MAC addresses 01:80:c2:00:00:0x. This code was instead dropping packets *from* those addresses. (This code is only used by ovs-controller, so the bug is not a big deal.)
2010-07-16ovs-vsctl: Fix unitialized variables.Jesse Gross
The compiler pointed out two variables that it thought were used without being initialized. The first was just a spurious warning but the second could result in an unitialized pointer being freed. This fixes both of those issues.
2010-07-16ovs-vsctl: Do not allow record names to be abbreviated.Ben Pfaff
It's pretty risky to allow record names to be abbreviated. If eth1 through eth20 all exist, and then someone deletes eth1, then until now an ovs-vsctl command that mentioned eth1 would actually use eth10. This is too much of a caveat to let loose on unsuspecting scripts, so this commit removes that functionality.
2010-07-16xenserver: Kill bond slaves' dhclients when bringing up bond master.Ben Pfaff
This fixes the converse of the problem addressed by commit fe19e820 "xenserver: Kill bond master's dhclient when bringing up bond slave". In that commit's log message, I claimed that the converse was not a problem, but I was wrong. I must have screwed up in testing, because it really is a problem. This commit fixes it. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ian Campbell <Ian.Campbell@citrix.com> CC: Dominic Curran <dominic.curran@citrix.com> Reported-by: Michael Mao <mmao@nicira.com> Bug #2668.
2010-07-15doc: Make explicit that ovs-vswitchd is the preferred switch.Jesse Gross
Many people who are looking for an OpenFlow switch assume that the only way to do it is using ovs-openflowd. Sometimes they also run ovs-vswitchd at the same time. Try to clarify that neither of these are necessary and ovs-vswitchd can handle OpenFlow by itself and is the preferred method of doing so.
2010-07-15datapath: Don't update flow key when applying actions.Jesse Gross
Currently the flow key is updated to match an action that is applied to a packet but these field are never looked at again. Not only is this a waste of time it also makes optimizations involving caching the flow key more difficult.
2010-07-15datapath: Don't set tunnel_id in a function.Jesse Gross
We don't need a function to set a variable. In practice it will almost certainly get inlined but this makes it easier to read.
2010-07-15gre: Use struct for parsing GRE header.Jesse Gross
GRE is a somewhat annoying protocol because the header is variable length. However, it does have a few fields that are always present so we can make the parsing seem less magical by using a struct for those fields instead of building it up field by field.
2010-07-15gre: Wait for an RCU grace period before freeing port.Jesse Gross
We currently remove ports from the GRE hash table and then immediately free the ports. Since received packets could be using that port this can lead to a crash (the port has already been detached from the datapath so this can't happen for transmitted packets). As a result we need to wait for an RCU grace period to elapse before actually freeing the port. In an ideal world we would actually remove the port from the hash table in a hypothetical gre_detach() function since this is one of the purposes of detaching. However, we also use the hash table to look for collisions in the lookup criteria and don't want to allow two identical ports to exist. It doesn't matter though because we aren't blocking on the freeing of resources.
2010-07-15vport: Use DEFINE_PER_CPU instead of dynamically allocating loop counter.Jesse Gross
DEFINE_PER_CPU is simpler and faster than alloc_percpu() so use it for the loop counter, which is already statically defined.
2010-07-15datapath: Put return type on same line as arguments for functions.Jesse Gross
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-15vport: Use EBUSY to represent already attached device.Jesse Gross
We currently use EEXIST to represent both a device that is already attached and for GRE devices that are the same as another one. Instead use EBUSY for already attached devices to disambiguate the two situations.
2010-07-15datapath: Make checksum offsets unsigned.Jesse Gross
The offsets for checksum offsets should always be positive so make that explicit by using unsigned ints. This helps bug checks that test if the offsets are greater than their upper limits.
2010-07-14ovs-vsctl: Make --help capitalization and spelling more consistent.Ben Pfaff
Reported-by: Reid Price <reid@nicira.com> Bug #3175.
2010-07-14Tests: Fix nonportable \" escape in printf(1) invocation.Ben Pfaff
The \" escape is not part of POSIX, but it is a common extension. The dash shell's built-in "printf" implementation does not include this extension, which caused the testsuite to be generated incorrectly if it is used as the default shell (as it is on newer versions of Debian and Ubuntu). However, there's no reason to use a backslash here at all, so just omit it.
2010-07-14ofpbuf: Implement unsupported feature in ofpbuf_trim().Ben Pfaff
Until now, ofpbuf_trim() has not handled the case where the ofpbuf has nonzero headroom. This causes an assertion failure when pinsched_send() queues a packet to be sent later, because such packets have been guaranteed to have nonzero headroom since commit 43253595 "ofproto: Avoid buffer copy in OFPT_PACKET_IN path." This commit fixes the problem by implementing the until-now unsupported case. This commit factors code out of ofpbuf_prealloc_tailroom() into two new functions, ofpbuf_rebase__() and ofpbuf_resize_tailroom__(), and uses the latter to implement both ofpbuf_prealloc_tailroom() and ofpbuf_trim(). ofpbuf_rebase__() isn't used on its own at all, but it seems potentially useful so I made it an independent function. Reported-by: Tom Everman <teverman@google.com>
2010-07-13datapath: Make our checksumming more closely match skb_checksum_help().Jesse Gross
Our code that handles checksumming does essentially the same thing as skb_checksum_help() except it folds the process into copying to userspace. This makes the two functions more closely resemble each other in structure, including adding a couple of BUG() checks. This should have no functional change but makes comparision easier when debugging.
2010-07-13gre: Fix headroom calculation.Jesse Gross
If we need to make a copy we add a little bit extra to the headroom that we think we need in order to avoid future copies. Previously we would always just allocate max(headroom, 64) which is generally enough space. However, if we are using IPsec our expected headroom is large and there is no extra. Instead, it is better to just tack on a few extra bytes so we'll always have a cushion.
2010-07-13datapath: Move over-MTU checking into vport_send().Jesse Gross
We currently check for packets that are over the MTU in do_output(). There is a one-to-one correlation between this function and vport_send() so move the MTU check there for consistency with other error checking.
2010-07-13datapath: Add loop checking.Jesse Gross
New types of vports such as patch and GRE make it possible to connect multiple (or the same) datapaths together, which introduces the possibility of loops on a single machine. Local loops are even worse than network loops because they will quickly crash the machine once the kernel stack is exhausted. This adds loop checking within the OVS datapath that will drop packets that have been seen more than 5 times. CC: Paul Ingram <paul@nicira.com>