summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* dpif-netdev: Fix windows build.Daniele Di Proietto2016-10-191-1/+1
| | | | | | | | | | | OVS_ALIGNED_VAR(...) should be at the beginning of a definition, as the example in include/openvswitch/compiler.h shows. Fixes: 38ee0814978c ("dpif-netdev: Cache align netdev_flow_keys.") Reported-by: Joe Stringer <joe@ovn.org> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sairam Venugopal <vsairam@vmware.com>
* ovsdb-idl: Check internal graph in OVSDB tests.Ben Pfaff2016-10-192-0/+124
| | | | | | | | | Some upcoming tests will add extra trickiness to the IDL internal graph. This worries me, because the IDL doesn't have any checks for its graph consistency. This commit adds some. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* ovsdb-idl: Mark ovsdb_idl_get_row_arc() parameter const.Ben Pfaff2016-10-192-2/+2
| | | | | | | | This function doesn't modify its 'dst_table' parameter, so it might as well be marked const. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* ovsdb-idl: Add some more implementation comments.Ben Pfaff2016-10-192-2/+38
| | | | | | | | I wrote this code and if I have to rediscover how it works, it's time to improve the commnts. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* ovsdb-idl: Sort and unique-ify datum in ovsdb_idl_txn_write().Ben Pfaff2016-10-191-5/+12
| | | | | | | | | | | | I noticed that there were lots of calls to ovsdb_datum_sort_unique() from "set" functions in generated IDL code. This moves that call into common code, reducing redundancy. There are more calls to the same function that are a little harder to remove. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* ovsdb-idl: Improve comment on ovsdb_idl_txn_write[_clone]().Ben Pfaff2016-10-191-17/+19
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* ovsdb-idlc: Use ovsdb_datum_from_smap() instead of open-coding it.Ben Pfaff2016-10-192-14/+11
| | | | | | | | | | | | There's no reason to have three copies of this code for every smap-type column. The code wasn't a perfect match for ovsdb_datum_from_smap(), so this commit also changes ovsdb_datum_from_smap() to better suit it. It only had one caller and the new design is adequate for that caller. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* timeval: Reorder elements in clock structure.Bhanuprakash Bodireddy2016-10-171-2/+2
| | | | | | | | | | | | | | By reordering the elements in clock structure, pad bytes can be reduced and also a cache line is saved. Before: structure size:136, holes:3, sum padbytes:18, cachelines:3 After: structure size:120, holes:1, sum padbytes:2, cachelines:2 Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com> Acked-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* netlink-socket: Reorder elements in nl_dump structure.Bhanuprakash Bodireddy2016-10-171-3/+3
| | | | | | | | | | | | | | By reordering the elements in nl_dump structure, pad bytes can be reduced there by saving a cache line. Before: structure size:72, holes:1, sum padbytes:4, cachelines:2 After: structure size:64, holes:0, sum padbytes:0, cachelines:1 Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com> Acked-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* dpif: Reorder elements in dpif_upcall structure.Bhanuprakash Bodireddy2016-10-171-1/+4
| | | | | | | | | | | | | | | | By reordering the data elements in dpif_upcall structure, pad bytes can be reduced and also a cache line. Also dp_packet should be the first member of the structure because rte_mbuf, the first member of dp_packet should be aligned atleast on a 64-byte boundary. Before: structure size:768, holes:1, sum padbytes:60, cachelines:12 After: structure size:704, holes:1, sum padbytes:4, cachelines:11 Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com> Acked-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* dpif-netdev: Reorder elements in dp_netdev_port structure.Bhanuprakash Bodireddy2016-10-171-1/+1
| | | | | | | | | | | | | By reordering the data elements in dp_netdev_port structure, pad bytes can be reduced and there by saving a cache line. Before: structure size:136, holes:3, sum padbytes:15, cachelines:3 After: structure size:128, holes:2, sum padbytes:7, cachelines:2 Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* dpif-netdev: Cache align netdev_flow_keys.Bhanuprakash Bodireddy2016-10-171-1/+1
| | | | | | | | | Aligning the 'keys' array seems to have positive performance impact. Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* dpif-netdev: Add comments to dp_netdev_input__().Bhanuprakash Bodireddy2016-10-171-0/+9
| | | | | | | | | | Add comments in dp_netdev_input__() to explain the reason behind clearing the flow batches before packet_batch_execute(). Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* hash: Skip Invoking mhash_add__() with zero input.Bhanuprakash Bodireddy2016-10-171-0/+5
| | | | | | | | | | | | | | mhash_add__() is expensive and should be only called with valid input. zero-valued 'data' will not affect the 'hash' value and expensive hash computation can be skipped when input is zero. This patch will validate the input in mhash_add__ to save some cpu cycles. Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* stream-ssl: Fix memory leak on error path.Ben Pfaff2016-10-171-1/+1
| | | | | | | | | The commit that this fixes is from 2009. Reported-by: Kai-Wei Fan <fank@vmware.com> Fixes: 9467fe624698 ("Add SSL support to "stream" library and OVSDB.") Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* dpdk: Fix DPDK pdump compilationCiara Loftus2016-10-132-3/+5
| | | | | | | | | The rte_pdump header file was not included in the file that requires it. Fix this. Fixes: 01961bbdd34a ("dpdk: New module with some code from netdev-dpdk.") Signed-off-by: Ciara Loftus <ciara.loftus@intel.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
* dpdk: New module with some code from netdev-dpdk.Daniele Di Proietto2016-10-1210-454/+527
| | | | | | | | | | | | | | | | | | | | There's a lot of code in netdev-dpdk which is not at all related to the netdev interface, mostly the library initialization code. This commit moves it to a new 'dpdk' module, to simplify 'netdev-dpdk'. Also a new module 'dpdk-stub' is introduced to implement some functions when DPDK is not available. This replaces the old 'netdev-nodpdk' module. Some redundant includes are removed or reorganized as a consequence. No functional change. CC: Aaron Conole <aconole@redhat.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
* netdev-dpdk: Change vlog module name to 'netdev_dpdk'.Daniele Di Proietto2016-10-121-1/+1
| | | | | | | | | | It is customary to have the vlog module name similar to the filename. Plus a following commit will introduce a 'dpdk' module. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
* netdev-dpdk: Use init() function to initialize classes.Daniele Di Proietto2016-10-121-18/+35
| | | | | | | | | | | | | | | It's better to use the classes init() functions to perform initialization required for classes. This will make it easier to move dpdk_init__() to a separate module in a future commit. No functional change. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
* netdev-dpdk: Remove useless 'rte_eal_init_ret'.Daniele Di Proietto2016-10-121-24/+4
| | | | | | | | | | If rte_eal_init() fails, we do not register the DPDK netdev classes, therefore it's impossible to reach the classes construct functions. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
* netdev-dpdk: Remove useless nonpmd_mempool_mutex.Daniele Di Proietto2016-10-121-25/+0
| | | | | | | | | | | | Since DPDK commit 30e639989227("mempool: support non-EAL thread"), non-EAL threads can use the mempool API safely. Plus, nonpmd threads access to netdev is already serialized with 'non_pmd_mutex' in dpif-netdev. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
* netdev-dpdk: Use xasprintf() when possible.Daniele Di Proietto2016-10-121-24/+17
| | | | | | | | | | We're in the slowpath. I find it easier to allocate and free memory, than to handle snprintf() error conditions. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
* netdev-dpdk: Do not abort if out of hugepage memory.Daniele Di Proietto2016-10-121-24/+38
| | | | | | | | | | | | | | | | | We can run out of hugepage memory coming from rte_*alloc() more easily than heap coming from malloc(). Therefore: * We should not use hugepage memory if we're going to access it only in the slowpath. * We shouldn't abort if we're out of hugepage memory. * We should gracefully handle out of memory conditions. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
* netdev-dpdk: Acquire dev->stats_lock only once.Daniele Di Proietto2016-10-121-8/+11
| | | | | | | Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
* netdev-dpdk: Use RCU for egress QoS.Daniele Di Proietto2016-10-121-138/+93
| | | | | | | | | | | | | | | | | | | | | I think it's clearer to use RCU than to check for a pointer twice in the fast path (before and after taking the spinlock). Now the spinlock is integrated into 'qos_conf'. 'qos_conf' objects cannot be modified, so, instead of having 'qos_set()', we now have 'qos_is_equal()', which tells us if an object must be destroyed and recreated. With this patch we also avoid passing the netdev parameter to qos ops, since it was unused most of the times. Lastly, some duplication is removed. CC: Ian Stokes <ian.stokes@intel.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
* netdev-dpdk: Refactor dpdk_mp_get().Daniele Di Proietto2016-10-121-20/+26
| | | | | | | | | | | | | The error handling path in dpdk_mp_get() is getting complicated, it even requires a boolean variable. Simplify it by extracting the function dpdk_mp_create(). CC: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
* netdev-nodpdk.c: Add missing copyright.Daniele Di Proietto2016-10-121-0/+16
| | | | | | | | | | | | Looks like we forgot to add the copyright headers to netdev-dpdk.h. Looking at the contribution history of the file, this commit adds the header with Red Hat copyright. CC: Aaron Conole <aconole@redhat.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Aaron Conole <aconole@redhat.com> Acked-by: Ben Pfaff <blp@ovn.org> Tested-by: Aaron Conole <aconole@redhat.com>
* netdev-dpdk.h: Add missing copyright.Daniele Di Proietto2016-10-121-0/+16
| | | | | | | | | | | Looks like we forgot to add the copyright headers to netdev-dpdk.h. Looking at the contribution history of the file, this commit adds the header with Nicira copyright. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
* dpif-netdev: Fix crash in dpif_netdev_execute().Daniele Di Proietto2016-10-121-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dp_netdev_get_pmd() is allowed to return NULL (even if we call it with NON_PMD_CORE_ID) for different reasons: * Since we use RCU to protect pmd threads, it is possible that ovs_refcount_try_ref_rcu() has failed. * During reconfiguration we destroy every thread. This commit makes sure that we always handle the case when dp_netdev_get_pmd() returns NULL without crashing (the change in dpif_netdev_run() doesn't fix anything, because everything is happening in the main thread, but it's better to honor the interface in case we change our threading model). This actually fixes a pretty serious crash that happens if dpif_netdev_execute() is called from a non pmd thread while reconfiguration is happening. It can be triggered by enabling bfd (because it's handled by the monitor thread, which is a non pmd thread) on an interface and changing something that requires datapath reconfiguration (n_rxq, pmd-cpu-mask, mtu). A testcase that reproduces the race condition is included. This is a possible backtrace of the segfault: #0 0x000000000060c7f1 in dp_execute_cb (aux_=0x7f1dd2d2a320, packets_=0x7f1dd2d2a370, a=0x7f1dd2d2a658, may_steal=false) at ../lib/dpif-netdev.c:4357 #1 0x00000000006448b2 in odp_execute_actions (dp=0x7f1dd2d2a320, batch=0x7f1dd2d2a370, steal=false, actions=0x7f1dd2d2a658, actions_len=8, dp_execute_action=0x60c7a5 <dp_execute_cb>) at ../lib/odp-execute.c:538 #2 0x000000000060d00c in dp_netdev_execute_actions (pmd=0x0, packets=0x7f1dd2d2a370, may_steal=false, flow=0x7f1dd2d2ae70, actions=0x7f1dd2d2a658, actions_len=8, now=44965873) at ../lib/dpif-netdev.c:4577 #3 0x000000000060834a in dpif_netdev_execute (dpif=0x2b67b70, execute=0x7f1dd2d2a578) at ../lib/dpif-netdev.c:2624 #4 0x0000000000608441 in dpif_netdev_operate (dpif=0x2b67b70, ops=0x7f1dd2d2a5c8, n_ops=1) at ../lib/dpif-netdev.c:2654 #5 0x0000000000610a30 in dpif_operate (dpif=0x2b67b70, ops=0x7f1dd2d2a5c8, n_ops=1) at ../lib/dpif.c:1268 #6 0x000000000061098c in dpif_execute (dpif=0x2b67b70, execute=0x7f1dd2d2aa50) at ../lib/dpif.c:1233 #7 0x00000000005b9008 in ofproto_dpif_execute_actions__ (ofproto=0x2b69360, version=18446744073709551614, flow=0x7f1dd2d2ae70, rule=0x0, ofpacts=0x7f1dd2d2b100, ofpacts_len=16, indentation=0, depth=0, resubmits=0, packet=0x7f1dd2d2b5c0) at ../ofproto/ofproto-dpif.c:3806 #8 0x00000000005b907a in ofproto_dpif_execute_actions (ofproto=0x2b69360, version=18446744073709551614, flow=0x7f1dd2d2ae70, rule=0x0, ofpacts=0x7f1dd2d2b100, ofpacts_len=16, packet=0x7f1dd2d2b5c0) at ../ofproto/ofproto-dpif.c:3823 #9 0x00000000005dea9b in xlate_send_packet (ofport=0x2b98380, oam=false, packet=0x7f1dd2d2b5c0) at ../ofproto/ofproto-dpif-xlate.c:5792 #10 0x00000000005bab12 in ofproto_dpif_send_packet (ofport=0x2b98380, oam=false, packet=0x7f1dd2d2b5c0) at ../ofproto/ofproto-dpif.c:4628 #11 0x00000000005c3fc8 in monitor_mport_run (mport=0x2b8cd00, packet=0x7f1dd2d2b5c0) at ../ofproto/ofproto-dpif-monitor.c:287 #12 0x00000000005c3d9b in monitor_run () at ../ofproto/ofproto-dpif-monitor.c:227 #13 0x00000000005c3cab in monitor_main (args=0x0) at ../ofproto/ofproto-dpif-monitor.c:189 #14 0x00000000006a183a in ovsthread_wrapper (aux_=0x2b8afd0) at ../lib/ovs-thread.c:342 #15 0x00007f1dd75eb444 in start_thread (arg=0x7f1dd2d2c700) at pthread_create.c:333 #16 0x00007f1dd6e1d20d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109 Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org>
* smap: New macro SMAP_CONST2 for an immutable map of 2 key-value pairs.Ben Pfaff2016-10-071-9/+17
| | | | | | | Future commits will add a user. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* json: Fix non-static json char lookup table.Joe Stringer2016-10-061-1/+1
| | | | | | | | | | | | This warning breaks the build on travis: lib/json.c:1627:12: error: symbol 'chars_escaping' was not declared. Should it be static? CC: Esteban Rodriguez Betancourt <estebarb@hpe.com> Reported-At: https://travis-ci.org/openvswitch/ovs/jobs/165300417 Fixes: 644ecb10a661 ("json: Serialize strings using a lookup table") Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovn-nbctl: Check the length of MAC addressnickcooper-zhangtonghao2016-10-051-2/+4
| | | | | | | | | | | | The command "ovn-nbctl lrp-add" should not set the MAC address which length is invalid to logical router port. This patch updates the eth_addr_from_string() to check trailing characters. We should use the ovs_scan() to check the "addresses" owned by the logical port, instead of eth_addr_from_string(). This patch also updates the ovn-nbctl tests. Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech> Signed-off-by: Ben Pfaff <blp@ovn.org>
* json: Serialize strings using a lookup tableRodriguez Betancourt, Esteban2016-10-051-36/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing implementation uses a switch with many conditions, that when compiled is translated to a not optimal series of conditional jumps. With a lookup table the generated code has less conditional jumps, that should translate in improving the CPU ability to predict the jumps. Performance Comparison: All the timings are in nanoseconds, "OVS Master" corresponds to 13a1d36. N is the number of repetitions Serialize vswitch.ovsschema N OVS Master Lookup Table Difference Diff per op 1 233182 200369 32813 32813 10 2724931 1919168 805763 80576.3 100 22802794 24406648 -1603854 -16038.54 1000 253645888 206259760 47386128 47386.128 10000 2352245703 1906839780 445405923 44540.5923 100000 23967770920 19012178655 4955592265 49555.92265 Serialize echo example N OVS Master Lookup Table Difference Diff per op 1 3857 12565 -8708 -8708 10 17403 7312 10091 1009.1 100 57859 56613 1246 12.46 1000 592310 528110 64200 64.2 10000 6096334 5576109 520225 52.0225 100000 60970439 58477626 2492813 24.92813 Serialize mutate example N OVS Master Lookup Table Difference Diff per op 1 7115 19051 -11936 -11936 10 34110 39561 -5451 -545.1 100 296613 298645 -2032 -20.32 1000 3510499 2930588 579911 579.911 10000 33898710 30278631 3620079 362.0079 100000 305069356 280622992 24446364 244.46364 Signed-off-by: Esteban Rodriguez Betancourt <estebarb@hpe.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* json: Use reference counting in JSON objectsRodriguez Betancourt, Esteban2016-10-041-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After profiling OVSDB insert performance it was found that some significant portion of its time OVSDB is calling the function json_clone. Also, the current usages of json_clone never modify the json, just keeps it to prevent it to be freed. With that in mind the struct json, json_create, json_clone and json_destroy were modified to keep a count of how many references of the json struct are left. Only when that count reaches zero the json struct is freed. The old "json_clone" function was renamed as "json_deep_clone". Some examples of the performance difference: In these tests a test table with 4 columns (string, string, bool, integer) was used. All the tests used "commit block". *** 50 process each inserting 1000 rows *** Master OVS Test Duration 131 seconds Average Inserts Per second 746.2687 inserts/s Average Insert Duration 134.1382 ms Minimal Insert Duration 0.166202 ms Maximum Insert Duration 489.8593 ms JSON GC Patch Test Duration 86 seconds Average Inserts Per second 1176 inserts/s Average Insert Duration 82.26761 ms Minimal Insert Duration 0.165448 ms Maximum Insert Duration 751.2111 ms *** 5 process each inserting 10000 rows *** Master OVS Test Duration 8 seconds Average Inserts Per second 7142.857 inserts/s Average Insert Duration 0.656431 ms Minimal Insert Duration 0.125197 ms Maximum Insert Duration 11.93203 ms JSON GC Patch Test Duration 7 seconds Average Inserts Per second 8333.333 inserts/s Average Insert Duration 0.55688 ms Minimal Insert Duration 0.143233 ms Maximum Insert Duration 26.26319 ms Signed-off-by: Esteban Rodriguez Betancourt <estebarb@hpe.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* netdev-linux: double tagged packets should use 0x88a8Eric Garver2016-10-041-3/+11
| | | | | | | | | | | | | We need to check if a packet is double tagged. If so make sure to push 0x88a8 instead of 0x8100. Without this a simple port redirect of 802.1ad frames means the outer tag gets translated from 0x88a8 to 0x8100 by the userspace datapath. This only affected kernels that don't use TP_STATUS_VLAN_TPID_VALID, which is kernels < 3.14. Signed-off-by: Eric Garver <e@erig.me> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovn-nbctl: Add LB commands.nickcooper-zhangtonghao2016-10-032-0/+28
| | | | | | | | | | | | | | This patch provides the command line to create a load balancer. You can create a load balancer independently and add it to multiple switches or routers. A single load balancer can have multiple vips. Add a name column for the load balancer. With --add-duplicate, the command really creates a new load balancer with a duplicate name. This name has no special meaning or purpose other than to provide convenience for human interaction with the ovn-nb database. This patch also provides the unit tests and the documentation. Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
* tests/bundle: test bundle action with ports up and downThadeu Lima de Souza Cascardo2016-10-031-1/+2
| | | | | | | | | | | | | | Also, add the keyword bundle_action to all the tests in bundle.at, distinguishing it from OF bundles. It came to my attention recently that bundle_load will load 0xFFFF in case all the slaves are down, as bundle_execute will return OFPP_NONE. As I noticed this was not explicitly tested, not even for the bundle action, I thought it would be nice to do it as a way of documenting this behavior. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Change some old references to nicira-ext.h.Thadeu Lima de Souza Cascardo2016-09-303-3/+3
| | | | | | | | Some of these references are not valid anymore, as things were moved to either meta-flow.h or ofp-actions.c. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* netdev-dpdk: Configure flow control only when necessary.Ilya Maximets2016-09-301-10/+14
| | | | | | | | | | | | It is not necessary to touch the physical device each time, if the configuration has not been changed. Also, few style issues fixed. Thread-safety annotation added to 'dpdk_set_rxq_config()'. It was missed while previous refactoring of the flow control configuration. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Tested-by: Sugesh Chandran <sugesh.chandran@intel.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
* netdev-dpdk: Allow configurable queue sizes for 'dpdk' portsCiara Loftus2016-09-301-7/+54
| | | | | | | | | | | | | The 'options:n_rxq_desc' and 'n_txq_desc' fields allow the number of rx and tx descriptors for dpdk ports to be modified. By default the values are set to 2048, but can be modified to an integer between 1 and 4096 that is a power of two. The values can be modified at runtime, however require the NIC to restart when changed. Signed-off-by: Ciara Loftus <ciara.loftus@intel.com> Acked-by: Yunhong Jiang <yunhong.jiang@linux.intel.com> Acked-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
* netdev-dpdk: Fix coding styleMark Kavanagh2016-09-291-34/+41
| | | | | | | | | | | | | Coding style violations of the following conventions are present in netdev-dpdk.c: - limit lines to 79 characters - put a space after (but not before) the "sizeof" keyword - put a space between the () used in a cast and the expression whose type is cast: (void *) 0. Resolve occurrences of each, and any other minor style infractions. Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
* netdev-dpdk: consistent naming for mbuf variablesMark Kavanagh2016-09-291-17/+17
| | | | | | | | | | | Pointers to struct rte_mbuf are typically denoted within functions as 'pkt'; similarly, arrays of, and pointer-to-pointer to, struct rte_mbuf are denoted by 'pkts'. Update discrepancies to the above convention for consistency. Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* netdev-dpdk: Introduce dpdk_mp_mutex.Ilya Maximets2016-09-291-27/+28
| | | | | | | | | 'dpdk_mutex' protects two independent things: list of dpdk devices and list of memory pools. Let's spit it in two to avoid global blocking inside 'netdev_dpdk.*_reconfigure()' as possible. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
* ofp-actions: Always consider inconsistent CT actions as an error.Jarno Rajahalme2016-09-271-2/+5
| | | | | | | | | We can't downgrade to OF1.0 and expect inconsistent CT actions be silently discarded. Instead, datapath flow install fails, so it is better to flag inconsistent CT actions as hard errors. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* ofp-actions: Check that 'alg=ftp' matches on TCP.Jarno Rajahalme2016-09-271-1/+2
| | | | | | | | | Datapath flow setup fails when setting the FTP helper on an unsupported IP protocol. It is better to fail at the OpenFlow rule set-up time instead. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* ofp-actions: Style fixes.Jarno Rajahalme2016-09-271-5/+3
| | | | | | | Replace a tab by a space and remove an unnecessary variable. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
* netdev-linux: Use ethtool when miimon fails.David Hill2016-09-271-3/+2
| | | | | | | | | | Some network drivers might return true to SIOCGMIIPHY and an error on SIOCGMIIREG when using MII to query phy state. Fall back to ethtool if this happens to allow failover to work when using such nics. Reported-at: http://openvswitch.org/pipermail/dev/2016-August/078800.html Signed-off-by: David Hill <dhill@redhat.com> Signed-off-by: Joe Stringer <joe@ovn.org>
* openvswitch: Allow external IPsec tunnel management.Pravin B Shelar2016-09-272-67/+1
| | | | | | | | | | | | | | | | | | OVS GRE IPsec tunnel support has multiple issues, Therefore it was deprecated in OVS 2.6. Following patch removes support for GRE IPsec and allows external IPsec tunnel management for any type of tunnel not just GRE. e.g. user can encrypt Geneve or VxLan traffic. It can be done by using openflow pipeline to set skb-mark and using IPsec keying daemons to implement IPsec tunnels. This packet can be matched for the skb-mark to encrypt selective tunnel traffic. VMware-BZ: 1710701 Signed-off-by: Pravin B Shelar <pshelar@ovn.org> Acked-by: Ansis Atteka <aatteka@ovn.org>
* openvswitch: deprecates support for IPsec tunnel port.Pravin B Shelar2016-09-241-0/+2
| | | | | | | | | | | | | OVS IPsec tunnel support has issues: 1. It only works for GRE. 2. only works on Debian. 3. It does not allow user to match on packet-mark on packet received on tunnel ports. This patch deprecates support for IPsec tunnel port. Signed-off-by: Pravin B Shelar <pshelar@ovn.org> Acked-by: Ansis Atteka <aatteka@ovn.org>
* netdev-dpdk: More correct log message on vhost_driver_unregister failure.Ilya Maximets2016-09-231-1/+2
| | | | | | | | Current error message incorrect for the client mode. Fixes: c1ff66ac80b5 ("netdev-dpdk: vHost client mode and reconnect") Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>