Ben Pfaff [Thu, 4 Dec 2014 22:31:56 +0000 (14:31 -0800)]
ofp-actions: Only set defined bits when encoding "load" actions.
Commit 7eb4b1f1d70345f ("ofp-actions: Support OF1.5 (draft) masked
Set-Field, merge with reg_load.") introduced a bug in that a set_field
action that set an entire field would be translated incorrectly to
reg_load, if the field being set only occupied a portion of the bytes that
it contains. For example, an MPLS label is 20 bits but has a 4-byte field,
which meant that a set_field would get translated into a reg_load that
wrote all 32 bits; in turn, the receiver of that reg_load would reject it
because it was attempting to set invalid bits (the top 12 bits).
This commit fixes the problem by omitting invalid bits when encoding a
reg_load action.
Joe Stringer [Fri, 5 Dec 2014 00:05:33 +0000 (16:05 -0800)]
util: Fix include for htonl().
Commit 526a7c85d11dc "util: Add be32_prefix_mask()." added an include for
byte-order.h into util.h, which could cause link failures if users of
libopenvswitch defined their own version of htonll(). Change the
include, as only htonl() is needed and arpa/inet.h provides this.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Joe Stringer [Thu, 4 Dec 2014 00:34:08 +0000 (16:34 -0800)]
cccl: Respect silent flags.
Automake sets $V to tell the compiler whether to print verbose messages
as it compiles or not. Add support for this variable in cccl, allowing
more quiet build output on windows if the build is configured with
--silent or the developer runs make V=0.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Joe Stringer [Wed, 3 Dec 2014 18:57:37 +0000 (10:57 -0800)]
tests: Fix race in async config test.
Occasionally, the testsuite would send the OFPT_SET_ASYNC before
ovs-vswitchd got a chance to send its OFPT_ROLE_REPLY message, causing a
reordering of the testsuite output and a false positive. Give the test
script something extra to do so this is less likely to happen.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Joe Stringer [Wed, 3 Dec 2014 18:38:18 +0000 (10:38 -0800)]
tests: Make ofproto-dpif tests more resilient.
We have previously used a combination of time/warp and revalidator/wait
to try to synchronize the datapath flow statistics and status up to the
ofproto layer, so that tests may confirm their expected behaviours using
OpenFlow or other protocols operating at that layer of vswitchd (eg LACP).
This patch switches these tests over to using revalidator/purge, which
tells the ofproto-dpif to flush the datapath, causing these statistics
to be updated. In local testing this appears to improve the success rate
of these tests considerably.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Joe Stringer [Sun, 5 Oct 2014 22:14:08 +0000 (11:14 +1300)]
dpif: Minimize memory copy for revalidation.
One of the limiting factors on the number of flows that can be supported
in the datapath is the overhead of assembling flow dump messages in the
datapath. This patch modifies the dpif to allow revalidators to skip
dumping the key, mask and actions from the datapath, by making use of
the unique flow identifiers introduced in earlier patches.
For each flow dump, the dpif user specifies whether to skip these
attributes, allowing the common case to only dump a pair of 128-bit ID
and flow stats. With datapath support, this increases the number of
flows that a revalidator can handle per second by 50% or more. Support
in dpif-netdev and dpif-netlink is added in this patch; kernel support
is left for future patches.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Wed, 24 Sep 2014 04:26:35 +0000 (16:26 +1200)]
dpif: Index flows using unique identifiers.
This patch modifies the dpif interface to allow flows to be manipulated
using a 128-bit identifier. This allows revalidator threads to perform
datapath operations faster, as they do not need to serialise the entire
flow key for operations like flow_get and flow_delete. In conjunction
with a future patch to simplify the dump interface, this provides a
significant performance benefit for revalidation.
When handlers assemble flow_put operations, they specify a unique
identifier (UFID) for each flow as it is passed down to the datapath to
be stored with the flow. The UFID is currently provided to handlers
by the dpif during upcall processing.
When revalidators assemble flow_get or flow_del operations, they may
specify the UFID for the flow along with the key. The dpif will decide
whether to send only the UFID to the datapath, or both the UFID and flow
key. The former is preferred for newer datapaths that support UFID,
while the latter is used for backwards compatibility.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Sat, 22 Nov 2014 00:49:40 +0000 (16:49 -0800)]
datapath: Add UFID interface to openvswitch.h.
An upcoming set of patches will implement support for indexing flows by
Unique Flow IDentifiers (UFID) rather than the traditional unmasked key.
This patch implements the interface changes required. The implementation
will follow.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Ben Pfaff [Tue, 2 Dec 2014 18:50:38 +0000 (10:50 -0800)]
dpif: Don't clear argument in dp_enumerate_types().
All but one of the callers of dp_enumerate_types() hands it an sset that is
known to be empty. The one exception is the implementation of the
ofproto-provider 'enumerate_types' function in ofproto-dpif. That function
isn't supposed to clear the existing contents of the sset passed in.
Therefore, this commit changes dp_enumerate_types() to not clear the sset
before it adds new members.
The ofproto-provider comment wasn't clear about the desired behavior so
this commit also clarifies that.
Reported-by: Zoltán Balogh <zoltan.balogh@ericsson.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Tue, 2 Dec 2014 19:04:16 +0000 (11:04 -0800)]
dist-docs: New utility to generate a documentation bundle for the website.
This utility isn't going to be as portable as most of the Open vSwitch
utilities, unfortunately. I'm happy to take improvements to make it
able to work with, e.g., the "man" program from BSD. (I haven't tested
with that program, but I suspect that it is somewhat different from the
GNU version.)
The output of this program can already be viewed at:
http://openvswitch.org/support/dist-docs/
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Thomas Graf <tgraf@noironetworks.com>
Pravin B Shelar [Wed, 26 Nov 2014 19:27:05 +0000 (11:27 -0800)]
route-table: Remove Unregister.
Since dpif registering for routing table at initialization
there is no need to unregister it. Following patch removes
support for turning routing table notifications on and off.
Due to this change OVS always listens for these
notifications.
Thomas Graf [Wed, 26 Nov 2014 14:52:31 +0000 (15:52 +0100)]
datapath: Use ccflags-y instead of deprecated EXTRA_CFLAGS
This allows users to pass in additional compiler flags through the
environment variable EXTRA_CFLAGS, e.g.
make EXTRA_CFLAGS=-Wno-error=foo V=1
Reported-by: Alexandru Ardelean <ardeleanalex@gmail.com> Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Alex Wang [Tue, 25 Nov 2014 23:51:12 +0000 (15:51 -0800)]
dpif-netdev: Fix a race.
On current master, the 'struct dp_netdev_port' is destroyed
immediately when the ref count reaches 0. However, non-pmd
threads calling the dpif_netdev_execute() for sending packets
could hold pointer to 'port' that is not ref-counted. Thusly
those threads could possibly access freed memory when the port
is deleted.
To fix this bug, this commit makes non-pmd threads acquiring
the 'port_mutex' before doing the actual execution in
dpif_netdev_execute().
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Joe Stringer [Wed, 24 Sep 2014 03:24:39 +0000 (15:24 +1200)]
dpif: Generate flow_hash for revalidators in dpif.
This patch shifts the responsibility for determining the hash for a flow
from the revalidation logic down to the dpif layer. This assists in
handling backward-compatibility for revalidation with the upcoming
unique flow identifier "UFID" patches.
A 128-bit UFID was selected to minimize the likelihood of hash conflicts.
Handler threads will not install a flow that has an identical UFID as
another flow, to prevent misattribution of stats and to ensure that the
correct flow key cache is used for revalidation.
For datapaths that do not support UFID, which is currently all
datapaths, the dpif will generate the UFID and pass it up during upcall
and flow_dump. This is generated based on the datapath flow key.
Later patches will add support for datapaths to store and interpret this
UFID, in which case the dpif has a responsibility to pass it through
transparently.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Wed, 6 Aug 2014 04:40:37 +0000 (16:40 +1200)]
upcall: Revalidate using cache of mask, actions.
This allows us to ignore most fields of a flow_dump, requiring only the
flow key for looking up the ukey. Fetching flows can also be avoided in
the corner case where a flow is missed from a dump but revalidation is
required.
A future patch will modify the datapath interface to allow datapaths to
skip dumping these fields, so this cache will be used instead.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Fri, 25 Jul 2014 01:54:24 +0000 (13:54 +1200)]
upcall: Create ukeys in handler threads.
Currently, when a revalidator thread first dumps a flow, it creates a
'udpif_key' object and caches a copy of a kernel flow key. This allows
us to perform lookups in the classifier to attribute stats and validate
the correctness of the datapath flow.
This patch sets up this cache from the handler threads, during flow
setup. While this patch alone causes a decrease in revalidation
performance, it allows future patches increase performance by reducing
the cost of flow dumping.
Revalidators will continue to create ukeys if a flow is dumped that has
no corresponding ukey. This may happen in corner cases such as when
ovs-vswitchd is restarted (and flows remain in the datapath) or a user
installs a flow using ovs-dpctl.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Thu, 5 Jun 2014 05:28:46 +0000 (17:28 +1200)]
udpif: Separate udpif_key maps from revalidators.
An upcoming patch will change the access patterns for ukey maps to
increase the number of writers, and shift write-access from revalidator
threads to upcall handler threads. As such, it no longer makes sense to
tie these maps to revalidators in a 1:1 relationship.
This patch separates the ukey maps from the revalidators, and increases
the number of maps used to store ukeys, to reduce contention.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Mon, 5 May 2014 03:44:04 +0000 (15:44 +1200)]
revalidator: Protect ukeys with a mutex.
Currently, udpif_keys are protected during revalidator_sweep__() as only
one thread accesses the ukey at a time. This is ensured using barriers:
all revalidators will be in the GC phase, so they will only access their
own ukey collection.
A future patch will change the access patterns to allow these ukey
collections to be read or modified while a revalidator is garbage
collecting it. To protect the ukeys, this patch adds locking on the ukey
collection.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Tue, 25 Nov 2014 21:02:42 +0000 (13:02 -0800)]
datapath: Don't validate IPv6 label masks.
When userspace doesn't provide a mask, OVS datapath generates a fully
unwildcarded mask for the flow by copying the flow and setting all bits
in all fields. For IPv6 label, this creates a mask that matches on the
upper 12 bits, causing the following error:
openvswitch: netlink: Invalid IPv6 flow label value (value=ffffffff, max=fffff)
This patch ignores the label validation check for masks, avoiding this
error.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Finucane [Wed, 19 Nov 2014 12:03:22 +0000 (12:03 +0000)]
tests/ovs_client: Remove broken debug code
There is some debug "logging" code included in the 'ovs_client'
application. This code appears to be broken as it spams stdout with
duplicated "log" messages. Remove this code.
This patch also renames ovs_client to ring_client.
In addition, add the 'test-dpdkr' executable to the 'tests/.gitignore'
file.
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Nithin Raju [Tue, 25 Nov 2014 17:06:43 +0000 (09:06 -0800)]
datapath-windows: Update DESIGN document.
In this patch, we update the design document to reflect the netlink
based kernel-userspace interface implementation and a few other changes.
I have covered at a high level.
Please feel free to extend the document with more details that you think
got missed out.
ovs-vsctl has the concept of a VLAN (or "fake") bridge, which is a
sort of a sub-bridge that receives only packets on a particular VLAN.
There is no way to distinguish two VLAN bridges with the same parent on the
same VLAN, but until now ovs-vsctl did not prevent creating duplicates or
report them. This commit fixes the problem.
Reported-by: rwxybh
Reported-at: https://github.com/openvswitch/ovs/issues/21 Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Thomas Graf <tgraf@noironetworks.com>
Sorin Vinturis [Mon, 24 Nov 2014 16:17:34 +0000 (16:17 +0000)]
datapath-windows: Update OVSEXT VS project to support 6.40
Added support for creating OVS extension driver NDIS 6.40 compliant.
Currently the OVSEXT Visual Studio project has four build configurations,
'Win8 Release', 'Win8 Debug', 'Win8.1 Release' and 'Win8.1 Debug'. All of
them are creating a binary that is NDIS 6.30 compliant. I have changed the
Win8.1 build configurations in order to create a binary that is NDIS 6.40
compliant.
In this way, the OVSEXT project is able to create a release/debug binary
that is NDIS 6.30 compliant, using the 'Win8 Release' and 'Win8 Debug'
build configurations, as well as a release/debug binary that is NDIS 6.40
compliant, using the 'Win8.1 Release' and 'Win8.1 Debug' build
configurations.
Ben Pfaff [Tue, 25 Nov 2014 16:37:24 +0000 (08:37 -0800)]
tests: Fix test broken by introduction of ONFOXM_ET_TCP_FLAGS.
Commit 847ddeab372220 (meta-flow: Add support for ONF OpenFlow 1.3
extension ONFOXM_ET_TCP_FLAGS.) failed to update a test to match the new
OXM extension. This fixes the problem.
Shu Shen [Fri, 21 Nov 2014 19:44:23 +0000 (11:44 -0800)]
ofproto-dpif: Add test case for OF1.4 packet-in.
The test case current fails and shows a bug when OF1.4 is used between
the controller and the switch, the packet-in message still uses OF1.3
wire protocol version.
Signed-off-by: Shu Shen <shu.shen@radisys.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Fri, 21 Nov 2014 01:16:23 +0000 (10:16 +0900)]
openflow: Use *_array_len names in struct ofp15_bucket and ofp15_group_mod
The spec has been clarified to use _list_len in palce of _list_len
terminology to make it clearer that the data is not an ordered list
(it is a set). The code present in Open vSwitch already avoided
the _list_len terminology. This change brings the code into
line with the updated spec.
ONF-JIRA: EXT-350 Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Sorin Vinturis [Mon, 24 Nov 2014 22:32:06 +0000 (22:32 +0000)]
datapath-windows: Support for hybrid forwarding
In a hybrid forwarding environment, there are two types of packets that
enter and leave the Hyper-V extensible switch: NVGRE packets and non-NVGRE
packets. Hybrid forwarding involves filtering the incoming traffic based
on packet type.
Thus, we must split the incoming traffic into NVGRE and non-NVGRE packets.
All non-NVGRE traffic is forwarded by the OVS extension and processed as
usual, and the NVGRE traffic is passed to NDIS to be handled by the HNV
module.
Necessary VS project changes regarding the compiler settings will be made
in a different patch.
More details about hybrid forwarding and the necessary NDIS 6.40 support
is provided in issue #52.
Joe Stringer [Thu, 13 Nov 2014 18:42:47 +0000 (10:42 -0800)]
tests: Add command to purge revalidators of flows.
This patch adds a new 'ovs-appctl revalidator/purge' command which
flushes all flows from all datapaths, and updates the revalidator
udpif_key cache at the same time.
Update the ofproto-dpif fragment tests which may fail when ukeys are
created from handler threads.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Jarno Rajahalme [Fri, 21 Nov 2014 23:42:42 +0000 (15:42 -0800)]
tunnel-push-pop.at: Make test more deterministic.
Using the '-march=native' broke this test in a i7 laptop, most likely
due to a different hash implementation, which resulted in different
datapath port number assignment accross different compilations.
Break up the ports setup so that the datapath port number assignment
is more deterministic.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Eitan Eliahu [Sat, 22 Nov 2014 00:58:54 +0000 (16:58 -0800)]
datapath-windows: do not complete an IRP when pending status returned
The driver completes a pending IRP, the IRP is being marked free by the
I/O manager which causes a system crash when the IRP is completed at
the second time.
The driver should not complete a pending IRP in the context of the
Device I/O control thread.
*** Fatal System Error: 0x00000044
(0xFFFFFA800CF897D0,0x0000000000000F7A,0x0000000000000000,0x0000000000000000)
Probably caused by : OVSExt.sys ( OVSExt!OvsCompleteIrpRequest+3a )
Followup: MachineOwner
---------
nt!DbgBreakPointWithStatus: fffff800`5a100930 cc int 3
11: kd> !analyze -v
*******************************************************************************
* *
* Bugcheck Analysis *
* *
*******************************************************************************
MULTIPLE_IRP_COMPLETE_REQUESTS (44)
A driver has requested that an IRP be completed (IoCompleteRequest()), but
the packet has already been completed. This is a tough bug to find because
the easiest case, a driver actually attempted to complete its own packet
twice, is generally not what happened. Rather, two separate drivers each
believe that they own the packet, and each attempts to complete it. The
first actually works, and the second fails. Tracking down which drivers
in the system actually did this is difficult, generally because the trails
of the first driver have been covered by the second. However, the driver
stack for the current request can be found by examining the DeviceObject
fields in each of the stack locations.
Arguments:
Arg1: fffffa800cf897d0, Address of the IRP
Arg2: 0000000000000f7a
Arg3: 0000000000000000
Arg4: 0000000000000000
Alex Wang [Fri, 21 Nov 2014 18:55:03 +0000 (10:55 -0800)]
xen.spec: Fix xenserver build failure.
This commit conducts similar operations as commit 2fd84d5e5
(rhel: Include pkgconfig and update header install in
Fedora/RHEL spec.) to xenserver spec file to prevent the
following rpmbuild failure.
Alex Wang [Thu, 20 Nov 2014 18:41:52 +0000 (10:41 -0800)]
cmap: Shrink cmap when load factor is below 20%.
This commit adds check in cmap_remove() and shrinks the cmap by half
if the load factor is below 20%. This is to reduce the memory
utilization of cmap and to avoid the allocated cmap memory occupying
the top of heap memory, preventing the trim of heap.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Fri, 14 Nov 2014 23:54:56 +0000 (15:54 -0800)]
dpif-netdev: Garbage collect the exact match cache periodically.
On current master, the exact match cache entry can keep reference to
'struct dp_netdev_flow' even after the flow is removed from the flow
table. This means the free of allocated memory of the flow is delayed
until the exact match cache entry is cleared or replaced.
If the allocated memory is ahead of chunks of freed memory on heap,
the delay will prevent the reclaim of those freed chunks, causing
falsely high memory utilization.
To fix the issue, this commit makes the owning thread conduct periodic
garbage collection on the exact match cache and clear dead entries.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
---
PATCH -> V2:
- Adopt Jarno's suggestion and conduct slow sweep to avoid introducing
jitter.
Nithin Raju [Thu, 20 Nov 2014 03:41:22 +0000 (19:41 -0800)]
datapath-windows: rename 'hvDeleted' to 'isPresentOnHv'
'hvDeleted' was originally added to track vports that got deleted from
the Hyper-V switch, but which still exists in OVS. Since then, it has
taken a new meaning: eg. it is set to TRUE for VXLAN ports which don't
exist on the Hyper-V switch at all.
Nithin Raju [Thu, 20 Nov 2014 17:06:34 +0000 (09:06 -0800)]
datpaath-windows: consolidate check for output buffer
Earlier, output buffer was optional in a transaction command. Thus each
command handler, had to check if the output buffer had indeed been
specified by userspace or not.
Now that output buffer is mandatory in transaction command, let's
consolidate the check in one place, and also convert the previous check
to ASSERTs.
OvsPub.h is not longer the interface file that published the interface
of the kernel datapath to userspace. Nevertheless it is still being used
internal to the kernel datapath.
Sorin Vinturis [Wed, 19 Nov 2014 07:16:32 +0000 (07:16 +0000)]
datapath-windows: Avoid BSOD when switch context is NULL
I came around a BSOD that happened when trying to access pidHashLock
from the gOvsSwitchContext, which was NULL. The stop happened in
OvsAcquirePidHashLock function.
To reproduce this BSOD, make sure the extension is enabled and running,
disable it and, after that, execute 'ovs-dpctl.exe show'. The BSOD is
triggered afterwards.
Nithin Raju [Wed, 19 Nov 2014 01:42:48 +0000 (17:42 -0800)]
datapath-windows: Fixes in HvCreatePort() to re-add a port
In this patch, we update HvCreatePort() to be able to re-add a Hyper-V
port. Specifically, we handle the case where the port had also been
added by OVS userspace, so that when the port was previously deleted
from Hyper-V, we did not deallocate the port.
The key to a vport is its name. We lookup the list of vports both in the
'portIdHashArray' as well as 'portNoHashArray' to make sure that we
don't have a port with the same name.
Validation:
- deleted an re-added a port with and without the corresponding OVS port
existing
- deleted, changed the name of a port, and re-added it back with and
without the corresponding OVS port existing.
- uninstall was succcessful. No asserts hit.
Nithin Raju [Wed, 19 Nov 2014 01:42:47 +0000 (17:42 -0800)]
datapath-windows: Change return type of OvsInitVxlanTunnel()
OvsInitVxlanTunnel() need not return a NL_ERROR. In this patch, we
change it to NTSTATUS, and also update the mapping function that maps a
NTSTATUS to NL_ERROR.
Nithin Raju [Wed, 19 Nov 2014 01:42:46 +0000 (17:42 -0800)]
datapath-windows: Changes to InitOvsVportCommon()
If a Hyper-V port (for which there exists an OVS port), gets deleted and
re-added, we'll call into InitOvsVportCommon() for the port to insert
the port into the 'portIdHashArray' as well as do a few other
initialization in the switch ocntext.
We should not be incrementing 'numHvPorts' at this point since this
vport has been counted before when it was first allocated. To account
for this, we add a new parameter to InitOvsVportCommon(). The arguments
passed by some of the callers are not 100% correct, and will be fixed in
future commit in the series.
Nithin Raju [Wed, 19 Nov 2014 01:42:45 +0000 (17:42 -0800)]
datapath-windows: Changes to OvsRemoveAndDeleteVport()
In this patch, we add changes to OvsRemoveAndDeleteVport() to allow the
caller to specify if a vport is being deleted because it got deleted on
Hyper-V or if it got deleted from OVS userspace.
The reason we need to make the distinction is to be able to delete the
vport from the relevant hash tables.
If a port has been deleted from all the hash tables ie. has been deleted
from Hyper-V as well as OVS userspace, it gets deallocated.
Nithin Raju [Wed, 19 Nov 2014 01:42:44 +0000 (17:42 -0800)]
datapath-windows: clarify 'portIdHashArray' in the swithc context
In this patch, we update the documentation for 'portIdHashArray' to
indicate that a vport would exist in this hash table if and only if it
also exists on the Hyper-V switch.
This functionality to implement this semantic will follow in subsequent
patches.
Nithin Raju [Wed, 19 Nov 2014 01:42:43 +0000 (17:42 -0800)]
datapath-windows: add WCHAR version of OvsFindVportByHvName()
In this patch, we rename the existing OvsFindVportByHvName() to
OvsFindVportByHvNameA() to indicate that the input string is an ASCII
string. We also define a OvsFindVportByHvNameW() that takes as input a
WCHAR string.
This will be used later in HvCreatPort() to check for ports with
duplicate names.
With this patch setters invoke procedures only if values have changed.
Also rstp_set_bridge_address__() keeps the existing priority in the
bridge_identifier.
Other ports should stop forwarding and learning when a port receives a
superior BPDU carrying a Proposal flag.
Without this patch this does not happen and other ports keep executing
the learning and forwarding processes.
This patch contains some fixes reported in the 802.1q-2008 standard.
Jarno Rajahalme [Wed, 19 Nov 2014 17:27:56 +0000 (09:27 -0800)]
rstp: Fix global transitions.
Global transitions are highest priority transitions. When the
condition associated with a global transition is met, it supersedes
all other exit conditions including UCT.
Extracted from 802.1D-2004 standard (17.16):
A transition that is global in nature (i.e., a transition that occurs
from any of the possible states if the condition attached to the arrow
is met) is denoted by an open arrow, i.e., no specific state is
identified as the origin of the transition. When the condition
associated with a global transition is met, it supersedes all other
exit conditions including UCT. The special global condition BEGIN
supersedes all other global conditions, and once asserted remains
asserted until all state blocks have executed to the point that
variable assignments and other consequences of their execution remain
unchanged.
Jarno Rajahalme [Wed, 19 Nov 2014 17:24:52 +0000 (09:24 -0800)]
rstp: shift learned MAC addresses to new Root port.
All MAC addresses previously learned on a Root Port can be moved to an
Alternate Port that becomes the new Root Port; i.e., Dynamic Filtering
Entries for those addresses may be modified to show the new Root Port as
their source, reducing the need to flood frames when recovering from
some component failures.
Jarno Rajahalme [Thu, 13 Nov 2014 19:54:31 +0000 (11:54 -0800)]
classifier: Defer pvector publication.
This patch adds a new functions classifier_defer() and
classifier_publish(), which control when the classifier modifications
are made available to lookups. By default, all modifications are made
available to lookups immediately. Modifications made after a
classifier_defer() call MAY be 'deferred' for later 'publication'. A
call to classifier_publish() will both publish any deferred
modifications, and cause subsequent changes to to be published
immediately.
Currently any deferring is limited to the visibility of the subtable
vector changes. pvector now processes modifications mostly in a
working copy, which needs to be explicitly published with
pvector_publish(). pvector_publish() sorts the working copy and
removes gaps before publishing it.
This change helps avoiding O(n**2) memory behavior in corner cases,
where large number of rules with different masks are inserted or
deleted.
VMware-BZ: #1322017 Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Thu, 13 Nov 2014 19:54:31 +0000 (11:54 -0800)]
classifier: Make insert and replace take a const rule, too.
classifier_remove() was recently changed to take a const struct
cls_rule *. Make the corresponding change to classifier_replace() and
classifier_insert(). This simplifies existing calling sites in
ofproto.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Fri, 14 Nov 2014 23:58:09 +0000 (15:58 -0800)]
classifier: Remove internal mutex.
Almost all classifier users already exclude concurrent modifications,
or are single-threaded, hence the classifier internal mutex can be
removed. Due to this change, ovs-router.c and tnl-ports.c need new
mutexes, which are added.
As noted by Ben in review, ovs_router_flush() should also free the
entries it removes from the classifier. It now calls
ovsrcu_postpone() to that effect.
Suggested-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Thu, 13 Nov 2014 19:54:31 +0000 (11:54 -0800)]
classifier: Lockless and robust classifier iteration.
Previously, accurate iteration required writers to be excluded during
iteration. This patch adds an rculist to struct cls_subtable, and a
corresponding list node to struct cls_rule, which makes iteration more
straightforward, and allows the iterators to remain ignorant of the
internals of the cls_match. This new list allows iteration of rules
in the classifier by traversing the RCU-friendly subtables vector, and
the rculist of rules in each subtable.
Classifier modifications may be performed concurrently, but whether or
not the concurrent iterator sees those changes depends on the timing
of change. More specifically, an concurrent iterator:
- May or may not see a rule that is being inserted or removed.
- Will see either the new or the old version of a rule that is replaced.
- Will see all the other rules (that are not being modified).
Finally, The subtable's rculist also allows to make
classifier_rule_overlaps() lockless, which this patch also does.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>