summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* datapath-windows: Avoid BSOD when switch context is NULLSorin Vinturis2014-11-202-5/+11
| | | | | | | | | | | | | | | | | 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. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/53 Acked-by: Eitan Eliahu <eliahue@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: Fixes in HvCreatePort() to re-add a portNithin Raju2014-11-201-7/+62
| | | | | | | | | | | | | | | | | | | | | | 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. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: Change return type of OvsInitVxlanTunnel()Nithin Raju2014-11-204-6/+13
| | | | | | | | | | 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. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: Changes to InitOvsVportCommon()Nithin Raju2014-11-202-12/+18
| | | | | | | | | | | | | | | | | 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. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: Changes to OvsRemoveAndDeleteVport()Nithin Raju2014-11-203-49/+89
| | | | | | | | | | | | | | | | 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. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: clarify 'portIdHashArray' in the swithc contextNithin Raju2014-11-201-1/+4
| | | | | | | | | | | | 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. Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: add WCHAR version of OvsFindVportByHvName()Nithin Raju2014-11-203-24/+34
| | | | | | | | | | | | | | 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. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath-windows: fixes in OvsGetExtInfoIoctl()Nithin Raju2014-11-201-2/+14
| | | | | | | | A few fixes around locking. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* Fix build break in ofproto/tunnel.c for windows platform.Saurabh Shah2014-11-201-0/+1
| | | | | | | | | | The breakage was introduced by commit: a36de779 ("openvswitch: Userspace tunneling."). Reported-by: Edwin Chiu <echiu@nicira.com> Signed-off-by: Saurabh Shah <ssaurabh@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* datapath: compat: Fix build on RHEL 6.6Pravin B Shelar2014-11-192-1/+7
| | | | | | | | RHEL 6.6 kernel percpu APIs are broken, so following patch is using OVS backported version. Reported-by: Wang Sheng-Hui <shhuiw@gmail.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
* ofproto-dpif: fix bundle_move() call in rstp_run().Daniele Venturino2014-11-191-2/+2
| | | | | | | bundle_move() expects two struct ofbundle pointers as arguments, but void pointers hide the error. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp: refactor RSTP setters.Daniele Venturino2014-11-191-54/+64
| | | | | | | | With this patch setters invoke procedures only if values have changed. Also rstp_set_bridge_address__() keeps the existing priority in the bridge_identifier. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp-state-machines: fix proposal reception behaviour.Jarno Rajahalme2014-11-191-2/+26
| | | | | | | | | | 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. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp: Fix global transitions.Jarno Rajahalme2014-11-191-78/+188
| | | | | | | | | | | | | | | | | | | | | 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. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp: shift learned MAC addresses to new Root port.Jarno Rajahalme2014-11-195-22/+148
| | | | | | | | | | | 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. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* classifier: Defer pvector publication.Jarno Rajahalme2014-11-149-124/+198
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* classifier: Make insert and replace take a const rule, too.Jarno Rajahalme2014-11-143-11/+13
| | | | | | | | | 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>
* classifier: Remove internal mutex.Jarno Rajahalme2014-11-146-87/+56
| | | | | | | | | | | | | | 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>
* classifier: Lockless and robust classifier iteration.Jarno Rajahalme2014-11-1410-118/+115
| | | | | | | | | | | | | | | | | | | | | | | 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>
* classifier: Do not insert duplicate rules in indices.Jarno Rajahalme2014-11-144-145/+178
| | | | | | | | | | | | | There is no point in adding duplicate information into prefix tries. Also, since the lower-priority duplicate rules are not visible to lookups, they do not need to be in staged lookup indices directly either (the head rule is). Finally, now that cmap operations return the number of elements in the cmap, subtable's 'n_rules' member is not needed any more. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* datapath-windows: Remove all duplicate checks for NULL.Sorin Vinturis2014-11-144-80/+13
| | | | | | | | | | | | Right now the gOvsSwitchContext pointer is checked against NULL in a lot of places of the OVS extension code. This check should be done only once to avoid wasteful checks. Thus I have added the check in the dispatch routine, before doing any processing, and removed all other checks from the rest of the code. Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* rstp-state-machines: fix rcv_info().Daniele Venturino2014-11-141-5/+8
| | | | | | | A Config BPDU always conveys a Designated Port Role. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp: Refactor rstp_port_set_administrative_bridge_port__().Jarno Rajahalme2014-11-142-4/+19
| | | | | | | | | | | | Invoke move_rstp__() in rstp_port_set_administrative_bridge_port__() if port is not initializing. This is necessary in a test that checks that a Port becoming alternate/backup/disabled stops learning and forwarding. The move_rstp__() call is necessary to immediatly disable learning and forwarding on that port. Without this, the test fails. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp: Refactor rstp_check_and_reset_fdb_flush().Jarno Rajahalme2014-11-143-31/+49
| | | | | | | | | With this commit, RSTP is able to flush from the MAC learning table entries pertaining to a single port. Before this commit the whole table was flushed every time a port requested flushing actions. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* stp,rstp: disable learning and forwarding in STP/RSTP disabled state.Daniele Venturino2014-11-144-23/+23
| | | | | | | | | | | | | There is a difference between a port with STP/RSTP protocol enabled and a disabled role and a port which has a disabled role because STP/RSTP is not active. This commit ensure to make such distinction. Standard 802.1D claims that the Topology Change state machine (17.31) treats a Port as no longer active when it becomes an Alternate, Backup, or Disabled Port and stops learning from received frames. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp: Invoke updt_roles_tree__() in max_age and forward_delay setters.Jarno Rajahalme2014-11-141-4/+10
| | | | | | | | | | | | | | This patch was necessary in a test on the acceptable range values of max_age and forward_delay. Since rstp_set_bridge_max_age__() and rstp_set_bridge_forward_delay__() set the rstp->bridge_max_age and rstp->bridge_forward_delay variables, it was necessary to call updt_roles_tree__() to immediately update p->designated_times, used in tx_rstp() (in lib/rstp-state-machines.c). After this change the validation software received the expected maxAge and forwardDelay values. Otherwise, such test failed. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp-state-machines: fix TCN reception.Daniele Venturino2014-11-141-0/+8
| | | | | | | | | Set rcdv_tcn and return OTHER_INFO when a TOPOLOGY_CHANGE_NOTIFICATION_BPDU is received, as required by 802.1Q-2008. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp-state-machines: Rename ALTERNATE_AGREED state as ALTERNATE_AGREED_EXEC.Daniele Venturino2014-11-142-3/+3
| | | | | | | | All other similar port_role_transition_sm states are named according to this pattern. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp-state-machines: Fix updt_roles_tree().Daniele Venturino2014-11-141-1/+1
| | | | | | | | | If the DesignatedBridgeID Bridge Address component is equal to that component of the Bridge's own bridge priority vector skip to the next port. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp-state-machines: Fix Topology Change State Machine transition.Daniele Venturino2014-11-141-1/+1
| | | | | | | | | | | | Accordingly to the 802.1D-2004 standard, the transition from the TOPOLOGY_CHANGE_SM_NOTIFIED_TCN_EXEC state should go to the TOPOLOGY_CHANGE_SM_NOTIFIED_TC_EXEC state and not to the TOPOLOGY_CHANGE_SM_ACTIVE. See section 17.31 of 802.1D-2004 standard. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp-state-machines: Fix compare_rstp_priority_vector().Daniele Venturino2014-11-141-4/+14
| | | | | | | | | The bridge_port_id is never conveyed in Configuration Messages, but is used as a tie-breaker within a Bridge. This patch extends the comparison to this fifth field in a rstp_priority_vector. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp-state-machines: Fix reception of BPDUs conveying an unknown port role.Jarno Rajahalme2014-11-141-2/+17
| | | | | | | | If the Unknown value of the Port Role parameter is received, the state machines should treat the RST BPDU as if it were a Configuration BPDU. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp: Add 'rstp-admin-p2p-mac' and 'rstp-admin-port-state' setters.Jarno Rajahalme2014-11-147-14/+81
| | | | | | | | | | | | | | | | 'rstp-admin-port-state' is the Administrative Bridge Port state variable defined in the 802.1D-2004 standard. It can be set to include or exclude a port from the active topology by management (section 7.4). operPointToPointMAC and 'rstp-admin-p2p-mac' are a pair of parameters that permit inspection of, and control over, the administrative and operational state of the point-to-point status of the MAC entity by the MAC Relay Entity. adminPointToPointMAC can be set by management and its value is reflected on operPointToPointMAC. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* rstp: Show some useful rstp port fields.Jarno Rajahalme2014-11-140-0/+0
| | | | | | | | designated_bridge_id, designated_port_id and designated_path_cost are now displayed in rstp_status when using 'ovs-vsctl list port'. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* tests: Skip tunnel-push-pop test on Windows and BSD.Pravin B Shelar2014-11-143-1/+13
| | | | | | | Also updates ovs-router README documentation. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
* rstp: Show some useful rstp port fields.Jarno Rajahalme2014-11-135-6/+25
| | | | | | | designated_bridge_id, designated_port_id and designated_path_cost are now displayed in rstp_status when using 'ovs-vsctl list port'. Signed-off-by: Daniele Venturino <daniele.venturino@m3s.it> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* ovs-ofctl: Support bucket commandsSimon Horman2014-11-133-3/+175
| | | | | | | | | | (Draft) OpenFlow 1.5 flow mod commands include commands to manipulate the buckets of existing groups. This patch add support to ovs-ofctl for these commands. It also adds documentation and tests for them. ONF-JIRA: EXT-350 Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofproto: Handle (draft) OpenFlow 1.5 insert and remove group commands.Simon Horman2014-11-131-1/+114
| | | | | | | | | Handle (draft) OpenFlow 1.5 insert and remove group commands of group mod messages. ONF-JIRA: EXT-350 Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* openflow: Add OpenFlow 1.4 packet-in reasons.Shu Shen2014-11-132-1/+10
| | | | | Signed-off-by: Shu Shen <shu.shen@radisys.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* rhel: Include pkgconfig and update header install in Fedora/RHEL spec.Thomas Graf2014-11-132-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | As headers are installed by 'make install' now, the explicit install instructions can be be removed from the spec file. The spec file has been including <config.h> plus all headers in lib/ so far which is dangerous: * config.h is a description of the capabilities of the build machine where the package was built. Although it may hint on what is included in the library, the defines do not necessarily hold true on another build machine. * Some headers in lib/ do not contain proper prefixes and pollute the global header name space. Do not include them anymore. Properly cleaned up headers will be exposed in openvswitch/ and openflow/ For the RHEL spec, both pkgconfig and headers are omitted as no -devel package exists yet. Cc: Flavio Leitner <fbl@redhat.com> Suggested-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* lib: Add support for pkgconfig for libsflow.Thomas Graf2014-11-134-1/+15
| | | | | | Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* lib: Add support for pkgconfig for libovsdb.Thomas Graf2014-11-134-0/+16
| | | | | | Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* lib: Add support for pkgconfig for libofproto.Thomas Graf2014-11-134-0/+15
| | | | | | Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* lib: Add support for pkgconfig for libopenvswitch.Rob Adams2014-11-136-0/+19
| | | | | | | | | Add rule to generate pkgconfig .pc file from configure. Install pkg-config file to $(libdir)/pkgconfig Signed-off-by: Rob Adams <readams@readams.net> Acked-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* include: Install openflow/ and openvswitch/ headers.Thomas Graf2014-11-132-2/+4
| | | | | | | Suggested-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* dpif-netdev: Allow direct destroy of 'struct dp_netdev_port'.Alex Wang2014-11-121-18/+42
| | | | | | | | | | | | | | | | | | Before this commit, when 'struct dp_netdev_port' is deleted from 'dpif-netdev' datapath, if there is pmd thread, the pmd thread will release the last reference to the port and ovs-rcu postpone the destroy. However, the delayed close of object like 'struct netdev' could cause failure in immediate re-add or reconfigure of the same device. To fix the above issue, this commit uses condition variable and makes the main thread wait for pmd thread to release the reference when deleting port. Then, the main thread can directly destroy the port. Reported-by: Cian Ferriter <cian.ferriter@intel.com> Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* ofproto-dpif-xlate: Allow direct destroy of previous config.Alex Wang2014-11-121-2/+2
| | | | | | | | | | | | | | | | Before this commit, the ofproto-dpif-xlate module uses ovs-rcu to postpone the destroy of previous configuration. However, the delayed close of object like 'struct netdev' could cause failure in immediate re-add or reconfigure of the same device. To fix the above issue, this commit makes the ofproto-dpif-xlate module call ovsrcu_synchronize(), which waits for all threads to finish the use of reference to previous config. Then, the module can just directly destroy the previous config. Reported-by: Cian Ferriter <cian.ferriter@intel.com> Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* dpif-netdev: Move 'struct dp_netdev_port' initialization before use.Alex Wang2014-11-121-3/+3
| | | | | | | | | | | | | There is a portion of the 'struct dp_netdev_port' initialization that is placed after the reload of pmd threads. This means in theory, there could be a race where pmd threads access half- initialized struct. Although such race has not been seen, it makes sense to fully initialize the struct before use. Found by code inspection. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* classifier: Integrate insert_rule() into classifier_replace().Jarno Rajahalme2014-11-121-113/+97
| | | | | | | | insert_rule() only had one caller and this makes the code easier to understand. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* tests: Fix ovs-ofctl rule with importance test case.Jarno Rajahalme2014-11-121-6/+4
| | | | | | | Sort the flow dump results to always have them in consistent order. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>